62 Ordinary Differential Equations
EXAMPLE 3 Solving an IVP Using Separation of Variables
Solve the initial value problem
(18) y' = xy + 2x; y(O) = 3.
SOLUTION
Writing the derivative y' as the ratio of differentials, dy / dx, and factoring.
the right-hand side of the differential equation in (18), we obtain the equivalent
equation
dy
dx = x(y + 2).
Multiplying by dx and dividing by (y + 2) , we get
Integration yields
dy
--= xdx, provided y =f. -2.
y+2
J y; 2 = J xdx
and then the implicit solution
x2
ln IY + 21 =
2
+ C , provided y =f. -2
and where C is an arbitrary constant. Exponentiating, we find
Both the left-hand side and the right-hand side of (19) are positive. Since
IY + 21 = ±(y + 2) and e^0 is an arbitrary positive constant, we may remove
the absolute value appearing in equation (19), if we replace ec by a new
arbitrary constant K which may be positive or negative. Doing so, we obtain
the following solution of the differential equation y' = xy + 2x :
y + 2 = Kex2/2
where K =f. 0. Noting that y = -2 is a particular solution of the differential
equation y' = xy + 2x, we can remove the restriction K =f. 0 and obtain the
explicit solution of y' = xy + 2x
(20)