#\int\frac{x+4}{x^2+2x+5}\ dx#
#=\int \frac{1/2(2x+2)+3}{x^2+2x+5}\ dx#
#=1/2\int \frac{(2x+2)dx}{x^2+2x+5}+\int \frac{3}{x^2+2x+5}\ dx#
#=1/2\int \frac{d(x^2+2x+5)}{x^2+2x+5}+3\int \frac{1}{(x+1)^2+2^2}\ dx#
#=1/2\ln|x^2+2x+5|+3\int \frac{d(x+1)}{(x+1)^2+2^2}#
Using standard formula #\int \frac{1}{t^2+a^2}dt=1/a\tan^{-1}(t/a)#,
#=1/2\ln|x^2+2x+5|+3\frac{1}{2} \tan^{-1}(\frac{x+1}{2})+C#
#=1/2\ln|x^2+2x+5|+\frac{3}{2} \tan^{-1}(\frac{x+1}{2})+C#