Trigonometry and Quadratics If $\tan A$ and $\tan B$ are the roots of $x^2+px+q=0$, then prove that 
$$\sin^2(A+B)+p \sin(A+B) \cos(A+B) + q \cos^2(A+B) = q$$
My Attempt:
Using the sum and product formulae we have,
$q=\tan A\tan B, $        $-p=\tan A+\tan B$
And,
$\tan (A+B)=\frac{\tan A+\tan B}{1-\tan A\tan B} \Rightarrow \tan (A+B)=\frac{-p}{1-q}$

You are going absolutely correct.
Now proceed as follows:
$$\frac{\sin (A+B)}{\cos (A+B)}=-\frac{p}{1-q}$$
$$\implies (1-q)\sin(A+B)=-p\cos (A+B)$$
$$\implies \sin(A+B)+p\cos (A+B)=q\sin(A+B)$$
Multiplying both sides by $\sin(A+B)$, we get $$\sin^2(A+B)+p\sin(A+B)\cos (A+B)=q\sin^2(A+B)=q-q\cos^2(A+B)$$
Hence we rearrange to get 
$$\sin^2(A+B)+p \sin(A+B) \cos(A+B) + q \cos^2(A+B) = q$$
Hope this helps.
