$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 !
 A: 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$.
A: $$\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.
A: $$\sin A+\sin C=\cot\dfrac B2\cdot\sin B$$
$$2\sin\dfrac{A+C}2\cos\dfrac{C-A}2=2\cos^2\dfrac B2$$
As $A+C=\pi-B,\cos\dfrac B2=\sin(?)\ne0$
$$\implies \cos\dfrac{A-C}2=\cos\dfrac B2$$
Can you take it from here?
