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.
 A: Hint : Let $E=\sin^2(A+B)+p \sin(A+B) \cos(A+B) + q \cos^2(A+B) $
Divide  $E$  by  $\cos^2(A+B)$.
Then you will get $$E\sec^2(A+B)= \tan^2(A+B)+p \tan(A+B)  + q $$
Since $$\tan(A+B)=\frac{−p}{1−q} \Rightarrow \sec^2(A+B)=1+\frac{p^2}{(1−q)^2}$$, provided $q≠1$.
$$E\sec^2(A+B)= \frac{p^2}{(1−q)^2}-\frac{p^2}{1−q}  + q $$
$$E\cdot \left(1+\frac{p^2}{(1−q)^2}\right) = \frac{p^2}{(1−q)^2}-\frac{p^2}{1−q}  + q $$
Provided $q≠1$.$$\Rightarrow E((1-q)^2+p^2)=p^2-p^2(1-q)+q(1-q)^2$$
$$\Rightarrow E((1-q)^2+p^2)=p^2q+q(1-q)^2$$
$$\Rightarrow E((1-q)^2+p^2)=q(p^2+(1-q)^2)$$
$$\Rightarrow E=q$$ .
A: 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$
A: 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$.
A: $$\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.$
