for the first, 3x is a common term. just factor it out

for the second, in general we use what we call the AC-method to factor, if possible, a quadratic in which the coefficient of the squared term is not 1. but for small numbers like 2, we can use trial and error, it would generally be a lot simpler.

so

now in the place of and , you want numbers that multiply to give you -3, but and will add to give -5