<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] $$\text {We have } \tan A+\tan B=-p\; \text { and  }\; \tan A \tan B=q.$$ Let  $C=A+B.$ Let $F=\sin^2 C + p\sin C \cos C + q\cos^2 C-q.\quad$ CASE 1. $\cos C=0.$ Then $$F=1-q,\; \text {and}$$ $$0=\cos C=\cos (A+B)\implies \tan B=\cot A\implies q=\tan A \tan B=1.$$  CASE 2. $\cos C\ne 0.$ Then $\;\tan C\;$ is defined : $$\tan C=\tan (A+B)=(\tan A+\tan B)/(1-\tan A \tan B)=\frac {-p}{1-q}.$$  And we have $F/(\cos^2 C)= \tan^2 C +p\tan C +q(1-\sec^2 C)=$ $=\tan^2 C+p\tan C+q(-\tan^2 C)= (\tan C) \;([1-q]\tan C+p)=$$(\tan C) \;([1-q]\frac {[-p]}{[1-q]}+p)=0.$
</s>