8. Compute
$$
\int_{0}^{\pi / 3} x \tan ^{2}(x) d x
$$
Answer: $\frac{\pi \sqrt{3}}{3}-\frac{\pi^{2}}{18}-\ln 2$
Solution: We have
$$
\begin{aligned}
\int_{0}^{\pi / 3} x \tan ^{2}(x) d x & =\int_{0}^{\pi / 3} x\left(-1+\frac{1}{\cos ^{2}(x)}\right) d x \\
& =-\left.\frac{x^{2}}{2}\right|_{0} ^{\pi / 3}+\int_{0}^{\pi / 3} \frac{x d x}{\cos ^{2}(x)} \\
& =-\left.\frac{x^{2}}{2}\right|_{0} ^{\pi / 3}+\left(\left.x \tan (x)\right|_{0} ^{\pi / 3}-\int_{0}^{\pi / 3} \tan (x) d x\right) \quad\left(u=x ; d v=\frac{d x}{\cos ^{2}(x)}\right) \\
& =-\frac{x^{2}}{2}+x \tan (x)+\left.\ln |\cos (x)|\right|_{0} ^{\pi / 3}=-\frac{\pi^{2}}{18}+\frac{\pi \sqrt{3}}{3}-\ln (2)
\end{aligned}
$$