This is a first-order linear differential equation. The standard form is:
\[
\frac{dy}{dx} + P(x) y = Q(x)
\]
Here, \( P(x) = \cot x \) and \( Q(x) = 4x \csc x \).
The integrating factor \( \mu(x) \) is given by:
\[
\mu(x) = e^{\int P(x) \, dx} = e^{\int \cot x \, dx} = e^{\ln \sin x} = \sin x
\]
Multiply both sides of the differential equation by \( \mu(x) = \sin x \):
\[
\sin x \frac{dy}{dx} + y \sin x \cot x = 4x
\]
This simplifies to:
\[
\frac{d}{dx} \left( y \sin x \right) = 4x
\]
Now, integrate both sides:
\[
\int \frac{d}{dx} \left( y \sin x \right) \, dx = \int 4x \, dx
\]
\[
y \sin x = 2x^2 + C
\]
Now, use the initial condition \( y = 0 \) when \( x = \frac{\pi}{2} \):
\[
0 \cdot \sin \left( \frac{\pi}{2} \right) = 2 \left( \frac{\pi}{2} \right)^2 + C
\]
\[
0 = 2 \times \frac{\pi^2}{4} + C $\Rightarrow$ C = -\frac{\pi^2}{2}
\]
Thus, the particular solution is:
\[
y \sin x = 2x^2 - \frac{\pi^2}{2}
\]
\[
y = \frac{2x^2 - \frac{\pi^2}{2}}{\sin x}
\]
Final Answer:
The particular solution is:
\[
y = \frac{2x^2 - \frac{\pi^2}{2}}{\sin x}
\]