If $\tan\alpha$, $\tan\beta$ are roots of $x^2+px+q=0$, evaluate: $\sin^2(\alpha+\beta)+p\sin(\alpha+\beta)\cos(\alpha+\beta)+q\cos^2(\alpha+\beta)$ 
Question : Knowing that $\tan\alpha$ , $\tan\beta$ are roots of the quadratic equation $x^2+px+q=0$ ;
Compute the expression $\sin^2(\alpha +\beta) +p\sin(\alpha +\beta) \cos(\alpha +\beta)+q\cos^2(\alpha +\beta$)

My Working :
Sum of the roots are : $\tan\alpha +\tan\beta = -p; $ product of the roots $\tan\alpha \tan\beta = q; $
After putting these values of roots in the given equation I got :
$x^2-(\tan\alpha + \tan\beta) x + ( \tan\alpha \tan\beta) =0$
Please suggest whether is it correct method of approaching this or some other better method. Thanks..
 A: We have $-(\tan\alpha +\tan \beta) = p$ and $\tan\alpha\tan\beta=q$.
Note that $\tan(\alpha+\beta)=\dfrac{\tan\alpha+\tan\beta}{1-q}$ and thus $p = -\tan(\alpha+\beta)(1-q)$.
Substitute this for $p$ to obtain,
$\sin^2(\alpha +\beta) -\tan(\alpha+\beta)(1-q)\sin(\alpha +\beta) \cos(\alpha +\beta)+q\cos^2(\alpha +\beta)$
or $\sin^2(\alpha +\beta) -(1-q)\sin^2(\alpha +\beta) +q\cos^2(\alpha +\beta)$
= $q\sin^2(\alpha +\beta) +q\cos^2(\alpha +\beta) = q$
A: Here goes ugly.
Note that 
$$\tan(\alpha+\beta)=\frac{\tan\alpha+\tan\beta}{1-\tan\alpha\tan\beta}=-\frac{p}{1-q}.$$
Multiply and divide the expression we were given by $\cos^2(\alpha+\beta)$. We get 
$$\cos^2(\alpha+\beta)\left(\tan^2(\alpha+\beta)+p\tan(\alpha+\beta)+q\right).$$
Almost finished, since $\cos^2(\alpha+\beta)=\frac{1}{\tan^2(\alpha+\beta)+1}$.
A: Hints and ideas:
$$1+\tan^2x=\frac1{\cos^2x}\;,\;\;1+\cot^2x=\frac1{\sin^2x}$$
$$\tan(x+y)=\frac{\tan x+\tan y}{1-\tan x\tan y}$$
Thus, for example:
$$\sin^2(\alpha+\beta)=\frac1{1+\cot^2(\alpha+\beta)}=\frac1{1+\left(\frac{1-\tan\alpha\tan\beta}{\tan\alpha+\tan\beta}\right)^2}=\frac{(\tan\alpha+\tan\beta)^2}{(\tan^2\alpha+1)(\tan^2\beta+1)}\ldots$$
and etc.
