Integrate $\int \frac{x^2-2}{(x^2+2)^3}dx$ $$\int \frac{x^2-2}{(x^2+2)^3}dx$$
What I did :
Method $(1) $ Re writing $x^2-2 = (x^2+2)-4 $ and partial fractions.
Method $(2) $ Substituting $x^2 = 2\tan^2 \theta $ 
Is there any other easy methods ? 
Some substitution  ? 
 A: Just to follow the answer above, "..for dealing with a numerator that is a power of positive definite quadratic polynomial".  
Use integration by parts, 
\begin{align*}
I_{n}:=\int\frac{dx}{\left(x^{2}+a^{2}\right)^{n}} & =\frac{x}{\left(x^{2}+a^{2}\right)^{n}}+2n\int\frac{x^{2}}{\left(x^{2}+a^{2}\right)^{n+1}}dx\\
 & =\frac{x}{\left(x^{2}+a^{2}\right)^{n}}+2n\int\frac{1}{\left(x^{2}+a^{2}\right)^{n}}dx-2na^{2}\int\frac{1}{\left(x^{2}+a^{2}\right)^{n+1}}dx\\
 & =\frac{x}{\left(x^{2}+a^{2}\right)^{n}}+2nI_{n}-2na^{2}I_{n+1}
\end{align*}
and so 
\begin{align*}
I_{n+1} & =\frac{1}{2na^{2}}\left(\left(2n-1\right)I_{n}+\frac{x}{\left(x^{2}+a^{2}\right)^{n}}\right),\quad n=1,2,\cdots;\\
I_{1} & =\int\frac{dx}{x^{2}+a^{2}}=\frac{1}{a}\arctan\left(\frac{x}{a}\right)+C.
\end{align*}
For $n=2$, 
\begin{align*}
I_{3}=\int\frac{dx}{\left(x^{2}+a^{2}\right)^{3}} & =\frac{3}{4a^{2}}I_{2}+\frac{1}{4a^{2}}\frac{x}{\left(x^{2}+a^{2}\right)^{2}}\\
 & =\frac{3}{8a^{4}}I_{1}+\frac{3}{8a^{4}}\frac{x}{\left(x^{2}+a^{2}\right)}+\frac{1}{4a^{2}}\frac{x}{\left(x^{2}+a^{2}\right)^{2}}\\
 & =\frac{3}{8a^{5}}\arctan\left(\frac{x}{a}\right)+\frac{3}{8a^{4}}\frac{x}{\left(x^{2}+a^{2}\right)}+\frac{1}{4a^{2}}\frac{x}{\left(x^{2}+a^{2}\right)^{2}}+C.
\end{align*}
A: $$\int  \frac { x^{ 2 }-2 }{ \left( x^{ 2 }+2 \right) ^{ 3 } } dx=\int { \frac { { x }^{ 2 }+2-4 }{ { \left( x^{ 2 }+2 \right)  }^{ 3 } }  } dx=\underbrace { \int { \frac { dx }{ { \left( x^{ 2 }+2 \right)  }^{ 2 } }  }  }_{ { I }_{ 1 } } -4\underbrace { \int { \frac { dx }{ { \left( x^{ 2 }+2 \right)  }^{ 3 } }  }  }_{ { I }_{ 2 } } =\\ x=\sqrt { 2 } \tan { t } \\ dx=\sqrt { 2 } \frac { dt }{ \cos ^{ 2 }{ t }  } \\ \\ { I }_{ 1 }=\int { \frac { dx }{ { \left( x^{ 2 }+2 \right)  }^{ 2 } }  } =\sqrt { 2 } \int { \frac { dt }{ 4{ \left( \tan ^{ 2 }{ t } +1 \right)  }^{ 2 }\cos ^{ 2 }{ t }  }  } =\frac { \sqrt { 2 }  }{ 4 } \int { \cos ^{ 2 }{ t } dt } =\frac { \sqrt { 2 }  }{ 4 } \int { \frac { 1+\cos { 2t }  }{ 2 }  } dt=\\ =\frac { \sqrt { 2 }  }{ 8 } \left( t+\frac { \sin { 2t }  }{ 2 }  \right) =\frac { \sqrt { 2 }  }{ 8 } \left( \arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  } +\frac { \sin { 2\left( \arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  }  \right)  }  }{ 2 }  \right) \\ \\ { I }_{ 2 }=\int { \frac { dx }{ { \left( x^{ 2 }+2 \right)  }^{ 3 } }  } =\sqrt { 2 } \int { \frac { dx }{ { 8\left( \tan ^{ 2 }{ t } +1 \right)  }^{ 3 }\cos ^{ 2 }{ t }  }  } =\frac { \sqrt { 2 }  }{ 8 } \int { \cos ^{ 4 }{ t } dt } =\frac { \sqrt { 2 }  }{ 8 } \int { { \left( \frac { 1+\cos { 2t }  }{ 2 }  \right)  }^{ 2 } } dt=\\ =\frac { \sqrt { 2 }  }{ 32 } \int { \left( 1+2\cos { 2t+\cos ^{ 2 }{ 2t }  }  \right)  } dt=\frac { \sqrt { 2 }  }{ 32 } \int { \left( 1+2\cos { 2t } +\frac { 1+\cos { 4t }  }{ 2 }  \right)  } dt=\\ =\frac { \sqrt { 2 }  }{ 32 } \left( \frac { 3t }{ 2 } +\sin { 2t+\frac { \sin { 4t }  }{ 8 }  }  \right) =\frac { \sqrt { 2 }  }{ 32 } \left( \frac { 3\arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  }  }{ 2 } +\sin { 2\left( \arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  }  \right)  } +\frac { \sin { 4\left( \arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  }  \right)  }  }{ 8 }  \right) $$ 
 so the anwer will be   $$\int  \frac { x^{ 2 }-2 }{ \left( x^{ 2 }+2 \right) ^{ 3 } } dx=\frac { \sqrt { 2 }  }{ 8 } \left( \frac { 3\sin { 2\left( \arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  }  \right)  }  }{ 2 } -\frac { \arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  }  }{ 2 } +\frac { \sin { 4\left( \arctan { \left( \frac { x }{ \sqrt { 2 }  }  \right)  }  \right)  }  }{ 8 }  \right) $$
further you can simplify this "monster"
A: If
$$I_n=\int\frac{1}{(ax^2+b)^n}dx\quad,\quad n\ge 2$$
$$I_1=\frac{\sqrt{\frac{b}{a}}}{b}\tan^{-1}\left(\sqrt{\frac{a}{b}}x\right)$$
then
$$I_n=\frac{2n-3}{2b(n-1)}I_{n-1}+\frac{x}{2b(n-1)(ax^2+b)^{n-1}}$$
set $a=1$ and $b=2$ apply
$$\frac{x^2-2}{(x^2+2)^3}=\frac{1}{(x^2+2)^2}-\frac{4}{(x^2+2)^3}$$
we have 
$$\int \frac{x^2-2}{(x^2+2)^3}dx=-\left(\frac{\sqrt{2}}{16}\tan^{-1}\left(\frac{\sqrt{2}x}{2}\right)+\frac{x}{8x^2+16}+\frac{x}{2(x^2+2)^2}\right)+c$$
A: Another approach:
Let:
$$I(c)=\int \frac{x^2-2}{x^2+c} dx$$
$$=\int \frac{x^2+c-c-2}{x^2+c} dx$$
The above step is can be avoided by long division, if it you see it as coming out of the blue. Anyways continuing:
$$=\int \left(1-\frac{c+2}{x^2+c} \right) dx$$
$$=x-\frac{(c+2) \arctan (\frac{x}{\sqrt{c}})}{\sqrt{c}}+C_1$$
Whet $c$ and $C_1$ are two different things. $C$ here represents the constant gained when integrating. Now find
$$\frac{I''(c)}{2}+C_2=\frac{1}{2} \frac{\partial^2}{\partial c^2}  \left(x-\frac{(c+2) \arctan (\frac{x}{\sqrt{c}})}{\sqrt{c}}+C_1 \right)+C_2 =\int  \frac{x^2-2}{(x^2+c)^3} dx$$
Where $C_2$ is another constant gained when integrating. You can more specifically find:
$$\frac{I''(2)}{2}+C_2$$
A: A standard method for dealing with a numerator that is a power of positive definite quadratic polynomial is the following.
Observe that for any positive integer $n$ we have
$$
D\frac{x}{(x^2+2)^n}=-\frac{(2n-1)x^2-2}{(x^2+2)^{n+1}}.\qquad(*)
$$
You can write the right hand side as a linear combination of $1/(x^2+2)^n$ and
$1/(x^2+2)^{n+1}$.
Interpreting $(*)$ as an integration formula then gives you a linear equation involving $\int (x^2+2)^{-(n+1)}\,dx$, $\int (x^2+2)^{-n}\,dx$ and $x/(x^2+2)^n$.
So:


*

*Setting $n=2$ in the resulting equation allows you to integrate $1/(x^2+2)^3$ if you know how to integrate $1/(x^2+2)^2$.

*Setting $n=1$ in the resulting equation allows you to integrate $1/(x^2+2)^2$ if you know how to integrate $1/(x^2+2)$.

*But you know how to integrate $1/(x^2+2)$, don't you?

