My textbook provided solution:
$\int \frac{dx}{\sqrt{\left(x+2\right)^2+9}}$
= $\int \frac{dx}{\sqrt{\left(x+2\right)^2+9}}$
= $\int \frac{ d(x+2)}{\sqrt{\left(x+2\right)^2+9}} $
=$\:\ln \:\left|\left(x+2+\sqrt{\left(x+2\right)^2+9}\right)\right|+C$
Can someone please explain why is that? I don't get it, how can you somehow just get $d(x+2)$?
EDIT: I looked again and it is based on this rule, but I still cannot see how it obtained the answer.
$\int \:\frac{f\:'\left(x\right)dx}{f\left(x\right)}=\int \:\frac{d\:f\:\left(x\right)}{f\left(x\right)}=\ln \left(f\left(x\right)\right)+c$
No. It does not work.
Try the following substitution: $$x+2=3\tan\theta,$$ where $-\frac{\pi}{2}<\theta<\frac{\pi}{2}.$