<s>[INST] Evaluating $\int \sqrt{5 + 4x - x^2}dx$ $$\int \sqrt{5 + 4x - x^2}dx$$
I am pretty certain what I need to do to this problem is complete the square and turn it into a trig subsitution but I have no idea how to complete the square with a $-x^2$ or really with this problem at all, I just can't make it work.
I tried to see if I could make the problem be the same in any way by just pulling out a negative but that didn't seem to work.
I got the problem up to
$$\int \sqrt{ -1(x-2)^2 - 1}dx$$
But I do not think that does me any good. What I think I need to do is have a difference of squares with a square in it or something, I just have to get rid of the 4x term somehow.
 [/INST] Our integral can be written as,
\begin{equation}
\begin{split}
\int\sqrt{5+4x-x^{2}}dx&=\int\sqrt{9-4+4x-x^{2}}dx\\
                     &=\int\sqrt{3^{2}-(x-2)^{2}}dx.\
\end{split}
\end{equation}
Now by trigonometric substitution,
take $$x-2=3\sin \theta. (\because \text{If we have} \sqrt{a^{2}-x^{2}}  \text{ then we have to substitute} x=a\sin\theta.)$$
Thus,
\begin{equation}
\begin{split}
\int\sqrt{3^{2}-(x-2)^{2}}dx&=\int\sqrt{3^{2}-3^{2}\sin^{2}\theta} 3\cos \theta d\theta\\
                            &=\int 3\sqrt{1-\sin^{2}\theta} 3\cos \theta d\theta\\
                            &=9\int\cos ^{2}\theta d\theta\\
                            &=9\int\frac{1+\cos 2\theta}{2}d\theta\\
                            &=\frac{9}{2}\int 1 d\theta+\frac{9}{2}\int \cos 2\theta d\theta\\
                            &=\frac{9}{2}\left[\theta+\frac{\sin 2\theta}{2}\right]+C=\frac{9}{2}\left[\theta +\frac{2\sin \theta\cos \theta}{2}\right]+C\\
                            &=\frac{9}{2}\left[\sin^{-1}\left(\frac{x-2}{3}\right)+\frac{1}{9}(x-2) \sqrt{9-(x-2)^{2}}\right]+C
\end{split}
\end{equation}
Thus,
$$\int \sqrt{5+4x-x^{2}} dx=\frac{9}{2}\sin^{-1}\left(\frac{x-2}{3}\right)+\frac{(x-2) \sqrt{5+4x-x^{2}}}{2}+C$$
</s>