<s>[INST] Evaluating $\int{\sqrt{x^2+4x+13}\, dx}$ I was trying to calculate with $\sinh$ :
$$\begin{align}I&=\int{\sqrt{x^2+4x+13}\, dx}\\&=\int{\sqrt{(x+2)^2+9}\, dx}\end{align}$$
Now with $x+2=3\sinh(u)$, $dx=3\cosh(u)\,du$
$$\begin{align}I&=3\int{\left(\sqrt{9\sinh^2(u)+9}\, \right)\cosh(u)\, du}\\&=9\int{\cosh(u)\sqrt{\sinh^2(u)+1}\, du}\\&=9\int{\cosh^2(u)\,du}\\&=\frac{9}{2}\int{\cosh(2u)+1\, du}\\&=\frac{9}{2}\left(\frac{1}{2}\sinh(2u)+u\right)+C\end{align}$$
How can I rewrite the $\frac{1}{2}\sinh(2u)$ in terms of $x$? I tried with the double angle formula, but this seemingly just complicates things by introducing $\cosh(u)$ also.
 [/INST] Letting $x+2=3\tan \theta$ changes the integral into
$$
I=9 \int \sec ^3 \theta d \theta
$$
$$
\begin{aligned}
\int \sec ^3 \theta d \theta &=\int \sec \theta d(\tan \theta) \\
&=\sec \theta \tan \theta-\int \sec \theta \tan ^2 \theta d \theta \\
&=\sec \theta \tan \theta-\int \sec \theta\left(\sec ^2 \theta-1\right) d \theta \\&= \sec \theta \tan \theta-\int \sec ^3 \theta d \theta-\int \sec \theta d \theta\\
&=\frac{1}{2}(\sec \theta \tan \theta+\ln \left|\sec \theta+\tan \theta \right|+C\\
&=\frac{1}{2}\left(\frac{(x+2) \sqrt{x^2+4 x+13}}{9}+\ln \left| \frac{x+2+\sqrt{x^2+4 x+13}}{3}\right|\right)+C
\end{aligned}
$$
Plugging back yields
$$
I=\frac{(x+2) \sqrt{x^2+4 x+13}}{2}+9 \ln \left|x+2+\sqrt{x^2+4 x+13}\right|+C
$$
</s>