Integrate $\int \frac{(x+1)}{(x^2+2)^2}dx$ This is the question I want to ask
Integrate $$\int \frac{(x+1)}{(x^2+2)^2}\,dx.$$
 I tried it using algebric manipulation
Integrate $x/(x^2+2)^2+1/(x^2+2)^2$.
Then the latter part would not be solved.
 A: HINT:
$x=\sqrt2\tan y\implies $
$$\int \frac{(x+1)}{(x^2+2)^2}\,dx=\int\dfrac{\sqrt2\tan y+1}{(2\sec^2y)^2}\cdot\sqrt2\sec^2y\ dy$$
$$=\dfrac1{2\sqrt2}\int(\sqrt2\sin y\cos y+\cos^2y)dy$$
$$=\dfrac1{4\sqrt2}\int(\sqrt2\sin2y+1+\cos2y)dy$$
Can you take it from here?
A: We split the integral into two components as
$$\int\frac{x+1}{(x^2+2)^2}dx=\int\frac{x}{(x^2+2)^2}dx+\int\frac{1}{(x^2+2)^2}dx\tag 1$$

The first integral on the right-hand side of $(1)$ is trivial to evaluate using the substitution $x^2=u\implies x\,dx\to \frac12 du$.  Then, 
$$\begin{align}
\int\frac{x}{(x^2+2)^2}dx&=\frac12\int  \frac{1}{(u+2)^2}\,du\\\\
&=-\frac12 \frac{1}{u+2}\\\\
&=-\frac12 \frac{1}{x^2+2} \tag 2
\end{align}$$

For the second integral on the right-hand side of $(1)$ , we use the classical trigonometric substitution $x=\sqrt{2}\tan \theta\implies dx=\sqrt{2}\sec^2 \theta d\theta$.  Then,
$$\begin{align}
\int\frac{1}{(x^2+2)^2}dx&=\frac{\sqrt{2}}{4}\int  \frac{\sec^2 \theta}{\sec^4 \theta}\,d\theta\\\\
&=\frac{\sqrt{2}}{4}\int  \cos^2 \theta \,d\theta\\\\
&=\frac{\sqrt{2}}{4}\int  \left(\frac{1+\cos 2x}{2}\right) \,d\theta\\\\
&=\frac{\sqrt{2}}{8} \left(\theta +\frac12 \sin 2\theta\right)\\\\
&=\frac{\sqrt{2}}{8} \left(\theta + \sin \theta \cos \theta \right)\\\\
&=\frac{\sqrt{2}}{8} \left(\arctan(x/\sqrt{2}) + \frac{\sqrt{2}x}{x^2+2} \right) \tag 3\\\\
\end{align}$$

Putting $(2)$ and $(3)$ together, we have
$$\bbox[5px,border:2px solid #C0A000]{\int\frac{x+1}{(x^2+2)^2}dx=\frac{\sqrt{2}}{8} \arctan(x/\sqrt{2})+\frac14 \frac{x-2}{x^2+2}+C}$$
A: HINT: The latter part can be computed by integrating by parts:
$$
\int \frac1{x^2+2}\,dx=\int \frac{x^2+2}{(x^2+2)^2}\,dx
$$
and
$$
\int\frac{x^2}{(x^2+2)^2}\,dx=\int \frac{2x}{(x^2+2)^2}\cdot\frac12x\,dx.
$$
The rest should be easy.
A: $\bf{My\; Solution::}$ Let $$\displaystyle I = \int\frac{1}{(x^2+2)^2}dx$$
Let $x=\sqrt{2}\tan \theta\;,$ Then $dx = \sqrt{2}\sec^2 \theta d\theta$
So Integral $$\displaystyle I = \int\frac{\sqrt{2}\sec^2 \theta }{4\sec^4 \theta }d\theta = \frac{1}{2\sqrt{2}}\int \cos ^2\theta d\theta = \frac{1}{4\sqrt{2}}\int (1+\cos 2 \theta )d\theta$$
So $$\displaystyle I = \frac{1}{4\sqrt{2}}\left(\theta +\frac{\sin 2\theta }{2}\right)+\mathcal{C} = \frac{1}{4\sqrt{2}}\tan^{-1}\left(\frac{x}{\sqrt{2}}\right)+\frac{1}{4\sqrt{2}}\cdot \frac{\sqrt{2}x}{x^2+2}+\mathcal{C}$$
So $$\displaystyle I = \int \frac{1}{(x^2+2)^2}dx = \frac{1}{4\sqrt{2}}\tan^{-1}\left(\frac{x}{\sqrt{2}}\right)+\frac{1}{4}\cdot \frac{x}{x^2+2}+\mathcal{C}$$
