$ABC$ rectangle in $A$ or $C$ iff $\frac{\sin(\alpha)+\sin(\gamma)}{\sin(\beta)}=\cot\left(\frac{\beta}{2}\right)$ The triangle $ABC$ is rectangle in $A$ or $C$ if and only if $\frac{\sin(\alpha)+\sin(\gamma)}{\sin(\beta)}=\cot\left(\frac{\beta}{2}\right)$, where $\alpha$ is the angle in $A$, $\beta$ is the angle in $B$ and $\gamma$ is the angle in $C$.
I have already managed to prove the ‘only if’ direction by putting $\alpha=\frac{\pi}{2}$ respectively $\gamma=\frac{\pi}{2}$ and using trigonometric formulas. However, I’m stuck for the ‘if’ direction. How could I proceed ? 
Thanks for your help !

Rewrite 
$$\frac{\sin\alpha+\sin\gamma}{\sin\beta}
=\frac{2\sin\frac{\alpha+\gamma}{2}\cos\frac{\alpha-\gamma}{2}}{2\sin\frac{\beta}{2}\cos\frac{\beta}{2}}
=\frac{\cos\frac{\alpha-\gamma}{2}}{\sin\frac{\beta}{2}}
=\cot\frac{\beta}{2}$$
or
$$\cos\frac{\alpha-\gamma}{2}=\cot\frac{\beta}{2}\sin\frac{\beta}{2}=\cos\frac{\beta}{2}$$
which leads to
$$\frac{\alpha-\gamma}{2} = \pm\frac{\beta}{2}$$
Thus, either $\alpha = \beta+\gamma = 90^\circ$, or $\gamma= \beta+\alpha = 90^\circ$.
