<s>[INST] $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 !
 [/INST] $$\cot\frac{\beta}{2}=\frac{\cos\frac{\beta}{2}}{\sin\frac{\beta}{2}}=\frac{2\cos^2\frac{\beta}{2}}{\sin\beta}$$
so if you assume that equality, you get
$$\sin\alpha+\sin\gamma=2\cos^2\frac{\beta}{2}\Leftrightarrow \\
2\sin\frac{\alpha+\gamma}{2}\cos\frac{\alpha-\gamma}{2}=2\cos^2\frac{\beta}{2}\Leftrightarrow \\
2\cos\frac{\beta}{2}\cos\frac{\alpha-\gamma}{2}=2\cos^2\frac{\beta}{2} \\
\cos\frac{\alpha-\gamma}{2}=\cos\frac{\beta}{2} $$
since $\cos\frac{\beta}{2}>0$, and then note the equality of the cosines implies
$$\frac{\alpha-\gamma}{2}=\pm\frac{\beta}{2} \Leftrightarrow \\
\alpha-\gamma=\pm\beta $$
hence $\alpha$ or $\gamma$ is a right angle.
</s>