8 (a) Find $\int \frac{2 x-1}{x^2+2 x+1} \mathrm{~d} x$.
[4]
(b) Find the exact value of $\int_0^2 \frac{|2 x-1|}{x^2+2 x+1} \mathrm{~d} x$.
[3]
(a) $2\ln |x+1|+\frac{3}{x+1}+c$
(b) $2 \ln \frac{4}{3}$
(a)
$$
\begin{array}{l}
\int \frac{2 x-1}{x^2+2 x+1} d x \\
=\int \frac{2 x+2}{x^2+2 x+1}-\frac{3}{x^2+2 x+1} d x \\
=\int \frac{2 x+2}{x^2+2 x+1}-\frac{3}{(x+1)^2} d x \\
=\ln \left(x^2+2 x+1\right)+\frac{3}{x+1}+c \\
=2\ln (x+1)^2+\frac{3}{x+1}+c \\
\end{array}
$$
(b)
$$
\begin{array}{l}
\int_0^2 \frac{|2 x-1|}{x^2+2 x+1} d x \\
=-\int_0^{0.5} \frac{2 x-1}{x^2+2 x+1} d x+\int_{0.5}^2 \frac{2 x-1}{x^2+2 x+1} d x \\
=-\left[\ln (x^2+2 x+1) +\frac{3}{x+1}\right]_0^{0.5}+\left[\ln \left(x^2+2 x+1\right)+\frac{3}{x+1}\right]_{0.5}^2 \\
=-\left(\ln \frac{9}{4}+2-3\right)+\left(\ln 9+1-\ln \frac{9}{4}-2\right) \\
=\ln \frac{16}{9} \\
=2 \ln \frac{4}{3}
\end{array}
$$