# Integrate $\frac{\theta \sin \theta}{1+\cos^2 \theta}$ with respect to $\theta$

Integrate : $$\int_0^\pi \frac{\theta \sin \theta}{1+\cos^2 \theta} d\theta$$ I tried to do a substitution by letting : $$u=\cos \theta \implies du=-\sin\theta\ d\theta$$

But I have a problem with that $$\theta$$, I don't know how to get bogged down in this variable, I tried some simplifications, but it gets complicated, here's what I've done : \begin{align} \frac{\theta \sin \theta}{1+\cos^2 \theta}&=\frac{\theta \sin\theta}{1+\frac{1+\cos 2\theta}{2}}\\ &=\frac{2\theta \sin \theta}{3+\cos 2\theta}\\ &=\frac{\theta 2\sin \theta \cos\theta}{\cos\theta(3+\cos 2\theta)}\\ &=\frac{\theta \sin 2\theta}{\cos\theta(3+\cos 2\theta)} \end{align} Any hints ? Thanks in advance !

• My guess is that you need to complexify your integral. Jul 19, 2020 at 20:24
• Try $t=\pi-\theta$ simplify, and then use $u=\cos t$ Jul 19, 2020 at 20:24
• Both answers use the King rule of integration.
– J.G.
Jul 19, 2020 at 20:47
• I added an alternative method using geometric series, check it out and let me know what you think :D Jul 19, 2020 at 22:21
• Note that a series of related questions show similar strategies with the most common being the King's rule. Jul 20, 2020 at 0:27

$$I=\int_0^\pi \frac{\theta \sin \theta}{1+\cos^2 \theta} d\theta\tag 1$$ Using property of definite integral: $$\int_a^bf(x)dx=\int_a^bf(a+b-x)dx$$, $$I=\int_0^\pi \frac{(\pi-\theta) \sin \theta}{1+\cos^2 \theta} d\theta\tag 2$$ Adding (1) and (2), $$2I=\int_0^\pi \frac{\pi \sin \theta}{1+\cos^2 \theta} d\theta$$ $$I=\frac{\pi}{2}\int_0^{\pi} \frac{ \sin \theta \ d\theta}{1+\cos^2 \theta}$$ $$I=- \pi\int_0^{\pi/2} \frac{ d(\cos \theta)}{1+\cos^2 \theta}$$ $$I=-\pi\left[\tan^{-1}\left(\cos\theta\right)\right]_0^{\pi/2}$$ $$=\frac{\pi^2}{4}$$

Here's a trick which I use always with integrals involving trigonometric functions : $$\int_\alpha^\beta \varphi (\xi) d\xi=\int_\alpha^\beta \varphi (\alpha +\beta-\xi) d\xi$$ The proof is trivial and left for you as an exercise, lol!

Anyway, applying this technique to this integral :

Let $$I=\int_0^\pi \frac{x\sin x}{1+\cos^2x}dx$$ We'll have after applying this formula : \begin{align} I&=\int_0^\pi \frac{(\pi-x)\sin (\pi-x)}{1+\cos^2(\pi-x)} dx\\ 2I&=\int_0^\pi \frac{x\sin x}{1+\cos^2x} + \frac{(\pi-x)\sin (\pi-x)}{1+\cos^2(\pi-x)}dx\\ I&=\frac{1}2\int_0^\pi \frac{x \sin x+\pi \sin x-x\sin x}{1+\cos^2x}\\ &=\frac{1}2\int_0^\pi \frac{\pi \sin x}{1+\cos^2x}\\ &=\frac{\pi}2\int_0^\pi \frac{ \sin x}{1+\cos^2x} \end{align} Now using the substitution you did earlier $$u=\cos x \Leftrightarrow du=-\sin x$$ So ; \begin{align} I&=\frac{\pi}2\int_1^{-1} \frac{-du}{1+u^2}\\ &=\frac{\pi}2\int_{-1}^{1} \frac{du}{1+u^2}\\ &=\frac{\pi}2 \arctan u\bigg\vert_{-1}^1\\ &=\frac{\pi}2 \bigg(\frac{\pi}4 +\frac{\pi}4\bigg)\\ &=\frac{\pi^2}{4} \end{align} Hence as @PeterForeman said your integral is : $$\displaystyle \frac{\pi^2}{4}$$

By the way, if you want the proof of the formula, all that you have to do is : $$\xi=\alpha +\beta-u \Leftrightarrow d\xi=-du$$ Therefore;

$$\int_\beta^\alpha \varphi (\alpha+\beta-u) (-du)=\int_\alpha^\beta \varphi (\alpha +\beta-\xi) d\xi$$

• Lol, the proof is trivial and left as an exercise 🤣🤣🤣, Thanks for the great and funny answer!
– user768934
Jul 19, 2020 at 20:40
• That is called the King Property of Integration Jul 19, 2020 at 20:45
• @RhysHughes This formula is such a great technique, Personally whenever I see a trigonometric expression I use it !! Jul 19, 2020 at 20:47
• How is your trick is different from that used in @Harish Chandra Rajpoot's answer ?
– user801303
Jul 19, 2020 at 20:51
• Even the last substitution is identical. Jul 19, 2020 at 21:44

Another really cool way of getting the answer is from infinite series!!!!

Notice that

$${\frac{1}{1+\cos^2(x)}=\sum_{n=0}^{\infty}\left(-\cos^2(x)\right)^n}$$

And so

$${\int_{0}^{\pi}\frac{x\sin(x)}{1+\cos^2(x)}dx=\int_{0}^{\pi}x\sin(x)\sum_{n=0}^{\infty}\left(-\cos^2(x)\right)^ndx}$$

After interchanging a few things around, the integral becomes

$${=\sum_{n=0}^{\infty}(-1)^n\int_{0}^{\pi}x\sin(x)\cos^{2n}(x)dx}$$

If we use integration by parts on the inner integral, with $${dv=\sin(x)\cos^{2n}(x)dx}$$ and $${u=x}$$ you end up with

$${\int_{0}^{\pi}(-1)^nx\sin(x)\cos^{2n}(x)dx=(-1)^n\left(\left(x\frac{-\cos^{2n+1}(x)}{2n+1}\right)_{x=0}^{x=\pi} + \frac{1}{2n+1}\int_{0}^{\pi}\cos^{2n+1}(x)dx\right)}$$

The rightmost integral will always be zero, and so we just end up with

$${=\frac{(-1)^n\pi}{2n+1}}$$

Hence overall

$${\int_{0}^{\pi}\frac{x\sin(x)}{1+\cos^2(x)}dx=\pi \sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}}$$

The infinite sum is just the Leibniz infinite series for $${\frac{\pi}{4}}$$. So

$${=\pi\frac{\pi}{4}=\frac{\pi^2}{4}}$$

• (+1) for a systematic approach rather than a trick
– Alex
Jul 19, 2020 at 23:34
• Good job! The ending with Leibniz pi formula was satisfying :) Jul 20, 2020 at 5:42
• @Alex thank you! :) Jul 20, 2020 at 15:46
• @CasimirRönnlöf Thank youuu! :) Jul 20, 2020 at 15:46

Alternatively, just do a simple integration by parts with $$u=\theta$$ and $$dv=\frac{\sin{\theta} d\theta}{1+\cos^2{\theta}}$$: $$\int_0^\pi \frac{\theta \sin \theta}{1+\cos^2 \theta} d\theta= -\theta \arctan{\left(\cos {\theta}\right)}\bigg \rvert_0^{\pi}+\int_0^{\pi} \arctan{\left(\cos {\theta}\right)} d\theta$$ For the second integral, notice that it is odd about $$\theta=\frac{\pi}{2}$$ or if you don't see that then $$\theta \mapsto \theta-\frac{\pi}{2}$$ $$=\frac{\pi^2}{4} + \require{cancel} \cancel{\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \arctan{\left(\sin{\theta}\right)} d \theta}$$ $$=\boxed{\frac{\pi^2}{4}}$$

Edit: I got $$\arctan{\left(\cos{\theta}\right)}$$ by substituting $$u=\cos{\theta}$$ for the $$dv$$ expression. The $$\sin{\theta}$$ cancels from the $$du$$ expression and it's just a straightforward $$\arctan{u}$$ integral. As Barry Chipa said in the comments, the second integral is odd (substitute $$\xi=-\theta$$ to see this (remember that both $$\sin{\theta}$$ and $$\arctan{\theta}$$ are odd functions.

• I think you meant $\arctan(\sin\theta)$ in the final, crossed-out integral. Jul 20, 2020 at 0:42
• How did you get $\tan^{-1}(\cos\thrta)$ ? And how second integral becomes zero, can you elaborate a bit?
– user801303
Jul 20, 2020 at 0:43
• @TShiong, the substitution $\theta=\phi+\pi/2$ gives $$\int_0^\pi\arctan(\cos\theta)d\theta=-\int_{-\pi/2}^{\pi/2}\arctan(\sin\phi)d\phi$$ (since $\cos(\phi+\pi/2)=\cos\phi\cos\pi/2-\sin\phi\sin\pi/2=-\sin\phi$). And the function $\arctan(\sin\phi)$ is odd, so the integral from $-\pi/2$ to $0$ cancels the integral from $0$ to $\pi/2$. Jul 20, 2020 at 0:51
• @TShiong I edited my post. Look at Barry's comment also.
– Ty.
Jul 20, 2020 at 15:19