Concept:
The given differential equation is of the standard form \( \frac{dy}{dx} + P(x)y = Q(x) \), which describes a first-order linear differential equation. We can solve this system using the Integrating Factor method:
\[
\text{I.F.} = e^{\int P(x) \, dx}
\]
The general solution is then given by:
\[
y \cdot (\text{I.F.}) = \int Q(x) \cdot (\text{I.F.}) \, dx + C
\]
Step 1: Identify components and compute the Integrating Factor (I.F.).
Comparing with the standard linear form:
\[
P(x) = -3\cot x \quad \text{and} \quad Q(x) = \sin 2x
\]
Calculate the integral of \( P(x) \):
\[
\int P(x) \, dx = \int -3\cot x \, dx = -3\log|\sin x| = \log|(\sin x)^{-3}| = \log\left(\frac{1}{\sin^3 x}\right)
\]
Now calculate the Integrating Factor:
\[
\text{I.F.} = e^{\log\left(\frac{1}{\sin^3 x}\right)} = \frac{1}{\sin^3 x} = \csc^3 x
\]
Step 2: Write out the solution format.
\[
y \cdot \frac{1}{\sin^3 x} = \int (\sin 2x) \cdot \frac{1}{\sin^3 x} \, dx
\]
Expand using the double-angle identity \( \sin 2x = 2\sin x \cos x \):
\[
y \cdot \frac{1}{\sin^3 x} = \int \frac{2\sin x \cos x}{\sin^3 x} \, dx = 2 \int \frac{\cos x}{\sin^2 x} \, dx
\]
Step 3: Integrate the right-hand side using substitution.
For the integral \( \int \frac{\cos x}{\sin^2 x} \, dx \), substitute \( u = \sin x \), which gives \( du = \cos x \, dx \):
\[
2 \int \frac{du}{u^2} = 2 \left(-\frac{1}{u}\right) = -\frac{2}{\sin x}
\]
Thus, our general solution equation is:
\[
\frac{y}{\sin^3 x} = -\frac{2}{\sin x} + C
\]
Multiplying through by \( \sin^3 x \):
\[
y = -2\sin^2 x + C\sin^3 x
\]
Step 4: Use the initial conditions to find the particular solution parameter \( C \).
We are given that \( y = 2 \) when \( x = \frac{\pi}{2} \). Substitute these boundary values:
\[
2 = -2\sin^2\left(\frac{\pi}{2}\right) + C\sin^3\left(\frac{\pi}{2}\right)
\]
Since \( \sin\left(\frac{\pi}{2}\right) = 1 \):
\[
2 = -2(1)^2 + C(1)^3 \quad \Rightarrow \quad 2 = -2 + C \quad \Rightarrow \quad C = 4
\]
Substituting \( C = 4 \) back into the general equation yields our unique particular solution:
\[
y = -2\sin^2 x + 4\sin^3 x
\]