To solve the integral \( I = \int_0^{\pi} x \sin x \cos^2 x \, dx \), we will use the property of definite integrals and some substitution. Here’s the step-by-step solution:
### Step 1: Use the property of definite integrals
We can use the property that states:
\[
\int_0^a f(x) \, dx = \int_0^a f(a - x) \, dx
\]
In our case, \( a = \pi \). Thus, we write:
\[
I = \int_0^{\pi} x \sin x \cos^2 x \, dx = \int_0^{\pi} (\pi - x) \sin(\pi - x) \cos^2(\pi - x) \, dx
\]
### Step 2: Simplify the integral
Using the identities \( \sin(\pi - x) = \sin x \) and \( \cos(\pi - x) = -\cos x \), we have:
\[
I = \int_0^{\pi} (\pi - x) \sin x \cos^2 x \, dx
\]
This can be split into two parts:
\[
I = \int_0^{\pi} \pi \sin x \cos^2 x \, dx - \int_0^{\pi} x \sin x \cos^2 x \, dx
\]
Let’s denote the second integral as \( I \) again:
\[
I = \pi \int_0^{\pi} \sin x \cos^2 x \, dx - I
\]
### Step 3: Solve for \( I \)
Adding \( I \) to both sides gives:
\[
2I = \pi \int_0^{\pi} \sin x \cos^2 x \, dx
\]
Thus,
\[
I = \frac{\pi}{2} \int_0^{\pi} \sin x \cos^2 x \, dx
\]
### Step 4: Evaluate the integral \( \int_0^{\pi} \sin x \cos^2 x \, dx \)
We will use the substitution \( u = \cos x \), which gives \( du = -\sin x \, dx \). The limits change as follows:
- When \( x = 0 \), \( u = 1 \)
- When \( x = \pi \), \( u = -1 \)
Thus, we have:
\[
\int_0^{\pi} \sin x \cos^2 x \, dx = \int_1^{-1} (-u^2) \, du = \int_{-1}^{1} u^2 \, du
\]
### Step 5: Calculate the integral \( \int_{-1}^{1} u^2 \, du \)
The integral can be computed as:
\[
\int_{-1}^{1} u^2 \, du = \left[ \frac{u^3}{3} \right]_{-1}^{1} = \left( \frac{1^3}{3} - \frac{(-1)^3}{3} \right) = \frac{1}{3} - \left(-\frac{1}{3}\right) = \frac{2}{3}
\]
### Step 6: Substitute back to find \( I \)
Now substituting back, we get:
\[
I = \frac{\pi}{2} \cdot \frac{2}{3} = \frac{\pi}{3}
\]
### Final Answer
Thus, the value of the integral is:
\[
\boxed{\frac{\pi}{3}}
\]