Solution The given differential equation can be written as
dx
x
dy
−y
 = 2y
This is a linear differential equation of the type 
1
1
P
Q
dx
x
dy +
=
, where 1
1
P
= −y
 and
Q1 = 2y Therefore 
1
1
log
log( )
1
I F
dy
y
y
y
e
e
e
y
−
−
−
=∫
=
=
=
Hence, the solution of the given differential equation is
1
x y   =
1
(2 )
C
y
⎛ydy
⎞
+
⎜
⎟
⎝
⎠
∫
or
x
y  =
(2
)
dy +C
∫
or
x
y  = 2y + C
or
x = 2y2 + Cy
which is a general solution of the given differential equation Example 22 Find the particular solution of the differential equation
cot 
dy+
y
x
dx
 = 2x + x2 cot x (x ≠ 0)
given that y = 0 when 
2
x
=π