I am working through a Pure Maths book as a hobby. I am struggling with the second part of this problem:
Differentiate $\arctan(x + a)$ with respect to x and use your result to find
a) $\displaystyle\int \frac{dx}{x^2 + 4x +5}$
b) $\displaystyle\int \frac{dx}{x^2 + 2x +5}$
I differentiated $\arctan(x + a)$ with respect to x:
$$\frac {dy}{dx} \arctan(x + a) = \frac{1}{(x + a)^2 +1}$$
From this I was able to say:
$$\int \frac{dx}{x^2 + 4x +5} = \int \frac{dx}{(x + 2)^2 +1} \implies \int \frac{dx}{x^2 + 4x +5} = \arctan(x + 2) + c$$
But I cannot apply this technique to b) because $x^2 + 2x + 5$ won't factorise.
You can do it as follows: $\displaystyle x^2+2x+5=(x+1)^2+4=4\left(\left(\frac{x+1}2\right)^2+1\right)$, and therefore\begin{align}\int\frac{\mathrm dx}{x^2+2x+5}&=\frac14\int\frac{\mathrm dx}{\left(\frac{x+1}2\right)^2+1}\\&=\frac14\times2\arctan\left(\frac{x+1}2\right)+C\\&=\frac12\arctan\left(\frac{x+1}2\right)+C.\end{align}