# evaluate $\int \frac{\tan x}{x^2+1}\:dx$

$$\int \frac{\tan x}{x^2+1}\, \mathrm dx$$

I used By-parts method setting $$u=\tan x$$ and $$\, \mathrm dv=\frac{1}{x^2+1}\, \mathrm dx$$, but then I got an integral that's more complicated

I also thought of trigonometric substitution, setting $$x=\tan\theta$$, but how am going to substitute that for the $$\tan x$$ in numerator?

I tried to use websites like symbolab & wolfram to evaluate the integral but I got no result.

• I am going to guess that if this is coming from a homework, the intended question was $\int \text{arctan}(x)/(x^2+1)dx$ which has a nice form. Apr 13, 2015 at 18:30
• They probably meant $\tan^{-1}x=\arctan x$. Apr 13, 2015 at 22:09
• @EricNaslund No, it's not, if it were arctanx instead of tanx, I would not ask such a question :). then it's going to be very easy. Apr 14, 2015 at 13:47

The Laurent series of tan(x) is $$\sum_{n=1,3,5..}^{\infty }\frac{8x}{(n\pi )^2-4x^2}$$ so $$\frac{\tan(x)}{1+x^2}=\sum_{n=1,3,5..}^{\infty }\frac{8x}{\left [(n\pi )^2-4x^2 \right ](1+x^2)}$$

use the partial fraction to get $$\sum_{n=1,3,5,..}^{\infty }\frac{8x}{((n\pi)^2+4 )(1+x^2)}+\frac{8}{((n\pi)^2+4 )(n\pi -2x)}-\frac{8}{((n\pi)^2+4 )(n\pi +2x)}$$

$$\int \frac{\tan x}{1+x^2}dx=C+\sum_{n=1,3,5,..}^{\infty }\frac{4}{(n\pi )^2+4}\left [ \log(1+x^2)-\log(n\pi -2x)-\log(n\pi +2x) \right ]$$

hence

$$\int \frac{\tan x}{1+x^2}dx=C+\sum_{n=1,3,5,..}^{\infty }\frac{4}{(n\pi )^2+4}\left [ \log(\frac{1+x^2}{(n\pi )^2-4x^2}) \right ]$$ Hope it helps. It also turns into a more complicated as I thought. You might use Matlab to calculate this.

• where'd you get that? Apr 13, 2015 at 18:26
• For some basic information about writing math at this site see e.g. here, here, here and here. Apr 13, 2015 at 18:28
• So a picture is not accepted here? Apr 13, 2015 at 18:29
• Many would accept but some serious users will not. Better take no risk. Apr 13, 2015 at 18:32
• @ADG lol that's great. I regret I haven't find this website earlier. Apr 13, 2015 at 18:40