Factor the expression by grouping. First, the expression needs to be rewritten as $x^{2}+ax+bx+12$. To find $a$ and $b$, set up a system to be solved.
$$a+b=7$$ $$ab=1\times 12=12$$
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 $12$.
$$1,12$$ $$2,6$$ $$3,4$$
Calculate the sum for each pair.
$$1+12=13$$ $$2+6=8$$ $$3+4=7$$
The solution is the pair that gives sum $7$.
$$a=3$$ $$b=4$$
Rewrite $x^{2}+7x+12$ as $\left(x^{2}+3x\right)+\left(4x+12\right)$.
$$\left(x^{2}+3x\right)+\left(4x+12\right)$$
Factor out $x$ in the first and $4$ in the second group.
$$x\left(x+3\right)+4\left(x+3\right)$$
Factor out common term $x+3$ by using distributive property.