We solve the integral \( I \) as follows:
\[
I = \int_0^\pi \frac{4 \cos^2 x + \sin^2 x}{8x} \, dx
\]
First, we split the integral into two parts:
\[
I = \int_0^\pi \frac{4 \cos^2 x}{8x} \, dx + \int_0^\pi \frac{\sin^2 x}{8x} \, dx
\]
Simplify and evaluate each part.
After calculating, the final value of the integral is \( 2\pi^2 \).