<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] Since $\tan A$ and $\tan B$ are the roots of $x^2+px+q=0$, you know that
$$
\tan A+\tan B=-p,
\qquad
\tan A\tan B=q
$$
so
$$
\tan(A+B)=\frac{\tan A+\tan B}{1-\tan A\tan B}=
\frac{-p}{1-q}=\frac{p}{q-1}
$$
provided $q\ne1$.
The relation to be proved can be written
$$
\sin^2C+p\sin C\cos C+q\cos^2C=q
$$
where $C=A+B$, or
$$
\sin^2C+p\sin C\cos C-q\sin^2C=0
$$
recalling that $\cos^2C-1=-\sin^2C$. If $\cos C\ne0$ (I'll return to this later), this is equivalent to showing that
$$
(1-q)\tan^2C+p\tan C=0
$$
But, substituting the value found before, we have
$$
(1-q)\frac{p^2}{(q-1)^2}+p\frac{p}{q-1}=-\frac{p^2}{q-1}+\frac{p^2}{q-1}=0
$$
The case $\cos C=0$ corresponds to $\tan C$ not existing, that is, $q=1$. In this case the relation to be proved is
$$
\sin^2C=1
$$
which is true, if $\cos C=0$.
</s>