<s>[INST] Evaluate $\int \frac{x^2 + x+3}{x^2+2x+5}\ dx$ How can we evaluate $$\displaystyle\int \frac{x^2 + x+3}{x^2+2x+5} dx$$  
To be honest, I'm embarrassed. I decomposed it and know what the answer should be but
I can't get the right answer. 
 [/INST] You can decompose your integrand as follows:
$$ \frac{ x^2 + 2x + 5 - x - 1 - 1}{x^2 + 2x + 5} = 1 - \frac{x + 1}{x^2 + 2x + 5} - \frac{1}{(x+1)^2 + 4}$$
You can integrate the first term directly, the second term after the substitution $u = x^2 + 2x + 5$, and the third term by recalling that $(\arctan{x})' = 1/(x^2 + 1)$, and then using another substitution to make the expression look like the derivative of $\arctan$.
</s>