<s>[INST] Solving the the Integral: $\int\frac{1}{u^2-2}du$ I am attempting to solve the following integral, in which I am not sure, how to proceed:
$\int\frac{1}{u^2-2}du$
I have tried the following, but I am not sure if it is correct:
$y = u^2-2$
$dy = 2u*du$
$du = \frac{dy}{2u}$
Therefore:
$\int\frac{1}{u^2-1}du = \int\frac{1}{y}*\frac{dy}{2u} = \int\frac{1}{y}*\frac{1}{2u}dy = \int\frac{1}{y2u}dy$
Solving for u:
$u^2 = y+2$
$u = \sqrt{y + 2}$
Substituting $u$ for $\sqrt{y + 2}$:
$\int\frac{1}{y2u}dy = \int\frac{1}{y2(\sqrt{y + 2})}dy$
I am not sure, where to go from here. The only thing I can remember is to use the logarithm rule where:
$\int\frac{1}{y2(\sqrt{y + 2})}dy = ln|{y2(\sqrt{y + 2})}| + C$
Would that be correct?
 [/INST] Another approach: Let $u=\sqrt2\sec t$, so $du=\sqrt2\sec t\tan t\,dt$. Then we have:
$$\begin{align}
\int\frac1{u^2-2}du &= \int\frac{\sqrt2\sec t\tan t}{2\sec^2t-2}dt\\
&= \frac1{\sqrt2}\int\frac{\sec t \tan t}{\sec^2 t-1}dt\\
&= \frac1{\sqrt2}\int\frac{\sec t\tan t}{\tan^2 t}dt\\
&= \frac1{\sqrt2}\int\frac{\sec t}{\tan t}dt\\
&= \frac1{\sqrt2}\int\csc t\,dt\\
&= -\frac1{\sqrt2}\ln\left|\csc t + \cot t\right|+C
\end{align}$$
Since $\sec t=\frac{u}{\sqrt2}$, we have $\csc t=\frac{u}{\sqrt{u^2-2}}$ and $\cot t=\frac{\sqrt2}{\sqrt{u^2-2}}$. Thus, we end up with:
$$\begin{align}
-\frac{1}{\sqrt2}\ln\left|\frac{u+\sqrt2}{\sqrt{u^2-2}}\right|+C &= -\frac{1}{\sqrt2}\ln\left|\sqrt{\frac{(u+\sqrt2)^2}{u^2-2}}\right|+C\\
&= -\frac{1}{2\sqrt2}\ln\left|\frac{(u+\sqrt2)^2}{(u+\sqrt2)(u-\sqrt2)}\right|+C\\
&= -\frac{1}{2\sqrt2}\ln\left|\frac{u+\sqrt2}{u-\sqrt2}\right|+C\\
&= \frac{1}{2\sqrt2}\ln\left|\frac{u-\sqrt2}{u+\sqrt2}\right|+C
\end{align}$$
Messy, but possibly instructive. Partial fractions are cleaner than trig substitution, when you can use them.
</s>