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