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?

substitute $x=a\tan { \theta  } ,dx=\frac { a\,d\theta  }{ \cos ^{ 2 }{ \theta  }  }$
 so 

$$\\ \\ \\ \int  \frac { dx }{ x^{ 4 }\sqrt { a^{ 2 }+x^{ 2 } }  } =\int  \frac { a\,d\theta  }{ \cos ^{ 2 }{ \theta  } { \left( a\tan { \theta  }  \right)  }^{ 4 }\sqrt { a^{ 2 }+{ a }^{ 2 }\tan ^{ 2 }{ \theta  }  }  } =\frac { 1 }{ { a }^{ 4 } } \int { \frac { \cos ^{ 3 }{ \theta  } }{ \sin ^{ 4 }{ \theta  }  }  } \, d\theta  =\\ \\ =\frac { 1 }{ { a }^{ 4 } } \int { \frac { 1-\sin ^{ 2 }{ \theta  }  }{ \sin ^{ 4 }{ \theta  }  } d\sin { \theta  }  } =\frac { 1 }{ { a }^{ 4 } } \left[ \int { \frac { d\sin { \theta  }  }{ \sin ^{ 4 }{ \theta  }  }  } -\int { \frac { d\sin { \theta  }  }{ \sin ^{ 2 }{ \theta  }  }  }  \right] =\\ =\frac { 1 }{ { a }^{ 4 } } \left[ -\frac { 1 }{ 3\sin ^{ 3 }{ \theta  }  } +\frac { 1 }{ \sin { \theta  }  }  \right] =\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\\   $$ 

