Integrate squared trigonometric function I'm trying to integrate $\int_a^b \left( \frac{1}{1+x^2}  \right)^2 dx$
I know that $\frac{d}{dx} \arctan(x) = \frac{1}{1+x^2}$, but how can I integrate with the squared part?
I've tried substitution with no success.
 A: Hint. Note that
$$\left( \frac{1}{1+x^2}  \right)^2 = \frac{1-x^2+x^2}{(1+x^2)^2}= \frac{1}{1+x^2}  -\frac{x^2}{(1+x^2)^2}=\frac{1}{1+x^2}  +\frac{x}{2}\left(\frac{1}{1+x^2}\right)'.$$
then integrate by parts the last term.
A: $$I=\int_a^b\left(\frac{1}{1+x^2}\right)^2dx$$
$x=\tan(u),\,dx=\sec^2(u)du$
$$I=\int_{\arctan(a)}^{\arctan(b)}\left(\frac{1}{1+\tan^2(u)}\right)^2du.\sec^2(u)=\int_{\arctan(a)}^{\arctan(b)}\cos^2(u)du$$
and we know that:
$$cos2\theta=\cos^2\theta-\sin^2\theta=2\cos^2\theta-1$$
as:
$$\cos^2\theta+\sin^2\theta\equiv1$$
now:
$$I=\int_{\arctan(a)}^{\arctan(b)}\frac{\cos(2u)+1}{2}du=\left[\frac{\sin(2u)}{4}+\frac{u}{2}\right]_{\arctan(a)}^{\arctan(b)}=\frac{\sin\left(2\arctan(b)\right)+2\arctan(b)-\sin\left(2\arctan(a)\right)-2\arctan(a)}{4}$$
A: Let $x = \tan\theta$ and make use of 
\begin{align}
1 + \tan^{2}\theta &= \frac{1}{\cos^{2}\theta} \\
dx &= \frac{d\theta}{\cos^2\theta} \\
\sin(\tan^{-1}\theta) &= \frac{x}{\sqrt{1+x^2}} \\
\cos(\tan^{-1}\theta) &= \frac{1}{\sqrt{1 + x^2}}
\end{align}
to obtain:
\begin{align}
I &= \int \frac{dx}{(1+x^2)^2} \\
&= \int \cos^{2}\theta \, d\theta \\
&= \frac{1}{2} \, \int (1 + \cos(2 \theta) ) \, d\theta \\
&= \frac{1}{2} \, \left( \theta + \frac{\sin(2 \theta)}{2} \right) = \frac{1}{2} \, ( \theta + \sin\theta \, \cos\theta ) \\
&= \frac{1}{2} \, \left( \tan^{-1}x + \frac{x}{1+x^2} \right).
\end{align}
Now evaluate the integral with endpoints $a$ and $b$. If the range was $(0,1)$ then
$$\int_{0}^{1} \frac{dx}{(1+x^2)^2} = \frac{\pi + 2}{8}.$$
A: Partial Fractions gives
$$
\begin{align}
\int\frac{\mathrm{d}x}{\left(1+x^2\right)^2}
&=\frac14\int\left(\frac1{(1+ix)^2}+\frac1{(1-ix)^2}+\frac2{1+x^2}\right)\mathrm{d}x\\
&=\frac14\left(\frac{i}{1+ix}-\frac{i}{1-ix}+2\arctan(x)\right)+C\\[6pt]
&=\frac12\left(\frac{x}{1+x^2}+\arctan(x)\right)+C
\end{align}
$$
A: Consider the integral 
$$I_n=\int\frac{\mathrm{d}x}{(ax^2+b)^n}$$
Integration by parts: $$\mathrm{d}v=\mathrm{d}x\Rightarrow v=x\\u=\frac1{(ax^2+b)^n}\Rightarrow \mathrm{d}u=-2an(ax^2+b)^{-n-1}x\mathrm{d}x$$
$$I_n=\frac{x^2}{(ax^2+b)^n}+2n\int\frac{ax^2\mathrm{d}x}{(ax^2+b)^{n+1}}$$
$$I_n=\frac{x^2}{(ax^2+b)^n}+2n\int\frac{ax^2+b-b}{(ax^2+b)^{n+1}}\mathrm{d}x$$
$$I_n=\frac{x^2}{(ax^2+b)^n}+2n\int\frac{ax^2+b}{(ax^2+b)^{n+1}}\mathrm{d}x-2nb\int\frac{\mathrm{d}x}{(ax^2+b)^{n+1}}$$
$$I_n=\frac{x^2}{(ax^2+b)^n}+2n\int\frac{\mathrm{d}x}{(ax^2+b)^n}-2nb\int\frac{\mathrm{d}x}{(ax^2+b)^{n+1}}$$
$$I_n=\frac{x^2}{(ax^2+b)^n}+2nI_n-2nbI_{n+1}$$
Now we solve for $I_{n+1}$ in terms of $I_n$:
$$I_n=\frac{x^2}{(ax^2+b)^n}+2nI_n-2nbI_{n+1}$$
$$2bI_{n+1}=\frac{x^2}{(ax^2+b)^n}+2nI_n-I_n$$
$$I_{n+1}=\frac{x^2}{2b(ax^2+b)^n}+\frac{2n-1}{2b}I_n$$
Cleverly replacing $n$ with $n-1$ gives
$$I_{n-1+1}=\frac{x^2}{2b(ax^2+b)^{n-1}}+\frac{2(n-1)-1}{2b}I_{n-1}$$
$$I_{n}=\frac{x^2}{2b(ax^2+b)^{n-1}}+\frac{2n-3}{2b}I_{n-1}$$
And there's your reduction formula. Plugging in $a=1,\quad b=1,\quad n=2$ will give your integral without the bounds plugged in. Note that this formula only works when $b\neq0$, $n$ is an integer, and $n\geq2$.
A: Full Work
Perform a substitution: 
$$x = tan(u)$$
$$dx = sec^2(u)du$$
Then:
$$\int\nolimits\frac{sec^2(u)}{(1+tan^2(u))^2} du$$
Use the trig identity:
$$1+tan^2(x) = sec^2(x)$$
Then:
$$\int\nolimits\frac{sec^2(u)}{sec^4(u)} du$$
Simplify:
$$\int\nolimits\frac{1}{sec^2(u)} du$$
$$\int\nolimits{cos^2(u)} du$$
Use the identity:
$$\cos^{2}(x) = \frac{1}{2}(1+\cos(2x))$$
Then:
$$\frac{1}{2}\int\nolimits{(1+\cos(2u))} du$$
Which equals:
$$\frac{1}{2}u + \frac{1}{4}\sin(2u) du$$
Now either sub back:
$$ x = tan(u)$$ 
Or solve for new limits, by plugging a & b in to:
$$ x = tan(u)$$
