Consider $x^{2}+6x+8$. Factor the expression by grouping. First, the expression needs to be rewritten as $x^{2}+ax+bx+8$. To find $a$ and $b$, set up a system to be solved.
$$a+b=6$$ $$ab=1\times 8=8$$
Since $ab$ is positive, $a$ and $b$ have the same sign. Since $a+b$ is positive, $a$ and $b$ are both positive. List all such integer pairs that give product $8$.
$$1,8$$ $$2,4$$
Calculate the sum for each pair.
$$1+8=9$$ $$2+4=6$$
The solution is the pair that gives sum $6$.
$$a=2$$ $$b=4$$
Rewrite $x^{2}+6x+8$ as $\left(x^{2}+2x\right)+\left(4x+8\right)$.
$$\left(x^{2}+2x\right)+\left(4x+8\right)$$
Factor out $x$ in the first and $4$ in the second group.
$$x\left(x+2\right)+4\left(x+2\right)$$
Factor out common term $x+2$ by using distributive property.