I am stuck with the following problem that says:
The roots of the equation $z^2+pz+q=0,$ where $p,q$ are complex numbers, are represented by the points $A,B$ on the complex plane. If $OA=OB$ and $\angle AOB=2 \beta,$ where $O$ is the origin, prove that $$p^2=4q \cos^2 {\beta}$$.
My try: The roots of the equation $z^2+pz+q=0,$is given by $\frac12(-p+\sqrt{p^2-4q})$ and $\frac12(-p-\sqrt{p^2-4q})$
Let $z=\frac12(-p+\sqrt{p^2-4q}) $ and $\bar{z}=\frac12(-p-\sqrt{p^2-4q})$ . Then, the line $AB=z-\bar{z}=\sqrt{p^2-4q}$.
Now using the fact $OA=OB$ and $\angle AOB=2 \beta,$ I get $$2 \beta=\arctan \frac{\sqrt{p^2-4q}}{p}+\arctan \frac{\sqrt{p^2-4q}}{p} \implies \beta=\arctan \frac{\sqrt{p^2-4q}}{p}$$.After deduction, I get from here $$p^2=(2p^2-4q)\cos^2\beta$$.
Now, I am stuck. Can someone help?
Let $A(z_1)$,$B(z_2)$, $z_1=r(\cos\theta_1+i\sin\theta_1)$, $z_2=r(\cos\theta_2+i\sin\theta_2)$ and $\theta_1-\theta_2=2\beta$,
where $r\geq0$ and $\{\theta_1,\theta_2\}\subset[0,2\pi).$
Thus, $$q=z_1z_2=r^2(\cos(\theta_1+\theta_2)+i\sin(\theta_1+\theta_2))$$ and $$-p=z_1+z_2=r(\cos\theta_1+\cos\theta_1+i(\sin\theta_1+\sin\theta_2))=$$ $$=2r\left(\cos\frac{\theta_1+\theta_2}{2}\cos\beta+i\sin\frac{\theta_1+\theta_2}{2}\cos\beta\right)=2r\cos\beta\left(\cos\frac{\theta_1+\theta_2}{2}+i\sin\frac{\theta_1+\theta_2}{2}\right).$$ Id est,$$p^2=4r^2\cos^2\beta\left(\cos\frac{\theta_1+\theta_2}{2}+i\sin\frac{\theta_1+\theta_2}{2}\right)^2=$$ $$=4r^2\cos^2\beta(\cos(\theta_1+\theta_2)+i\sin(\theta_1+\theta_2))=4q\cos^2\beta$$ and we are done!