Professional Documents
Culture Documents
Prepared By
Tareq Omar Mursi
Supervised By
Dr Farqad Talib Najim
1
Separable equations
2
Example: Solve dy + 1 y = 3 , with y(0) = 2.
dx 2 2
We first manipulate the differential equation to the form
dy 1
= (3 − y), (2.4)
dx 2
and then treat dy/dx as if it was a fraction to separate variables:
dy 1
= dx.
3−y 2
We integrate the right-side from the initial condition x = 0 to x and the left-
side from the initial condition y(0) = 2 to y. Accordingly,
y dy 1 x
Z = Z dx. (2.5)
2 3 − y 2 0
The integrals in (2.5) need to be done. Note that y(x) < 3 for finite x or the
integral on the left-side diverges. Therefore, 3 − y > 0 and integration
yields
y 1 x
− ln (3 − y) 2 = x
2
1
0 , ln (3 − y) =2−
x,
1
3 − y = e−2 x ,
21
y = 3 − e− x .
Since this is our first nontrivial analytical solution, it is prudent to check our
result. We do this by differentiating our solution:
dy 1 −2 1 x
dx = 2 e
1
= (3 − y);
2
and checking the initial conditions, y(0) =− 3 e0 = 2. Therefore, our
solution satisfies both the original ode and the initial condition.
Example: Solve dy + 1 y = 3 , with y(0) = 4.
dx 2 2
This is the identical differential equation as before, but with different initial
condi- tions. We will jump directly to the integration step:
Zy Z
dy 1 x
= dx.
4 3 − y 2 0
3
y
0
0 1 2 3 4 5 6 7
x
Figure 2.2: Solution of the following ode: dy + 1 y = 3 .
dx 2 2
The solution curves for a range of initial conditions is presented in Fig. 2.2.
All solutions have a horizontal asymptote at y = 3 at which dy/dx = 0. For
y(0) = y0, the general solution can be shown to be y(x) = 3 + (y0 − 3)
exp(−x/2).
Linear equations
The linear first-order differential equation (linear in y and its derivative) can
be written in the form
dy
+ p(x)y = g(x), (2.8)
dx
with the initial condition y(x0) = y0. Linear first-order equations can be
integrated using an integrating factor µ(x). We multiply (2.8) by µ(x),
dy
µ(x) d + p(x)y = µ(x)g(x),
x
−1
−1.2
−1.4
−1.6
0 0.5 1 1.5
x
Figure 2.3: Solution of the following ode: (3 + 2y)y′ = 2 cos 2x, y(0) = −1.
µ(x)y − µ0y0 Z
x
or =
µ(x)g(x)dx,
x0
1 x
y= µ0 0y + Z µ(x)g(x)dx . (2.12)
µ(x) x0
= − e−u0
2
1 2
= 1 − e−x .
2
Therefor
e,
1 2 2
y = 2 ex 1 − e−x
1 2
= 2 ex − 1 .
Second, we integrate by separating variables:
dy
− 2xy = x,
dx
dy
= x(1 + 2y),
dx
y dy x
Z = Z xdx,
10 1 + 0 1
ln (1 + 2y) = x2,
2 2
x2
1 + 2y = e ,
1 2
y = 2 ex − 1 .
The results from the two different solution methods are the same, and the
choice of method is a personal preference.