Consider $p^{2}+p-6$. Factor the expression by grouping. First, the expression needs to be rewritten as $p^{2}+ap+bp-6$. To find $a$ and $b$, set up a system to be solved.
$$a+b=1$$ $$ab=1\left(-6\right)=-6$$
Since $ab$ is negative, $a$ and $b$ have the opposite signs. Since $a+b$ is positive, the positive number has greater absolute value than the negative. List all such integer pairs that give product $-6$.
$$-1,6$$ $$-2,3$$
Calculate the sum for each pair.
$$-1+6=5$$ $$-2+3=1$$
The solution is the pair that gives sum $1$.
$$a=-2$$ $$b=3$$
Rewrite $p^{2}+p-6$ as $\left(p^{2}-2p\right)+\left(3p-6\right)$.
$$\left(p^{2}-2p\right)+\left(3p-6\right)$$
Factor out $p$ in the first and $3$ in the second group.
$$p\left(p-2\right)+3\left(p-2\right)$$
Factor out common term $p-2$ by using distributive property.