I have been stuck trying to figure out an integration problem involving trigonometric substitution.
$$ \int \frac{dx}{x^2\sqrt{x^2 + 9}} $$ So I substituted $$ x = 3\tan\theta $$ $$ dx = 3\sec^2\theta \,d\theta $$
and I plug in everything and simplify until I get $$ \frac{1}{9} \int \frac{ \cos \theta \,d \theta}{\sin^2 \theta} $$ I substitute $$ u = \sin \theta $$ and $$ du = \cos \theta \,d \theta $$
and I integrate and plug back in, in terms of theta and my answer is $$ \frac{-\csc( \theta )}{9} + C $$ However, I have to substitute back in my first substitution, which was the trigonometric substitution, to get the final answer, but I don't really know how. I do know we need : $$ \theta = \arctan(\frac{x}{3}) $$ but I'm not sure what to do afterwards. Sorry if this is a little messy, this is my first time working with latex and my first post.
$$x = 3\tan \theta \iff \tan\theta = \frac x3 \implies \sin\theta = \frac x{\sqrt{x^2 + 9}} \implies \csc \theta = \frac{\sqrt{x^2 + 9}}{x}$$
This follows if we consider a right-triangle with legs $3, x,$ and hypotenuse $\sqrt{x^2 + 9}$, where the $\theta $ is the angle formed by the intersection of the leg of length $3$ with the hypotenuse.
This means $$-\frac{\csc\theta}{9} = -\frac{\sqrt{x^2 + 9}}{9x}$$