factoring a trig function

I can do the basic ones, but when they have a coefficient in front of the first term I dont know what to do.

$\displaystyle 2cos^2x-7cosx-3$

I thought maybe you do

(2cosx-1)(cosx-3)

Edit nevermind That is right.

BUt is there a better way to solve these other than putting the first term in the first bracket and the guessing at multiples of the last term?

because with one like 6sin^2x+sinx-1 I get (6sinx-1)(sinx+1)

and its supposed to be(2sinx-1)(3sinx-1)

Im confused with factoring these, could I have some help please.

thanks.