# How to calculate $\int\frac{x}{1+\cos^2{x}}dx$?

What's the value of it?I hope you can help me.

$$\int\frac{x}{1+\cos^2{x}}dx$$

You are right.Actually what really wanted is a definite integral .In fact,it's $$\int_{-\pi}^r\frac{x(1+\sin{x})}{1+\cos^2{x}}dx$$ But I still don't know how to value it. Thank Q for your reply.

• See this . Maybe it's what u want or it maybe a definite integral.
– ABC
Apr 23, 2013 at 7:55
• If you want some value, you need a definite integral...
– V-X
Apr 23, 2013 at 13:23
• Is the $r$ in the upper limit $\pi$?
– user17762
Apr 24, 2013 at 7:08

We have $$I=\int_{-\pi}^{\pi} \dfrac{x(1+\sin(x))}{1+\cos^2(x)} dx$$ Replacing $x$ by $-x$, we get that $$I=\int_{-\pi}^{\pi} \dfrac{-x(1-\sin(x))}{1+\cos^2(x)} dx$$ Adding both and dividing by $2$, we get that $$I = \int_{-\pi}^{\pi} \dfrac{x \sin(x)}{1+\cos^2(x)}dx = 2\int_{0}^{\pi} \dfrac{x \sin(x)}{1+\cos^2(x)}dx = 2\sum_{k=0}^{\infty}(-1)^k\int_0^{\pi}x\sin(x) \cos^{2k}(x) dx$$ Now integral $$\int_0^{\pi}x\sin(x) \cos^{2k}(x) dx = \dfrac{\pi}{2k+1}$$ Hence, we get that $$I = \sum_{k=0}^{\infty}(-1)^k \dfrac{2\pi}{2k+1} = \dfrac{\pi^2}2$$
• $\int_0^{\pi}x\sin(x) \cos^{2k}(x) \,\mathrm dx = \dfrac{\pi}{2k+1}$ can be proven using the substitution $x\to\pi -x$ Oct 7, 2019 at 20:45