1
Chapter1. Ordinary Differential Equations
Physicists have a variety of reasons for studying differential equations: almost all the elementary and
numerous of the advanced parts of theoretical physics are posed mathematically in terms of differential
equations.
A differential equation is an equation for a function that relates the values of the function to the values of its
derivatives. Many real life problems can be formulated as differential equations. For example
𝑑2𝑦
𝑑𝑥2+ 2𝑥
𝑑𝑦
𝑑𝑥+ 𝑦 = sin(𝑥)
is a differential equation. Sometimes one uses shortened notations to write the same equation as
𝑦′′ + 2𝑥𝑦′ + 𝑦 = sin(𝑥)
or using the differential operator 𝐷 =𝑑𝑦
𝑑𝑥
𝐷2𝑦 + 2𝑥𝐷𝑦 + 𝑦 = sin(𝑥)
There are two classes of differential equations:
O.D.E. (ordinary differential equations): linear and non-linear; An ordinary differential equation
(ode) is a differential equation for a function of a single variable, e.g., 𝑥(𝑡),
P.D.E. (partial differential equations): A PDE equation is a differential equation for a function of
several variables, e.g., (𝑥, 𝑦, 𝑧, 𝑡). An ode contains ordinary derivatives and a pde contains partial
derivatives. Typically, pde’s are much harder to solve than ode’s.
For example,
𝑦′′ + 4𝑦′ + 𝑦 = 0
𝑦2 + 1 = 𝑥2y + sin(x)
are ordinary differential equations.
𝑢𝑥𝑥 + 𝑢𝑦𝑦 = 0
𝑢2𝑥 + 𝑢2
𝑦 = ln(𝑢)
are partial differential equations. (Partial Differential Equations are usually much more difficult).
1. Some concepts related to differential equations:
Order: The order of a differential equation is the order of the highest derivative that occurs in the equation.
A first order differential equation contains y0, y and x so it is of the form F(x; y; y0) = 0 or y0 = f(x; y).
For example, the following differential equations are first order:
𝑦′ = 𝑥2𝑦 + 𝑒𝑥
𝑥𝑦′ = (1 + 𝑦2)
𝑦′2 = 4𝑥𝑦 + cos(𝑥)
While these are second order:
𝑦′′ − 𝑥2𝑦′ + 𝑦 = 1 + sin(𝑥)𝑒𝑥
𝑦′′ + 6𝑦𝑦′ = (1 + 𝑥3)
2
General and Particular Solutions: A general solution of a differential equation involves arbitrary constants.
In a particular solution, these constants are determined using initial values.
As an example, consider the differential equation 𝑦′ = 2𝑥.
𝑦 = 𝑥2 + 𝑐 is a general solution,
𝑦 = 𝑥2 + 4 is a particular solution,
Example 1. Find the general solution of the differential equation 𝑦′′ = 0. Then, find the particular solution
that satisfies y(0) = 5; y’(0) = 3.
𝑦′′ = 0 → 𝑦′ = 𝑐 → 𝑦 = 𝑐𝑥 + 𝑑. 𝑇𝑖𝑠 𝑖𝑠 𝑡𝑒 𝑔𝑒𝑛𝑒𝑟𝑎𝑙 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛. 𝑦′ 0 = 3 → 𝑐 = 3, → 𝑦 0 = 5 → 𝑑 = 5 → 𝑡𝑢𝑠 𝑦 = 3𝑥 + 5
Therefore y = 3x + 5. This is the particular solution.
Explicit and Implicit Solutions: y = f(x) is an explicit solution, F(x; y) = 0 is an implicit solution. We have
to solve equations to obtain y for a given x in implicit solutions, whereas it is straight forward for explicit
solutions.
For example,
y = e4x
is an explicit solution of the equation y’= 4y.
x3
+ y3
= 1 is an implicit solution of the equation y2y’ + x
2 = 0.
It is much easier to verify that a function (given either implicitly or explicitly) is a solution of a given
differential equation.
What is a solution? Solution is a function that satisfied the equation and the derivatives exist.
Example 2: Verify that y(t) = eat
is a solution of the IVP (initial value problem)
y′ = ay, y(0) = 1.
Here y(0) = 1 is called the initial condition.
Let’s check if y(t) satisfies the equation and the initial condition:
y′ = aeat
= ay, y(0) = e0 = 1.
They are both OK. So it is a solution.
Example 3: Verify that y(t) = 10 – c e−t
with c a constant, is a solution to y′ + y = 10.
𝑦′ = − −𝑐𝑒−𝑡 = 𝑐𝑒−𝑡 , 𝑦′ + 𝑦 = 𝑐𝑒−𝑡 + 10 − 𝑐𝑒−𝑡 = 10, 𝑡𝑢𝑠 𝑖𝑡 𝑖𝑠 𝑣𝑒𝑟𝑖𝑓𝑖𝑒𝑑.
Example 4: Verify that 𝑦 = c1 sin 2𝑥 + c2 cos(2𝑥) is a solution of 𝑦′′ + 4𝑦 = 0.
Since the second derivative is involved, we differentiate y twice to get
and substituting these in the given equation,
3
Example 5: Verify that the function 𝑥2 = 2 𝑦2ln(𝑦) solves the equation 𝑦′ =𝑥𝑦
(𝑥2+𝑦2).
We differentiate both sides of the given solution to get
Linear or non-linear equations: Let y(t) be the unknown. Then,
𝑎0 𝑡 𝑦 𝑛 + 𝑎1 𝑡 𝑦
𝑛−1 + ⋯………………………… + 𝑎𝑛 𝑡 𝑦 = 𝑔 𝑡 (1)
is a linear equations. If the equation can not be written as Eq. 1, then it’s a non-linear.
Two things you must know: identify the linearity and order of an equation.
Example 6: Let y(t) be the unknown. Identify the order and linearity of the following equations.
2. First-order differential Equations
The general first-order differential equation for the function 𝑦 = (𝑥) is written as
𝑑𝑦
𝑑𝑥= 𝑓(𝑥, 𝑦) (2)
where 𝑓(𝑥, 𝑦) can be any function of the independent variable 𝑥 and the dependent variable 𝑦. We first show
how to determine a numerical solution of this equation, and then learn techniques for solving analytically
some special forms of (2), namely, separable, exact and linear first-order equations.
a) Separable equations:
A differential equation is said to be separable if it can be rewritten so that terms involving the differential of
y is on one side of the equation, and those of x on the other side. One then integrates to get rid of the
differentials leading to an equation that implicity or explicitly gives y. Thus,
g(y)dy = f(x)dx,
it is called a separable equation. We can find the solution by integrating both sides. (Don't forget the
integration constant!).
4
𝑔 𝑦 𝑑𝑦 = 𝑓 𝑥 𝑑𝑥 + 𝑐
Example 1: Solve the initial value problem 𝑦′ = 𝑥3𝑒−𝑦 , with 𝑦(1) = 0.
Example 2: Solve 𝑦2𝑦′ + 2𝑥 = 0.
Example 3: Find the particular solution of the equation 𝑦 ln 𝑦 𝑑𝑥 − 𝑥𝑑𝑦 = 0 such that when x = 1, y = 2.
Rewrite the equation as
5
b) Exact equations:
A first order equation can often be written in the form
M (x; y) dx + N (x; y) dy = 0
This equation is said to be exact if the left hand side is the differential of a function u(x; y) so that
𝜕𝑢(𝑥, 𝑦)
𝜕𝑥= 𝑀 𝑥, 𝑦 ,
𝜕𝑢(𝑥, 𝑦)
𝜕𝑦= 𝑁 𝑥, 𝑦 ,
In other words, 𝑑𝑢 = 𝑀𝑑𝑥 + 𝑁𝑑𝑦, so 𝑀𝑑𝑥 + 𝑁𝑑𝑦 is a total differential. For example, the equation
(4𝑥3 + 2𝑥𝑦2)𝑑𝑥 + (4𝑦3 + 2𝑦𝑥2)𝑑𝑦 = 0 is exact and
𝑢 𝑥, 𝑦 = 𝑥4 + 𝑥2𝑦2 + 𝑦4
So, the solution of this equation is very simple, if du is zero, u must be a constant, therefore
𝑐 = 𝑥4 + 𝑥2𝑦2 + 𝑦4
Hence, from the equations related with M and N, the condition
𝜕𝑀
𝜕𝑦=
𝜕𝑁
𝜕𝑥
is necessary and sufficient for the equation 𝑀(𝑥; 𝑦)𝑑𝑥 + 𝑁(𝑥; 𝑦)𝑑𝑦 = 0 to be exact.
Example 1: Solve the equation 3𝑦2𝑑𝑥 + (3𝑦2 + 6𝑥𝑦)𝑑𝑦 = 0
6
Example 2: Solve 2𝑥 sin(𝑦) 𝑑𝑦 + 𝑥2 cos(𝑦) 𝑑𝑦 = 0.
And
Integrating Factors
Consider the equation
𝑃 𝑑𝑥 + 𝑄 𝑑𝑦 = 0
that is not exact. If it becomes exact after multiplying by , i.e. if
(𝑥)𝑃𝑑𝑥 + (𝑥)𝑄𝑑𝑦 = 0
is exact, then is called an integrating factor. (Note that P, Q and are functions of x and y).
Example: Solve (2𝑥𝑒𝑥 − 3𝑦2)𝑑𝑥 + 2𝑦𝑑𝑦 = 0. Use integrating factor as 𝑒−𝑥 .
7
Now the equation is exact. We can solve it as we did the previous example and obtain the result
𝑥2 + 𝑦2𝑒−𝑥 = 𝑐
How to Find Integrating Factors?
The first-order linear differential equation (linear in 𝑦 and its derivative) can be written in the form
𝑦’ + 𝑝(𝑥)𝑦 = 𝑔(𝑥),
with the initial condition 𝑦(𝑥0) = 𝑦0. Linear first-order equations can be integrated using an integrating factor
(𝑥).
After mathematical calculation, the solution of above equation) satisfying the initial condition (𝑥0) = 𝑦0 is
then traditionally written as
Example 1: Solve 𝑑𝑦
𝑑𝑥+ 2𝑦 = 𝑒−𝑥 with 𝑦(0) = 3/4.
Note that this equation is not seperable. With 𝑝(𝑥) = 2 and 𝑔(𝑥) = 𝑒−𝑥 , we have
8
Example 2: Solve 𝑦’ + 𝑎𝑦 = 𝑏.
Example 3: Solve 𝑡𝑦’ + 2𝑦 = 4𝑡2 with initial condition 𝑦(1) = 2.
c) Bernoulli Equation:
The equation
𝑦′ + 𝑝 𝑥 𝑦 = 𝑔(𝑥)𝑦𝛼
is called Bernoulli equation. It is nonlinear. Nonlinear equations are usually much more difficult than linear
ones, but Bernoulli equation is an exception. It can be linearized by the substitution
𝑢 𝑥 = [𝑦(𝑥)]1−𝛼
Then, we can solve it as other linear equations.
Example: Solve the equation
9
3. Mathematical Modeling
Differential equations are the natural tools to formulate, solve and understand many engineering and
scientific systems. The mathematical models of most of the simple systems are differential equations. The
simplest ordinary differential equations can be integrated directly by finding antiderivatives.
Example 1: Malthus' law of population Dynamics;
We all know that population grows in general, but how fast does the population of a city grow? What will
the population of the US be in 2025? Questions of this kind have been of interest to many scientists and the
first person to propose a mathematical law was Rev. Thomas Robert Malthus, an English clergy man who
laid out his findings in his 1798 writings. Malthusian law says:
“The rate of change of population is proportional to the actual population at any given time.”
Notice that this law is very similar in nature to Newton's law. Both laws predict that the rate of change of a
quantity is in some sense proportional to the quantity remaining at a given time. The only difference is that
Newton's law has to do with the decrease in heat while Malthus law has to do with increase in population.
Let the population at a given time t0 be P0 and at any time t later be P(t). Then according to Malthus law,
𝑑𝑃
𝑑𝑡∝ 𝑃
If k is the constant of proportionality, the above equation becomes
𝑑𝑃
𝑑𝑡= 𝑘𝑃
This is a very simple equation whose solution is 𝑙𝑛 𝑃 = 𝑘 𝑡 + 𝑐, where c is the constant of integration.
Using the initial condition that at t = t0; P = P0, we get
𝑙𝑛 𝑃0 = 𝑘 𝑡0 + 𝑐 We can then write the solution as
𝑙𝑛 𝑃 = 𝑘 𝑡 + 𝑙𝑛 𝑃0 − 𝑘 𝑡0
𝑙𝑛 𝑃 = 𝑘(𝑡 − 𝑡0) + 𝑙𝑛 𝑃0
that is,
𝑃 = 𝑃0𝑘(𝑡−𝑡0)
** The world population in 1965 and in 1970 was 3.345 billions and 3.706 billions, respectively. What was
the population in 1973?
Solution: From equation (2.19), using the data for 1965 and 1970,
10
To find the population in 1973, we have that
The actual population of the world in 1973 was 3.937 billions!
Example 2: Newton’s Law of motion.
Consider a mass falling under the influence of constant gravity, such as approximately found on
the Earth’s surface. Newton’s law, 𝐹 = 𝑚𝑎, results in the equation
where 𝑥 is the height of the object above the ground, 𝑚 is the mass of the object, and 𝑔 = 9.8 meter/sec2 is
the constant gravitational acceleration. Find the height as a function of time if the initial height is y0 and
initial speed is v0.
Here, the right-hand-side of the ode is a constant. The first integration, obtained by antidifferentiation, yields
where 𝐴 is the constant of integration, and the second integration gives
with 𝐵 another constant of integration. The two constants of integration 𝐴 and 𝐵 can be determined from
initial conditions. If we know that the initial height of the mass is 𝑥0, and the initial velocity is 𝑣0, then the
correct initial conditions are
Substitution of these initial conditions into the equations for 𝑑𝑥/𝑑𝑡 and 𝑥 allows us to solve for 𝐴 and 𝐵 to
determine the unique solution that satisfies both the ode and the initial conditions:
11
Example 3: Exponential growth/decay.
Assume the rate of change of Q(t) is proportional to the quantity at time t. We can write
where r is the rate of growth/decay and Q(t) is the amount of quantity at time t.
If r > 0: exponential growth
If r < 0: exponential decay
Differential equation:
Here r is called the growth rate. By IC, we get Q(0) = C = Q0.
The solution is
Two concepts:
• Doubling time TD (only if r > 0): is the time that Q(TD) = 2Q0.
• Half life (or half time) TH (only for r < 0): is the time that Q(TH) = (½) Q0.
.
Note here that TH > 0 since r < 0.
NB! TD, TH do not depend on Q0. They only depend on r.
Example:
A radio active material is reduced to 1/3 after 10 years. Find its half life.
Model: 𝑑𝑄/𝑑𝑡 = 𝑟𝑄, r is rate which is unknown. We have the solution 𝑄(𝑡) = 𝑄0𝑒𝑟𝑡 . So
𝑄 10 = 𝑄0𝑒𝑟𝑡 =
𝑄0
3, 𝑄0𝑒
10𝑟 =𝑄0
3, 𝑟 = −
ln 3
10
To find the half life, we only need the rate r
𝑇𝐻 = −ln 2
𝑟= − ln 2
10
−ln 3= 10
ln 2
ln 3
12
Review Examples
1.
2.
3.
13
4.
14
Exercises
1. Show that the equation is exact, and obtain its general solution. Also, find the particular solution
corresponding to the given initial condition as well.
Ans:
2. Obtain the general solution, using the methods of this section.
Ans: a) x
2-2xy – y
2 = C
3. Use separation of variables to find the general solution.
Ans:
4. Solve y’ = (3x
2 - 1)/(2y), subject to the given initial condition a) y(0) = -3, b) y(0) = -1, c) y(4) = 5,
d) y(-1)=0.
Ans:
5. Solve x y' + y= 6x2 subject to the given initial condition a) y(1) = 0 and b) y(-3) = 18, using any
method of this section.
Ans: a) y(x) = 2x2 – 2/x, b) y(x) = 2x
2
15
6. Solve the problems in the course books.
References:
1. Greenberg, M.D. Advanced Engineering Mathematics, 2nd edition. Prentice Hall, 1998.
2. O'Neil, P.V. Advanced Engineering Mathematics, 5th edition. Thomson, 2003.
3. Ross, S.L. Introduction to Ordinary Differential Equations, 4th edition. Wiley, 1989.