Solution The given equation is a linear differential equation of the type 
P
Q
dy
dx +y
=
,
where P = cot x and Q = 2x + x2 cot x Therefore
I F = 
cot
log sin
sin
x dx
x
e
e
x
 
 
 
Hence, the solution of the differential equation is given by
y sin x = ∫(2x + x2 cot x) sin x dx + C
© NCERT
not to be republished
MATHEMATICS
412
or
y sin x = ∫ 2x sin x dx + ∫x2 cos x dx + C
or
y sin x =
2
2
2
2
2
sin
cos
cos
C
2
2
x
x
x
x
dx
x
x dx
⎛
⎞
⎛
⎞
−
+
+
⎜
⎟
⎜
⎟
⎝
⎠
⎝
⎠
∫
∫
or
y sin x =
2
2
2
sin
cos
cos
C
x
x
x
x dx
x
x dx
−
+
+
∫
∫
or
y sin x = x2 sin x + C