First of all i am wondering if there is a mistake to the solution i have for this problem, i am also curious if there is a a different way to solve this problem and if anyone knows a good resource for other hard to integrate problems i would love to have it, thanks.
$$\int \sqrt{x^2+4x+13}$$

$$\int \sqrt{x^2+4x+13} \space dx=\int{\sqrt{(x+2)^2+9}} \space dx$$

let $3\tan(\theta )=x+2 \space \space$ this implys that $dx=3\sec^2(\theta)d\theta$

$$\int{\sqrt{9\tan^2(\theta)+3^2}} \space 3\sec^2(\theta) \space d\theta =9\int{\sqrt{\tan^2(\theta)+1}} \space \sec^2(\theta) \space d\theta =9\int \sec^3(\theta)d\theta $$
$$\int \sec^3(\theta)d\theta = \sec(\theta)\sec^2(\theta )$$

We use integration by parts \begin{matrix} 
 & D & I \\
 & \sec(\theta) & \sec^2(\theta) \\
 & \sec(\theta)\tan(\theta) & \tan(\theta) \\
 \end{matrix}
$$\sec(\theta)\tan(\theta)-\int \tan^2(\theta) \sec(\theta))=\sec(\theta)\tan(\theta)-\int \sec^3(\theta)-\sec(\theta)$$
$$\int \sec^3(\theta)=\sec(\theta)\tan(\theta)-\int \sec^3(\theta)-\int \sec(\theta)$$
$$2\int \sec^3(\theta)=\sec(\theta)\tan(\theta)-\int \sec(\theta)$$

$$\int \sec(\theta)\space d\theta=\int \frac{\sec(\theta)(\sec(\theta) + \tan(\theta)}{\sec(\theta) + \tan(\theta)}\space d\theta$$
Let $n=\sec(\theta) + \tan(\theta)$ then $dn=(\sec(\theta)\tan(\theta) + \sec^2(\theta))$
$$\int \frac{\sec(\theta)(\sec(\theta) + \tan(\theta))}{\sec(\theta) + \tan(\theta)}\space d\theta=\int \frac{\sec(\theta)}{(\sec(\theta)\tan(\theta) + \sec^2(\theta))}\space dn=\int\frac{1}{n}\space dn$$
$$\int\frac{1}{n}\space dn=\ln|\sec(\theta) + \tan(\theta)|$$
$$\int \sec^3(\theta)=\frac{\sec(\theta)\tan(\theta)-\ln|\sec(\theta) + \tan(\theta)|}{2}$$
Since $\tan(\theta)=\frac{x+2}{3}$ Pythagoras's theorem tells use that the hypotenuse of this triangle is $\sqrt{(x+2)^2+9} $
Since $\sec(\theta)= \frac{\sqrt{(x+2)^2+9}}{3} $ and $\tan(\theta)=\frac{x+2}{3}$ we have that
$$\int \sqrt{x^2+4x+13}=\frac{(x+2)\sqrt{x^2+4x+13}}{2} - \frac{9}{2}\ln|\frac{\sqrt{x^2+4x+13}}{3}+\frac{x+2}{3}|$$ Since the hypotonus of a triangle is always bigger than either of its sides and the square root of a number must always be positive, we have that
$$ \frac{(x+2)\sqrt{x^2+4x+13}}{2} - \frac{9}{2}\ln|\frac{\sqrt{x^2+4x+13}}{3}+\frac{x+2}{3}|=$$ $$\frac{(x+2)\sqrt{x^2+4x+13}}{2} - \frac{9}{2}\ln(\frac{\sqrt{x^2+4x+13}}{3}+\frac{x+2}{3}) +C$$
$$\int \sqrt{x^2+4x+13} \space dx =\frac{(x+2)\sqrt{x^2+4x+13}}{2} - \frac{9}{2}\ln(\frac{\sqrt{x^2+4x+13}}{3}+\frac{x+2}{3}) +C$$

Now for some reason the solution i have says that the answer is actually
$$\int \sqrt{x^2+4x+13} \space dx =\frac{(x+2)\sqrt{x^2+4x+13}}{2} - \frac{9}{2}\ln(\sqrt{x^2+4x+13}+x+2) +C$$

However, i don't see where the flaw in my logic is perhaps a mistake?