Simplifying $\frac{\pi(1-\cos(\pi x))\cos(\pi x)-\pi\sin^2(\pi x)}{(1-\cos(\pi x))^2}$ to $\frac\pi{\cos\pi x-1}$
Solution 1:
We have,
$\mathsf{\dfrac{\pi(1-cos(\pi\,x))cos(\pi\,x)-\pi\,sin^2(\pi\,x)}{{(1-cos(\pi\,x))}^{2}}}$
$\mathsf{=\dfrac{\pi(1-cos(\pi\,x))cos(\pi\,x)-\pi\big(1-cos^2(\pi\,x)\big)}{{(1-cos(\pi\,x))}^{2}}}$
$\mathsf{=\dfrac{\pi(1-cos(\pi\,x))cos(\pi\,x)-\pi\big(1-cos(\pi\,x)\big)\big(1+cos(\pi\,x)\big)}{{(1-cos(\pi\,x))}^{2}}}$
$\mathsf{=\dfrac{(1-cos(\pi\,x))\big\{\pi\,cos(\pi\,x)-\pi\big(1+cos(\pi\,x)\big)\big\}}{{(1-cos(\pi\,x))}^{2}}}$
$\mathsf{=\dfrac{(1-cos(\pi\,x))\big\{\pi\,cos(\pi\,x)-\pi\,-\pi\,cos(\pi\,x)\big\}}{{(1-cos(\pi\,x))}^{2}}}$
$\mathsf{=\dfrac{-\pi(1-cos(\pi\,x))}{{(1-cos(\pi\,x))}^{2}}}$
$\mathsf{=\dfrac{-\pi}{1-cos(\pi\,x)}}$
$\mathsf{=\dfrac{\pi}{cos(\pi\,x)-1}}$