<s>[INST] Trigonometry with Quadratic Equations 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$$
I tried the question but with $q$ other terms came associated.
 [/INST] Using the sum and product formulae we have,
$q=tanAtanB, $        $-p=tanA+tanB$
And,
$tan(A+B)=\frac{tanA+tanB}{1-tanAtanB} \Rightarrow tan(A+B)=\frac{-p}{1-q}$
Now, 
$\frac{p^{2}-p^{2}}{1-q}=0 \Rightarrow (\frac{p}{1-q})^{2}(1-q)+p(\frac{-p}{1-q})=0 \Rightarrow [tan(A+B)]^{2}(1-q)+p[tan(A+B)]=0 \Rightarrow [\frac{sin(A+B)}{cos(A+B)}]^{2}(1-q)+p[\frac{sin(A+B)}{cos(A+B)}]=0 \Rightarrow sin^{2}(A+B)+p(sin(A+B)cos(A+B))-q(sin^{2}(A+B))=0 \Rightarrow sin^{2}(A+B)+p[sin(A+B)cos(A+B)]+qcos^{2}(A+B))=q$
</s>