Proving $\sum_{i=1}^ni\sin{ix}=\frac{\sin{((n+1)x)}}{4\sin^2{\frac{x}{2}}}-\frac{(n+1)\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}$ by induction Prove by induction that:
$$\sum_{i=1}^ni\sin{ix}=\frac{\sin{((n+1)x)}}{4\sin^2{\frac{x}{2}}}-\frac{(n+1)\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}$$
I tried to prove it for the basis $n=1$:
For the left side, it's $\sin{x}$
The right side is:
$$A=\frac{\sin(2x)}{4\sin^2{\frac{x}{2}}}-\frac{2\cos{\frac{3x}{2}}}{2\sin{\frac{x}{2}}} = \frac{2\sin{x}\cos{x}-4\sin{x}\cos{\frac{3x}{2}}}{4\sin{\frac{x}{2}}}$$
$$= 2\sin{x}(\frac{\cos{x}-2\cos{\frac{3x}{2}}}{4\sin^2{\frac{x}{2}}})=2\sin{x}(\frac{\cos^2{\frac{x}{2}}}{4\sin^2{\frac{x}{2}}}-\frac{1}{4}-\frac{\cos{\frac{3x}{2}}}{2\sin^2{\frac{x}{2}}})$$

Then I showed that
$$\frac{\cos^2{\frac{x}{2}}}{4\sin^2{\frac{x}{2}}}=\frac{1-sin^2{\frac{x}{2}}}{4\sin^2{\frac{x}{2}}}=\frac{1}{4\sin^2{\frac{x}{2}}}-\frac{1}{4}$$

So:
$$A=2\sin{x}(\frac{1-2\cos{\frac{3x}{2}}}{4\sin^2{\frac{x}{2}}}-\frac{1}{2})$$

Then I tried to prove that the expression inside the parentheses is equal to $\frac{1}{2}$ i.e. the first fraction is equal to 1 i.e. the numerator is equal to the denominator. But I couldn't.
 A: Okay, as you say prove by induction...
Base case $n=1$, we need to prove:
$$\sin x=\frac{\sin{(2x)}}{4\sin^2{\frac{x}{2}}}-\frac{2\cos{(\frac{3x}{2})}}{2\sin{\frac{x}{2}}}.$$
We have
$$\frac{2\cos{(\frac{3x}{2})}}{2\sin{\frac{x}{2}}}=\frac{2\cos{(\frac{3x}{2})}\sin \frac x2}{2\sin^2{\frac{x}{2}}}=\frac{\sin 2x-\sin x}{2\sin^2{\frac{x}{2}}}.$$
So we have
$$RHS=\frac{\sin{(2x)}}{4\sin^2{\frac{x}{2}}}-\frac{\sin 2x-\sin x}{2\sin^2{\frac{x}{2}}}=\frac{2\sin x-\sin 2x}{2(1-\cos x)}=\frac{2\sin x-2\sin x\cos x}{2(1-\cos x)}=\sin x=LHS.$$
Induction step, we need to prove:
\begin{align}
n\sin{nx}&=\frac{\sin{((n+1)x)}}{4\sin^2{\frac{x}{2}}}-\frac{(n+1)\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}-\frac{\sin{((n)x)}}{4\sin^2{\frac{x}{2}}}+\frac{(n)\cos{((2n-1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}
\\
&=\frac{\sin{((n+1)x)}}{4\sin^2{\frac{x}{2}}}-\frac{\sin{((n)x)}}{4\sin^2{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\\
&+n\left(\frac{\cos{((2n-1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\right).
\end{align}
We know that
\begin{align}
&\frac{\sin{((n+1)x)}}{4\sin^2{\frac{x}{2}}}-\frac{\sin{((n)x)}}{4\sin^2{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\\
=&\frac{\sin{((n+1)x)}-\sin(nx)}{4\sin^2{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\\
=&\frac{2\sin\frac x2 \cos\frac{2n+1}2x}{4\sin^2{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\\
=&\frac{ \cos\frac{2n+1}2x}{2\sin{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}=0.
\end{align}
Also we have
\begin{align}
&\frac{\cos{((2n-1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\\
=&\frac{\cos{((2n-1)\frac{x}{2})}-\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}
=\frac{2\sin nx\sin \frac x2}{2\sin{\frac{x}{2}}}=\sin nx.
\end{align}
Therefore, we have
$$RHS=\frac{\sin{((n+1)x)}}{4\sin^2{\frac{x}{2}}}-\frac{\sin{((n)x)}}{4\sin^2{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\\
+n\left(\frac{\cos{((2n-1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}-\frac{\cos{((2n+1)\frac{x}{2})}}{2\sin{\frac{x}{2}}}\right)=0+n\sin nx=n\sin nx=LHS.$$
So, we are done.
