Calculate the integral of $1/(2x^2+2x+1)$ I need to calculate the integral of $1 / (2x^2+2x+1)$.
I used WolframAlpha and get this answer: $$\tan^{-1}(2x+1)$$ but I don't understand how to get there.
Can you help?
 A: $2/((4x^2+4x+1)+1)$
just multiply the numerator and denominator by 2
A: First note that $\displaystyle \int \frac{dy}{a^2+y^2} = \frac1a \tan^{-1}\left(\frac{y}{a} \right)$. This is obtained by substituting $y = a \tan( \theta)$ in the integrand and integrating.
For your problem, $I = \displaystyle \int \frac{dx}{2x^2 + 2x+1}$. First complete the square in the denominator i.e. rewrite $2x^2 + 2x + 1$ as $2 \left(x^2 + x + \frac12 \right) = 2 \left( \left( x + \frac12 \right)^2 + \left(\frac12 \right)^2 \right)$. Hence, we get $$I = \displaystyle \int \frac{dx}{2x^2 + 2x+1} = \int \frac{dx}{2 \left( \left( x + \frac12 \right)^2 + \left(\frac12 \right)^2 \right)} = \frac12 \int \frac{dx}{\left( \left( x + \frac12 \right)^2 + \left(\frac12 \right)^2 \right)}.$$ Setting $y = x + \frac12$, we get $$I = \frac12 \int \frac{dy}{y^2 + \left(\frac12 \right)^2} = \tan^{-1}(2y) = \tan^{-1}(2x+1).$$
A: Here's the method to completion. If it still doesn't make sense, post your progress and we can proceed from there.
You should complete the square on the bottom, use a u-substitution on the squared part, and use the regular arctan integral.
Does that make sense?
A: Well, there are a few general methods that you want to employ when you see a rational function like that. Remember to look for completing the square, inverse trigonometric substitutions, direct substitutions, integration by parts, or partial fractions. In this case, it seems like completing the square or maybe even just factoring it might work, I'll give it a shot.
$$\int \frac{1}{2x^2 + 2x +1} dx = \int \frac{1}{2(x^2 + x + \frac{1}{2})} dx= \int \frac{1}{2((x+\frac{1}{2})^2 + \frac{1}{4})} dx$$
From here I would recommend using a direct substituion of $u=x + \frac{1}{2}$ and continuing from here as suggested in the other answers.
