<s>[INST] 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.
 [/INST] 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$.
</s>