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 can proceed easily after finding $\tan (A+B)$.   
So we have $$p =\tan (A+B)(q-1) $$ So substituting into the LHS we get, $$\sin^2 (A+B)+ (q-1)\tan (A+B)\sin (A+B)\cos (A+B) +q \cos^2 (A+B) = \sin ^2 (A+B) +(q-1)\sin ^2(A+B) +q\cos ^2 (A+B) =q\sin ^2 (A+B) +q\cos ^2 (A+B) =q $$ Hope it helps. 
