<s>[INST] Factorize Trigonometric Equation: $ 3\sin(x)^2 - 2\sin(x)\cos(x) - \cos(x)^2 = 0 $ I have a problem with the following trigonometric equation:
$$ 3\sin(x)^2 - 2\sin(x)\cos(x) - \cos(x)^2 = 0 $$
It's from the book Engineering Mathematics 7th edition by Stroud.
The book is giving the answer, but I can't seem to be able to find out how to factorize it. I can't figure it out.
Consider the following solution:

This equation can be written as $3\sin ^2x-\cos ^2x = 2\sin x \cos x.$
That is: $3\sin ^2x-2\sin x \cos x-\cos ^2 x = 0.$
That is: $(3\sin x + \cos x)(\sin x - \cos x) = 0.$
So that $3 \sin x \cos x = 0$ or $\sin x - \cos x = 0.$
If $3 \sin x + \cos x = 0,$ then $\tan x = \frac{-1}{3},$ and so $x = -0.3218 ± n \pi,$ and if $\sin x - \cos x = 0,$ then $\tan x = 1,$ and so $x = \frac{\pi}{4}.$

If anyone could help me understand how to factorize this equation to get the one shown in the image it would help me very much.
Thank you in advance.
 [/INST] Think of it like this:
Take $a=\sin x$ and $b=\cos x$. Then you have,
$$3a^2-2ab-b^2=3a^2-3ab+ab-b^2=3a(a-b)+b(a-b)=(a-b)(3a+b)$$
Substitute everything back and you have,
$$3\sin^2 x-2\sin x\cos x-\cos^2 x=(\sin x-\cos x)(3\sin x+\cos x)$$
</s>