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?

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).$$
