<s>[INST] Is my integration of $\sqrt{4z^2 - 4z + 2}$ correct? I'm trying to
$$
\int \sqrt{4z^2 - 4z + 2}\ dz
$$
the integrand I first rewrite to (completing the square)
$$
4\left(z^2 - z +\frac{1}{4} - \frac{1}{4}\right) + 2 = 4\left(z - \frac{1}{2}\right)^2 + 1
$$
I apply $\int \sqrt{a^2 + x^2} \ dx = \frac{x}{2} \sqrt{a^2+x^2} + \frac{a^2}{2} \ln \left(x + \sqrt{a^2+x^2}\right)$.
So, before simplification, I get
$$
(z-1/2)\sqrt{4z^2-4z+2} + 1/2 \ln \left[ 2(z-1/2) + \sqrt{4z^2 - 4z +2} \right]
$$
According to my book, the solution is
$$
(z-1/2)\sqrt{z^2-z+1/2} + 1/4 \ln \left[ z - 1/2 + \sqrt{z^2 - z +1/2} \right]
$$
Is my solution equivalent to the book? I dont see how the book gets the `1/4' before the log.
 [/INST] Your integration methods are all right.
Few silly mistakes that I observed are:


*

*No need to keep it $4(z-\frac{1}{2})^2+1$. You could have made it $(2z-1)^2+1$ directly.

*You should change the $dz$ to $\frac{1}{2}d(2z-1)$,which you have not done. If you take this into account, your result will be according to the textbook. That is, the extra $\frac{1}{2}$ is missing from your result.

</s>