Help with Euler Substitution Let $a < 0$. Find the following indefinite integral by using the third Euler substitution.
$$\int \frac{dx}{(x^2 + a^2) \sqrt{x^2 - a^2}}$$
Where the third Euler substitution is defined by:
Given an integral of the form $\int R(x, \sqrt{ax^2 + bx + c})dx,$ $a \neq 0$.
If the quadratic polynomial under the radical has 2 distinct real roots $\alpha_1$ and $\alpha_2$ i.e.,
$$ax^2 + bx + c = a(x-\alpha_1)(x - \alpha_2),$$
then set
$$\sqrt{ax^2 + bx + c} = t(x - \alpha_{1 \text{ or } 2}).$$
Hint: $t^4 + 1 = (t^2 - \sqrt 2t + 1)(t^2 + \sqrt 2t + 1)$.
I tried beginning by setting $$\sqrt{x^2 - a^2} = t(x-a)$$ and attempted to solve for $x$ in order to find some function to define $dx$ in terms of $dt$ but I'm having some trouble. I'm not quite sure how to apply the hint here.
Thanks in advance.
 A: I went with $\sqrt{x^2-a^2}=t (x+a)$, although I doubt it matters.  In any case, there's just a bunch of algebra to work through:
$$t=\sqrt{\frac{x-a}{x+a}} \implies x = a \frac{1+t^2}{1-t^2}$$
$$dx = \frac{4 a t}{(1-t^2)^2} dt$$
$$x^2+a^2 = 2 a^2 \frac{1+t^4}{(1-t^2)^2}$$
$$x^2-a^2 = a^2 \frac{4 t^2}{(1-t^2)^2}$$
so that
$$\begin{align} \int \frac{dx}{(x^2+a^2) \sqrt{x^2-a^2}} &= \frac{2a}{a^3} \int dt  \frac{t}{(1-t^2)^2} \frac{(1-t^2)^2}{1+t^4} \frac{1-t^2}{2 t}\\ &= \frac{1}{a^2} \int dt \frac{1-t^2}{1+t^4} \end{align}$$
Now put that hint to good use.  Actually, I'll give you a better one:
$$\frac{1-t^2}{1+t^4} = \frac{1}{2 \sqrt{2}} \left ( \frac{2 t + \sqrt{2}}{t^2+\sqrt{2} t+1} - \frac{2 t - \sqrt{2}}{t^2-\sqrt{2} t+1} \right )$$
Note that the fractions are of the form $h'(t)/h(t)$ for some function $h$.
A: Here is an alternative which does not really answer the question, but proposes a way to check the answer.
I recall that in such a situation, the trigonometric substitution
$$
x=a\sec\theta \qquad dx=a\sec\theta\tan\theta d\theta
$$
could help.
So I tried and I found it yields, after simplification
$$
\frac{1}{a^2}\int\frac{\cos \theta}{2-\sin^2\theta}d\theta.
$$
Now change the variable again with $u=\sin\theta$ to get
$$
\frac{1}{a^2}\int \frac{du}{2-u^2}=\frac{1}{2\sqrt{2}a^2}\int \left(\frac{1}{u-\sqrt{2}}-\frac{1}{u+\sqrt{2}}\right)du
$$
$$
\frac{\sqrt{2}}{4a^2}\log\lvert\frac{u-\sqrt{2}}{u+\sqrt{2}} \rvert +C.
$$
Can I let you substitute back to get functions of $x$?
You can use
$$
\sin \mbox{arcsec}(x/a)=-\frac{\sqrt{x^2-a^2}}{x}
$$
for $x<a<0$.
