\(\cfrac{dy}{dx}\) + y cot x = x2 cot x + 2x ........ (1)
This is the linear differential equation of the form
\(\cfrac{dy}{dx}\) + Py = Q, where P = cot x and Q = x2 cot x + 2x
∴ I.F. = e∫ Pdx
= e∫ cot xdx
= elog(sin x)
= sin x
∴ the solution of (1) is given by
y(I.F.) = ∫Q . (I.F.) dx + c
∴ y sin x = ∫(x2 cot x + 2x) sin x dx + c
∴ y sin x = ∫(x2 cot x . sin x + 2x sin x) dx + c
∴ y sin x = ∫x2 cos x dx + 2∫x sin x dx + c
∴ y sin x = x2 ∫cos x dx – ∫[\(\cfrac{d}{dx}\)(x2) ∫cos x dx] dx + 2∫x sin x dx + c
∴ y sin x = x2 (sin x) – ∫2x(sin x) dx + 2∫x sin x dx + c
∴ y sin x = x2 sin x – 2∫x sin x dx + 2∫x sin x dx + c
∴ y sin x = x2 sin x + c
∴ y = x2 + c cosec x
This is the general solution.