<s>[INST] Help! Integrate using substitution method. I need help integrating the following function:
$$\int\frac{2x+5}{\sqrt{16-6x-x^2}}dx$$
 [/INST] If you let $u=16-6x-x^2$, then $du=(-6-2x)dx=-(2x+6)~dx$. Now you can rewrite your integral:
$$\begin{align*}
\int\frac{2x+5}{\sqrt{16-6x-x^2}}dx&=\int\frac{(2x+6)-1}{\sqrt{16-6x-x^2}}dx\\
&=-\int\frac{du}{\sqrt{u}}-\int\frac1{\sqrt{16-6x-x^2}}dx\;.
\end{align*}$$
The first of these two integrals is an easy power rule integration. For the second, start by completing the square in the denominator:
$$\begin{align*}
\int\frac1{\sqrt{16-6x-x^2}}dx&=\int\frac1{\sqrt{-(x^2+6x-16)}}dx\\
&=\int\frac1{\sqrt{-\left((x+3)^2-25\right)}}dx\\
&=\int\frac1{\sqrt{25-(x+3)^2}}dx\;.
\end{align*}$$
Now make the trig substitution $x+3=5\sin\theta$.
</s>