<s>[INST] Indefinite Integral - How to do questions with square roots? 
$$\int \frac{dx}{x^4 \sqrt{a^2 + x^2}}$$

In the above question, my first step would be to try and get out of the square root, so I would take  $ t^2 = a^2 + x^2 $. But that gets me nowhere. How would you solve this, and if you are going to take a substitution what is the logic behind that substitution?
 [/INST] You can use trigonometric functions. Substitute $x=a*tan(u)$ and $dx=a*\frac{du}{{cos}^{2}u}$ this gives:
$$\int \dfrac{dx}{x^4 \sqrt{a^2 + x^2}} =\int \dfrac{du}{a^4\cos(u){\tan}^{4}(u)}$$
Working further on the solution of Battani and by simplifying:
$${ \sin{ \left( \arctan { \frac { x }{ a }  }  \right)  }  }=\frac{x}{\sqrt{x^2+a^2}}$$
This gives: 
$$\frac { 1 }{ { a }^{ 4 } } \left[ -\frac { 1 }{ 3\sin ^{ 3 }{ \left( \arctan { \frac { x }{ a }  }  \right)  }  } +\frac { 1 }{ \sin { \left( \arctan { \frac { x }{ a }  }  \right)  }  }  \right] +C\\=\frac{1}{a^4}\left[ -\frac{(x^2+a^2)^{3/2}}{3x^3}+\frac{\sqrt{x^2+a^2}}{x}\right]$$
Simplifying further:
$$\frac{1}{a^4}\left[ -\frac{(3x^2-{x^2+a^2})\sqrt{x^2+a^2})}{3x^3}\right]=$$
$$-\frac{(2x^2+a^2)\sqrt{x^2+a^2})}{3a^4x^3}$$
</s>