Problem Statement
Find the general solution of the differential equation:
$\frac{dy}{dx} + y \cot x = 2x + x^2 \cot x \quad (x \neq 0)$
Verified Solution & Marking Scheme
Identify standard linear form and find Integrating Factor (IF)
The given equation is of the standard linear form $\frac{dy}{dx} + P(x)y = Q(x)$ where:
$P(x) = \cot x, \quad Q(x) = 2x + x^2 \cot x$
$\text{I.F.} = e^{\int \cot x \, dx} = e^{\ln|\sin x|} = \sin x$
Multiply by IF and integrate
$y \cdot \sin x = \int (2x + x^2 \cot x) \sin x \, dx + C$
$y \sin x = \int 2x \sin x \, dx + \int x^2 \cos x \, dx + C$
Integrate the second term by parts
Integrate $\int x^2 \cos x \, dx$ by parts ($u = x^2, dv = \cos x dx$):
$\int x^2 \cos x \, dx = x^2 \sin x - \int 2x \sin x \, dx$
Substituting back into the equation:
$y \sin x = \int 2x \sin x \, dx + \left( x^2 \sin x - \int 2x \sin x \, dx \right) + C$
$y \sin x = x^2 \sin x + C$
Obtain General Solution
$y = x^2 + \frac{C}{\sin x} = x^2 + C \csc x$