Roots of the equation $x^2 + px + q = 0$ If $\tan A$ and $\tan B$ are the roots of the equation $x^2 + px + q = 0 $ , show that  $$\sin^2(A+B) + p \sin(A+B)\cos(A+B) + q \cos^2(A+B) = q$$
I tried using the result that $\tan A + \tan B = -p $ and $(\tan A)(\tan B) = q$ and tried substituting in the original equation but was unable to make any headway.

As $\tan(A+B)=\cdots=\dfrac p{q-1}$
Method $\#1:$
$\implies(1-q)\sin(A+B)+p\cos(A+B)=0$
Multiplying both sides by $\sin(A+B),$
$(1-q)\sin^2(A+B)+p\cos(A+B)\sin(A+B)=0$
$\iff\sin^2(A+B)+p\cos(A+B)\sin(A+B)+q(\cos^2(A+B)-1)=0$
$\iff\sin^2(A+B)+p\cos(A+B)\sin(A+B)+q\cos^2(A+B)=q$
Method $\#2:$
Dividing the numerator & the denominator by $\cos^2(A+B)=\dfrac1{\sec^2(A+B)}=\dfrac1{1+\tan^2(A+B)},$
$$\sin^2(A+B) + p \sin(A+B)\cos(A+B) + q \cos^2(A+B) =\dfrac{\tan^2(A+B)+p\tan(A+B)+q}{\tan^2(A+B)+1}$$
$$=\dfrac{p^2+p^2(q-1)+q(q-1)^2}{p^2+(q-1)^2}$$
Now, $p^2+p^2(q-1)+q(q-1)^2=q[p^2+(q-1)^2]$
