dydx + ycot x = 4xcosec x
This is of the form dydx + P(x)y = Q(x)
and here P(x) = cot x, Q(x) = 4xcosec x
Integrating factor (IF) = e∫P(x)dx = e∫cot xdx = eln sin x = sin x
The solution for the differential equation is now given by
IF × y = ∫IF × Q(x)dx
∴ ysin x = ∫sin x × 4xcosec x dx
∴ ysin x = ∫4x dx = 2x² + c
Substituting the given condition : when x = π/2, y = 0, we get
0 = 2 × (π/2)² + c
∴ c = -π²/2
Solution: ysin x = 2x² - π²/2