8. [40] Compute
$$
\int_{0}^{\pi} \frac{2 \sin \theta+3 \cos \theta-3}{13 \cos \theta-5} \mathrm{~d} \theta \text {. }
$$
Answer:
$\frac{3 \pi}{13}-\frac{4}{13} \log \frac{3}{2}$

We have
$$
\begin{aligned}
\int_{0}^{\pi} \frac{2 \sin \theta+3 \cos \theta-3}{13 \cos \theta-5} \mathrm{~d} \theta & =2 \int_{0}^{\pi / 2} \frac{2 \sin 2 x+3 \cos 2 x-3}{13 \cos 2 x-5} \mathrm{~d} x \\
& =2 \int_{0}^{\pi / 2} \frac{4 \sin x \cos x-6 \sin ^{2} x}{8 \cos ^{2} x-18 \sin ^{2} x} \mathrm{~d} x \\
& =2 \int_{0}^{\pi / 2} \frac{\sin x(2 \cos x-3 \sin x)}{(2 \cos x+3 \sin x)(2 \cos x-3 \sin x)} \mathrm{d} x \\
& =2 \int_{0}^{\pi / 2} \frac{\sin x}{2 \cos x+3 \sin x}
\end{aligned}
$$

To compute the above integral we want to write $\sin x$ as a linear combination of the denominator and its derivative:
$$
\begin{aligned}
2 \int_{0}^{\pi / 2} \frac{\sin x}{2 \cos x+3 \sin x} & =2 \int_{0}^{\pi / 2} \frac{-\frac{1}{13}[-3(2 \cos x+3 \sin x)+2(3 \cos x-2 \sin x)]}{2 \cos x+3 \sin x} \\
& =-\frac{2}{13}\left[\int_{0}^{\pi / 2}(-3)+2 \int_{0}^{\pi} \frac{-2 \sin x+3 \cos x}{2 \cos x+3 \sin x}\right] \\
& =-\frac{2}{13}\left[-\frac{3 \pi}{2}+\left.2 \log (3 \sin x+2 \cos x)\right|_{0} ^{\pi / 2}\right] \\
& =-\frac{2}{13}\left[-\frac{3 \pi}{2}+2 \log \frac{3}{2}\right] \\
& =\frac{3 \pi}{13}-\frac{4}{13} \log \frac{3}{2} .
\end{aligned}
$$