Prove $\int_0^\theta\frac{\sin\theta\cos x}{(1-\cos\theta\cos x)^2}dx=\csc^2\theta+\frac{\pi}{2}\cot\theta\csc\theta$

Prove $$\int_0^\theta\frac{\sin\theta\cos x}{(1-\cos\theta\cos x)^2}dx=\csc^2\theta+\frac{\pi}{2}\cot\theta\csc\theta$$

$$\int_0^\theta\frac{\sin\theta\cos x}{(1-\cos\theta\cos x)^2}dx=-\frac{\sin\theta}{\cos\theta}\int_0^\theta\frac{-\cos\theta\cos x+1-1}{(1-\cos\theta\cos x)^2}dx\\ =-\tan\theta\int_0^\theta\bigg[\frac{1}{1-\cos\theta\cos x}-\frac{1}{(1-\cos\theta\cos x)^2}\bigg]dx\\$$

How do I solve it ?. Can I use Leibniz rule here ?

Thanks @Peter Foreman

$$\int_0^\theta\frac{\sin\theta\cos x}{(1-\cos\theta\cos x)^2}dx=-\tan\theta\int_0^\theta\Bigg[\frac{1}{1-\cos\theta.\dfrac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}}-\frac{1}{\bigg(1-\cos\theta.\dfrac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}\bigg)^2}\Bigg]dx\\ =-\tan\theta\int_0^\theta\Bigg[\frac{\sec^2\frac{x}{2}}{1-\cos\theta+\tan^2\frac{x}{2}[1+\cos\theta]}+\frac{(1+\tan^2\frac{x}{2})\sec^2\frac{x}{2}}{\bigg(1-\cos\theta+\tan^2\frac{x}{2}[1+\cos\theta]\bigg)^2}\Bigg]dx$$ Set $$t=\tan\frac{x}{2}\implies dt=\frac{1}{2}\sec^2\frac{x}{2}dx$$ $$I_1=-\tan\theta\int_0^{\tan\frac{\theta}{2}}\frac{2dt}{1+t^2-\cos\theta[1-t^2]}$$

• Do you know the tangent half angle substitution? Commented Jan 22, 2020 at 15:06
• u mean $\cos x=\frac{1-\tan^2x/2}{1+\tan^2x/2}$ ?.will it help ? Commented Jan 22, 2020 at 15:08
• Yes. This integral then has an elementary antiderivative. Commented Jan 22, 2020 at 15:09
• @PeterForeman I tried to include that, am I stuck again ?. Could you please have a look into it ? Commented Jan 22, 2020 at 15:36

Note that $$I(\theta) = \int_0^\theta\frac{1}{1-\cos\theta\cos x}dx=\frac\pi2 \csc\theta$$ and take the derivative with respect to $$\theta$$ to obtain
$$\int_0^\theta\frac{\sin\theta\cos x}{(1-\cos\theta\cos x)^2}dx=\csc^2\theta-I'(\theta) = \csc^2\theta+\frac{\pi}{2}\cot\theta\csc\theta$$
• Set $t=\tan\frac{x}{2}\implies dt=\frac{1}{2}\sec^2\frac{x}{2}dx$ $$I(\theta)=\int_0^\theta\frac{\sec^2\frac{x}{2}dx}{(1+\cos\theta)\tan^2\frac{x}{2}+1-\cos\theta}=\int_0^\theta\frac{\sec^2\frac{x}{2}dx}{2\cos^2\frac{\theta}{2}\tan^2\frac{x}{2}+2\sin^2\frac{\theta}{2}}\\ =\int\frac{2dt}{2\cos^2\frac{\theta}{2}.t^2+2\sin^2\frac{\theta}{2}}=\frac{1}{\sin^2\frac{\theta}{2}}\int\frac{dt}{\Big(t\cot\frac{\theta}{2}\Big)^2+1}\\$$ Commented Jan 22, 2020 at 18:37
• $$=\frac{1}{\sin^2\frac{\theta}{2}}.\tan\frac{\theta}{2}\int\frac{\cot\frac{\theta}{2}.dt}{\Big(t\cot\frac{\theta}{2}\Big)^2+1}=\frac{1}{\sin\frac{\theta}{2}\cos\frac{\theta}{2}}\bigg[\tan^{-1}\Big[t.\cot\frac{\theta}{2}\Big]\bigg]=\frac{\pi}{4}\csc x.\sec x$$ Sorry did I make some mistake somewhr ?. Could you please help ? Commented Jan 22, 2020 at 18:37
• @ss1729 - what you derived is fine, except note that the result $\frac\pi4 \csc \frac {\theta}2\sec\frac {\theta}2 = \frac\pi2\cdot \frac1{2\sin\frac{\theta}2\cos\frac {\theta}2} = \frac\pi2\frac1{\sin \theta}= \frac\pi2\csc\theta$ Commented Jan 22, 2020 at 19:45