Second-Order Ordinary Differential Equations
Jonathan Winston L. Salvacion, Dr. Eng’g.1
August 27, 2024
1
Mapúa University
Outline
Learning Objectives
Homogeneous ODEs of Second Order
Homogeneous Linear ODEs with Constant Coefficients
Nonhomogeneous ODEs
Euler-Cauchy Equations
Learning Objectives
Homogeneous ODEs of Second
Order
Homogeneous Linear ODEs of Second Order
Definition: Second-order ODE that can be written in the form
d 2y dy
+ P(x) + Q(x)y = R(x)
dx 2 dx
Homogeneous Linear ODEs of Second Order
Definition: Second-order ODE that can be written in the form
d 2y dy
+ P(x) + Q(x)y = R(x)
dx 2 dx
This is the so-called “standard form”.
Homogeneous Linear ODEs of Second Order
Definition: Second-order ODE that can be written in the form
d 2y dy
+ P(x) + Q(x)y = R(x)
dx 2 dx
This is the so-called “standard form”.
If R(x) = 0, then the differential equation is said to be
homogeneous.
Homogeneous Linear ODEs
with Constant Coefficients
Homogeneous Linear ODE with Constant Coefficients
ODE of the form
d 2y dy
2
+a + by = 0
dx dx
where a, b are constants.
We make a trial solution
y = e λx
We make a trial solution
y = e λx
Then,
dy d 2x
= λe λx , = λ2 e λx
dx dy 2
We make a trial solution
y = e λx
Then,
dy d 2x
= λe λx , = λ2 e λx
dx dy 2
Thus, the original differential equation becomes
λ2 e λx + aλe λx + be λx = 0
We make a trial solution
y = e λx
Then,
dy d 2x
= λe λx , = λ2 e λx
dx dy 2
Thus, the original differential equation becomes
λ2 e λx + aλe λx + be λx = 0
or
(λ2 + aλ + b)e λx = 0
We make a trial solution
y = e λx
Then,
dy d 2x
= λe λx , = λ2 e λx
dx dy 2
Thus, the original differential equation becomes
λ2 e λx + aλe λx + be λx = 0
or
(λ2 + aλ + b)e λx = 0
So for e λx to be a solution,
λ2 + aλ + b = 0
λ2 + aλ + b = 0
This is the characteristic or auxiliary equation.
λ2 + aλ + b = 0
The roots of this equation provide us the general solutions. There
are three cases according as a2 − b is positive, zero, or negative.
Case Roots General Solution
Distinct real
I y = C1 e λ1 x + C2 e λ2 x
λ1 , λ2
Real double root
II y = (C1 + C2 x)e −ax/2
λ = − 12 a
Complex Conjugate
λ1 = − 12 a + iω
III y = e −ax/2 (A cos ωx + B sin ωx
λ2 = − 12 a − iω
ω = b − 41 a2
Exercises
Solve the following differential equations:
1. y ′′ − 5y ′ + 6y = 0
2. y ′′ + 4y = 0
3. y ′′ − 2y ′ + y = 0
4. y ′′ + 2y ′ + 5y = 0
5. y ′′ + 3y ′ − 4y = 0
Nonhomogeneous ODE
Nonhomogeneous ODE of Second Order
Definition: Second-order ODE that can be written in the form
d 2y dy
2
+ P(x) + Q(x)y = R(x)
dx dx
with R(x) ̸= 0.
Solution of the Linear ODE of Second Order
The solution of the nonhomogeneous equation
d 2y dy
2
+ P(x) + Q(x)y = R(x)
dx dx
Solution of the Linear ODE of Second Order
The solution of the nonhomogeneous equation
d 2y dy
2
+ P(x) + Q(x)y = R(x)
dx dx
is the sum of the solution yh (x) of the homogeneous equation
d 2y dy
2
+ P(x) + Q(x)y = 0
dx dx
Solution of the Linear ODE of Second Order
The solution of the nonhomogeneous equation
d 2y dy
+ P(x) + Q(x)y = R(x)
dx 2 dx
is the sum of the solution yh (x) of the homogeneous equation
d 2y dy
2
+ P(x) + Q(x)y = 0
dx dx
and a particular solution yp (x).
Solution of the Linear ODE of Second Order
The solution of the nonhomogeneous equation
d 2y dy
+ P(x) + Q(x)y = R(x)
dx 2 dx
is the sum of the solution yh (x) of the homogeneous equation
d 2y dy
2
+ P(x) + Q(x)y = 0
dx dx
and a particular solution yp (x).
That is, the general solution is
y (x) = yh (x) + yp (x)
Second-Order Linear ODEs
General Form:
ay ′′ (x) + by ′ (x) + cy (x) = f (x)
▶ a, b, and c are constants.
▶ f (x) is a non-homogeneous term.
▶ The goal is to find the general solution y (x) = yh (x) + yp (x).
Homogeneous Solution yh (x)
Associated Homogeneous Equation:
ay ′′ (x) + by ′ (x) + cy (x) = 0
▶ Solve the characteristic equation:
ar 2 + br + c = 0
▶ The solution yh (x) depends on the roots r1 and r2 .
▶ Cases: Real and distinct roots, real and repeated roots, or
complex roots.
Method of Undetermined Coefficients
Basic Idea:
▶ Assume a form for the particular solution yp (x) based on f (x).
▶ The form is chosen to include undetermined coefficients.
▶ Substitute yp (x) into the ODE and solve for the coefficients.
Common Forms for f (x) and yp (x)
f (x) Form of yp (x)
Polynomial x n xn
An + . . . + A1 x + A0
Exponential e αx Ae αx
Sine/Cosine sin(βx) or cos(βx) A sin(βx) + B cos(βx)
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Steps:
1. Solve the homogeneous equation: yh (x).
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Steps:
1. Solve the homogeneous equation: yh (x).
The characteristic equation is
r 2 − 3r + 2 = 0
with roots r1 = 1 and r2 = 2.
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Steps:
1. Solve the homogeneous equation: yh (x).
Homogeneous solution:
yh (x) = C1 e x + C2 e 2x
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Steps:
1. Solve the homogeneous equation: yh (x).
Homogeneous solution:
yh (x) = C1 e x + C2 e 2x
2. Assume a particular solution yp (x) = Axe 2x .
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Steps:
1. Solve the homogeneous equation: yh (x).
Homogeneous solution:
yh (x) = C1 e x + C2 e 2x
2. Assume a particular solution yp (x) = Axe 2x .
3. Substitute yp (x) into the ODE and solve for A.
4Ae 2x + 4Axe 2x − 3 Ae 2x + 2Axe 2x + 2 Axe 2x = e 2x
which gives A = 1 so that
yp (x) = Axe 2x
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Steps:
1. Solve the homogeneous equation: yh (x).
Homogeneous solution:
yh (x) = C1 e x + C2 e 2x
2. Assume a particular solution yp (x) = Axe 2x .
3. Substitute yp (x) into the ODE and solve for A.
yp (x) = Axe 2x
Example 1: f (x) = e 2x
Given:
y ′′ − 3y ′ + 2y = e 2x
Steps:
1. Solve the homogeneous equation: yh (x).
Homogeneous solution:
yh (x) = C1 e x + C2 e 2x
2. Assume a particular solution yp (x) = Axe 2x .
3. Substitute yp (x) into the ODE and solve for A.
yp (x) = Axe 2x
Solution:
y (x) = C1 e x + C2 e 2x + xe 2x
Example 2: f (x) = x 2
Given:
y ′′ + 4y ′ + 4y = x 2
Steps:
1. Solve the homogeneous equation: yh (x).
2. Assume a particular solution yp (x) = Ax 2 + Bx + C .
3. Substitute yp (x) into the ODE and solve for A, B, and C .
Solution:
1 1 3
y (x) = (C1 + C2 x)e −2x + x 2 − x +
4 2 8
Example 3: f (x) = cos(2x)
Given:
y ′′ + y = cos(2x)
Steps:
1. Solve the homogeneous equation: yh (x).
2. Assume a particular solution yp (x) = A cos(2x) + B sin(2x).
3. Substitute yp (x) into the ODE and solve for A and B.
Solution:
1
y (x) = C1 cos(x) + C2 sin(x) + cos(2x)
3
Summary
▶ The method of undetermined coefficients is effective for
solving non-homogeneous linear ODEs when f (x) has a
specific form.
▶ Key steps: Find yh (x), assume yp (x), and solve for
coefficients.
▶ Practice with different forms of f (x) to master the technique.
Exercises
Solve the following differential equations:
1. y ′′ − 3y ′ + 2y = e x
2. y ′′ + y ′ − 6y = 3x
3. y ′′ + 4y = cos(2x)
4. y ′′ − 2y ′ + y = xe x
5. y ′′ + 4y ′ + 4y = e −2x
Introduction
Problem: Solve the non-homogeneous second-order linear ODE
ay ′′ (x) + by ′ (x) + cy (x) = f (x)
Goal: Find the particular solution yp (x) using variation of
parameters.
▶ This method is applicable when f (x) is not easily handled by
undetermined coefficients.
▶ Requires the solution of the corresponding homogeneous
equation.
Homogeneous Solution yh (x)
Associated Homogeneous Equation:
ay ′′ (x) + by ′ (x) + cy (x) = 0
▶ Solve the characteristic equation:
ar 2 + br + c = 0
▶ The solution yh (x) = C1 y1 (x) + C2 y2 (x) where y1 (x) and
y2 (x) are linearly independent solutions.
Method of Variation of Parameters
Assume:
yp (x) = u1 (x)y1 (x) + u2 (x)y2 (x)
where u1 (x) and u2 (x) are functions to be determined.
▶ Differentiate yp (x):
yp′ (x) = u1′ (x)y1 (x) + u1 (x)y1′ (x) + u2′ (x)y2 (x) + u2 (x)y2′ (x)
▶ Impose the condition u1′ (x)y1 (x) + u2′ (x)y2 (x) = 0 to simplify.
▶ The simplified expression is then substituted into the ODE.
Solving for u1′ (x) and u2′ (x)
Resulting System:
u1′ (x)y1 (x) + u2′ (x)y2 (x) = 0
f (x)
u1′ (x)y1′ (x) + u2′ (x)y2′ (x) =
a
Solve:
f (x)
u1′ (x) = −y2 (x)
W [y1 , y2 ]
f (x)
u2′ (x) = y1 (x)
W [y1 , y2 ]
where W [y1 , y2 ] = y1 (x)y2′ (x) − y1′ (x)y2 (x) is the Wronskian.
Finding the Particular Solution yp (x)
Integrate:
Z Z
f (x) f (x)
u1 (x) = − y2 (x) dx, u2 (x) = y1 (x) dx
W [y1 , y2 ] W [y1 , y2 ]
Thus, the particular solution is:
Z Z
f (x) f (x)
yp (x) = −y1 (x) y2 (x) dx + y2 (x) y1 (x) dx
W [y1 , y2 ] W [y1 , y2 ]
Example 1: f (x) = e 3x
Given:
y ′′ − 4y ′ + 4y = e 3x
Steps:
1. Solve the homogeneous equation: yh (x) = (C1 + C2 x)e 2x .
2. Find the Wronskian: W [y1 , y2 ].
3. Compute u1 (x) and u2 (x).
4. Substitute to find yp (x).
Solution:
1
y (x) = (C1 + C2 x)e 2x + xe 3x
4
Example 2: f (x) = sin(2x)
Given:
y ′′ + y = sin(2x)
Steps:
1. Solve the homogeneous equation:
yh (x) = C1 cos(x) + C2 sin(x).
2. Find the Wronskian: W [y1 , y2 ] = 1.
3. Compute u1 (x) and u2 (x).
4. Substitute to find yp (x).
Solution:
1
y (x) = C1 cos(x) + C2 sin(x) − x cos(2x)
2
Example 3: f (x) = ln(x)
Given:
x 2 y ′′ + xy ′ − y = ln(x)
Steps:
1. Solve the homogeneous equation: yh (x) = C1 x + C2 x −1 .
2. Find the Wronskian: W [y1 , y2 ] = −2.
3. Compute u1 (x) and u2 (x).
4. Substitute to find yp (x).
Solution:
1 1
y (x) = C1 x + C2 x −1 + x ln(x) + x
2 4
Summary
▶ The method of variation of parameters is a powerful tool for
solving non-homogeneous linear ODEs.
▶ It requires solving the homogeneous equation first and then
finding particular solutions using the Wronskian.
▶ This method is versatile and works for a wide range of f (x)
functions.
Euler-Cauchy Equations
Introduction
Definition: An Euler-Cauchy equation is a type of linear
differential equation with variable coefficients, typically in the form:
x 2 y ′′ (x) + axy ′ (x) + by (x) = 0
▶ a and b are constants.
▶ y (x) is the unknown function.
▶ Often used in problems with power-law solutions.
Solution Method
Assume: A solution of the form y (x) = x r .
▶ Substitute into the equation to find the characteristic
equation:
r (r − 1) + ar + b = 0
▶ Solve the characteristic equation to find the roots r1 and r2 .
▶ The nature of the roots determines the form of the general
solution.
Case 1: Distinct Real Roots
If r1 ̸= r2 :
y (x) = C1 x r1 + C2 x r2
▶ Example: Consider the equation x 2 y ′′ − 3xy ′ + 4y = 0.
▶ Characteristic equation: r 2 − 4r + 4 = 0 gives roots r1 = 2,
r2 = 2.
▶ Solution: y (x) = C1 x 2 + C2 x 2 ln(x).
Case 2: Repeated Real Roots
If r1 = r2 = r :
y (x) = (C1 + C2 ln(x))x r
▶ Example: Consider x 2 y ′′ + 3xy ′ + y = 0.
▶ Characteristic equation: r (r + 2) + 1 = 0 gives a repeated
root r = −1.
▶ Solution: y (x) = (C1 + C2 ln(x))x −1 .
Case 3: Complex Roots
If roots are complex r1 , r2 = α ± βi:
y (x) = x α (C1 cos(β ln(x)) + C2 sin(β ln(x)))
▶ Example: Consider x 2 y ′′ + 5xy ′ + 6y = 0.
▶ Characteristic equation: r 2 + 5r + 6 = 0 gives roots r1 = −2,
r2 = −3.
▶ Solution: y (x) = C1 x −2 + C2 x −3 .
Example 1: x 2 y ′′ − xy ′ + y = 0
Given:
x 2 y ′′ − xy ′ + y = 0
Solution:
▶ Characteristic equation: r (r − 1) − r + 1 = 0 simplifies to
r 2 = 0.
▶ Roots: r = 0 (repeated root).
▶ General solution: y (x) = C1 + C2 ln(x).
Example 2: x 2 y ′′ + 4xy ′ + 4y = 0
Given:
x 2 y ′′ + 4xy ′ + 4y = 0
Solution:
▶ Characteristic equation: r (r − 1) + 4r + 4 = 0.
▶ Roots: r = −2 (repeated root).
▶ General solution: y (x) = (C1 + C2 ln(x))x −2 .
Summary
▶ Euler-Cauchy equations are second-order linear ODEs with
variable coefficients.
▶ The solution involves finding the roots of the characteristic
equation.
▶ The general solution form depends on whether the roots are
real and distinct, repeated, or complex.
Questions?
Thank you!
Questions?