<s>[INST] Quadratic Expressions: Advanced techniques of Integration $$\int \frac{x}{\sqrt{5+12x-9x^2}}\,dx$$
After two steps I arrive at $\displaystyle{ \int \frac{x}{\sqrt{9-(3x-2)^2}}}\,dx$
Using trigonometric substitution, we have a triangle with a cosine of $\theta$ of $\displaystyle{\sqrt{9-(3x-2)^2}\over 3}$ and a $\sin(\theta$) of $(3x-2)\over (3)$. 
The final two steps of solving give
$\displaystyle {\frac{-1}{3}\cos(\theta) + \frac{2}{9}\theta +C}$
Therefore
-$\displaystyle{\sqrt{9-(3x-2)^2}\over 9}$ 
Wolfram alpha says that there should be a positive sign, i.e. -$\displaystyle{\sqrt{9+(3x-2)^2}\over 9}$
How can that be possible given the value for cosine of theta? 
 [/INST] $$3I=\int\frac{3xdx}{\sqrt{3^2-(3x-2)^2}}$$
Setting $3x-2=3\sin\theta\implies dx=\cos\theta\ d\theta$
and $3x=2+3\sin\theta$
$$3I=\int\frac{\cos\theta(2+3\sin\theta)}{3\text{sign}(\cos\theta)\cos\theta}d\theta$$
$$\implies9I=\text{sign}(\cos\theta)\int(2+3\sin\theta)d\theta$$
$$=\text{sign}(\cos\theta)(2\theta-3\cos\theta+K)$$
Now, $\theta=\arcsin\dfrac{3x-2}3$  and $\cos^2\theta=1-\left(\dfrac{3x-2}3\right)^2=\dfrac{5+12x-9x^2}9$
Form the principal value definition, $-\dfrac\pi2\le\theta\le\dfrac\pi2\implies\cos\theta\ge0$
</s>