If the quadratic equation $x^2+(2-\tan\theta)x-(1+\tan\theta)=0$ has two integral roots, If the quadratic equation $x^2+(2-\tan\theta)x-(1+\tan\theta)=0$ has two integral roots,then find the sum of all possible values of $\theta$ in interval $(0,2\pi).$

The given quadratic equation is $x^2+(2-\tan\theta)x-(1+\tan\theta)=0$.
So $x=\frac{\tan\theta-2\pm\sqrt{\tan^2\theta+8}}{2}$
I am stuck here.I do not know what is the condition for two integer roots.

Let $t=\tan \theta$. We need that $t^2+8$ be a perfect square, so $$t^2+8=s^2\qquad(*)$$
When $\theta\in (0,2\pi)$, the value $t$ can be all real but if $t$ and $s$ must be integers we have $s=t+h$ where $h$ is a positive integer. It follows $$2ht+h^2=8\qquad (**)$$ An obvious solution of $(*)$ is $t=1$ so for $(**)$ we have to solve $$2h+h^2=8$$ whose only solution is $h=2$ but for $t>1$ there are no solutions for $(**)$
So the only values to be considered are $\frac{\pi}{4}$ and $\frac{5\pi}{4}$ which correspond to $t=\tan \theta=1$
