Professional Documents
Culture Documents
More Second Order ODE PDF
More Second Order ODE PDF
1
ODEs with variable coefficients
The “ease” with which a linear ODE with constant coefficients was solved does not usually
apply to linear ODEs with variable coefficients. However, there is one important type of
ODE with variable coefficients whose general solution can by expressed in terms of
elementary functions.
Euler-Cauchy equations
Notice that the power of the x coefficient matches the order of the derivative.
d2y dy
x2 2
+ ax + by = 0 where a and b are constants.
dx dx
NOTE: This is still a linear ODE since division by x2 (≠ 0) gives the standard linear form
d 2 y a dy b
+ + y = 0.
dx 2 x dx x 2
To solve an Euler-Cauchy equation, consider the first order equation of this type
dy
x + ay = 0 (with x > 0 for convenience).
dx
a
dy a ∫ dx
+ y= 0 ⇒ µ ( x) = e x
= e a ln x = x a so
dx x
x a y=
( x) ∫ x a × 0 dx
y ( x) = Cx − a .
The solution is of the form y ( x) = x m where m is a constant determined by the ODE. Similar
to the constant coefficient case studied previously, we consider a solution of this form for the
second order Euler-Cauchy equation.
y = xm ⇒ y ′ = mx m −1 and y ′′ = m(m − 1) x m − 2 .
d2y dy
Assuming x > 0 , substituting into x 2 2
+ ax + by = 0 gives
dx dx
2
x 2 m(m − 1) x m − 2 + axmx m −1 + bx m = 0
m(m − 1) x m + amx m + bx m = 0 ( x ≠ 0)
x [m(m − 1) + am + b] = 0
m
so m(m − 1) + am + b = 0 .
This is called the auxiliary equation. Once again, the solution can have three possible
forms.
d2y dy
The solutions of x 2 2 + ax + by = 0 will then take three corresponding forms.
dx dx
Case 1: real, distinct roots, so m1 ≠ m2 .
The general solution can be written as y ( x) = c1 x + c2 x
m1 m2
.
NOTE: The absolute value signs are needed if x is not necessarily always positive but can be
removed if x > 0 . Also, the derivation of the auxiliary equation assumes x ≠ 0 but the form
of the final answer will indicate whether x = 0 is allowed. The same is true for the following
cases.
Example:
d2y dy
Find the general solution of x 2 2
+ 2 x − 6 y = 0, ( x > 0) .
dx dx
Example:
d2y
Find the general solution of 4 x 2 + y = 0.
dx 2
(NOTE: We can use the auxiliary equation in the form cm(m − 1) + am + b =0)
=c 4,=
a 0,=
b 1 gives 4m(m − 1) + 0m + 1 =0 so
1
4m 2 − 4m + =
1 0 ⇒ (2m − 1)=
2
0 ⇒ m=
2
3
Case 3: complex conjugate roots, so m1 = α + iβ and m2 = α − iβ .
The general solution can be written as y ( x) = x
α
[A cos(β ln x ) + B sin (β ln x )] .
Example:
c = 2, a = 4, b = 1 ⇒ 2m(m − 1) + 4m + 1 = 0
−2 ± 4 − 8 1 1
⇒ 2m 2 + 2m + 1 =⇒
0 m= ⇒ m=
− ± i
4 2 2
1 1
so α = − , β = and the general solution is
2 2
−
1
1 1
= y ( x) x 2 A cos ln x + B sin ln x .
2 2
NOTE: The general formulae for these cases are actually very similar to those for the
constant coefficient cases studied previously. If those formulae are known then the Euler-
Cauchy formulae can be written down by using the replacement x → ln x (so e kx → x k ).
Variation of parameters
(more complex mathematics but more generally applicable)
This method finds particular solutions for linear ODEs with more general r (x) functions than
the previous method. Consider the general second order non-homogeneous ODE
y ′′ + p ( x) y ′ + q ( x) y = r ( x) .
We know that the corresponding homogeneous equation will have a solution of the form
=
yh ( x) c1 y1 ( x) + c2 y2 ( x) .
The method of variation of parameters involves replacing the constants with functions, i.e.
y p ( x) = µ ( x) y1 ( x) + ν ( x) y 2 ( x) .
In order to find the two unknown functions µ ( x), ν (x) we need to establish two conditions.
Only one condition can be obtained from knowing that yp(x) is a solution of the ODE.
Using the product rule, differentiation gives y ′p = µ ′ y1 + µ y1′ + ν ′ y2 + ν y2′ . To simplify this
we can set the additional condition that µ ′y1 + ν ′y 2 = 0 so
y ′p = µy1′ + νy 2′
4
The ODE becomes (µ ′y1′ + µy1′′ + ν ′y 2′ + νy 2′′ ) + p ( x)(µy1′ + νy 2′ ) + q ( x)(µy1 + νy 2 ) = r ( x)
Since y1 and y 2 are solutions of the homogeneous ODE the first two brackets are equal to 0.
We now have two equations for the unknown functions µ (x) and ν (x)
µ ′y1 + ν ′y 2 = 0
µ ′y1′ + ν ′y 2′ = r ( x).
0 y2 y1 0
r y 2′ − y2 r y′ r yr
µ′ = = and n′ = 1 = 1
y1 y 2 W y1 y 2 W
y1′ y 2′ y1′ y 2′
y1 y2
where W = is called the Wronskian of y1 and y 2 .
y1′ y2′
− y2 r y1 r
So, =µ ∫=
W
dx and n ∫
W
dx .
The particular solution of a non-homogeneous linear ODE can then be found from
− y2 r yr
y p ( x) = µ y1 + ν y2 = ∫ dx y1 + ∫ 1 dx y2
W W
and the general solution of the ODE is = y ( x) yh ( x) + y p ( x) as usual.
NOTE: To obtain the correct r (x) function, the coefficient of y ′′ in the ODE must be first
made equal to 1.
Examples:
1. Solve y ′′ + y =
sec x .
= =
Let y1 cos x and y2 sin x
y1 y2 cos x sin x
W = = = cos 2 x + sin 2 x = 1
y1′ y2′ − sin x cos x
5
yr y1 r
∫ − dx
µ= n ∫ W dx
=
2
W
sin x.sec x cos x sec x
=∫ − 1 dx ∫
=
1
dx
= ∫ −
sin x
dx = ∫ 1dx
cos x
= ln= cos x x.
2. Solve x 2 y ′′ − xy ′ + y = x ln x .
1 1 ln x
In standard form: y ′′ − y′ + 2 y = = r ( x) .
x x x
For yh : m(m --
1) m + 1 = 0 ⇒ m 2 - 2m + 1 = 0 ⇒ m = 1,1 ⇒ yh = c1 x + c2 x ln x.
Let y1 = x, y 2 = x ln x, so
x x ln x
W= = x ln x + x − x ln x = x.
1 ln x + 1
ln x ln x
x ln x . x.
y p = ∫ − x dx x ln x
∫
x dx x +
x x
(ln x) 2 ln x
= ∫ − dx x + ∫ dx x ln x
x x
1 1
= − (ln x) 3 x + (ln x) 2 x ln x
3 2
1 1 1
y p = − x (ln x) 3 + x(ln x) 3 = x(ln x) 3
3 2 6
1
∴ y ( x) = c1 x + c 2 x ln x + x(ln x) 3 .
6
6
Power series
∞
A power series about x = 0 is a series of the form ∑a
n =0
n x n = a 0 + a1 x + a 2 x 2 + a3 x 3 + ... .
Examples:
x 2 x3 x 4
e x =+
1 x+ + + + ...
2! 3! 4!
x2 x4 x6
cos x =−
1 + − + ...
2! 4! 6!
x3 x5 x 7
sin x =x − + − + ...
3! 5! 7!
We have previously seen how polynomial, exponential and trigonometric functions (the
elementary functions) can arise as solutions to ODEs. So, these solutions could also have
been expressed in terms of power series. More importantly, some ODEs have powers series
solutions that cannot be expressed in terms of elementary functions.
A real function f (x) is said to be analytic at the point x = 0 if it has a power series
representation about x = 0 with a radius of convergence R > 0 .
y ′′ + p ( x) y ′ + q ( x) y = r ( x) ,
if p (x), q (x) and r (x) are analytic at x = 0 then every solution of this ODE is also analytic
at x = 0 (i.e. every solution will have a power series representation with a radius of
convergence R > 0 ). This is also true if the leading coefficient is a function h(x) where
h(0) ≠ 0.
Examples:
p ( x=
) x2 q ( x=
) ( x − 1)
Both are analytic at x = 0 (why?), so all solutions exist in the form of a power series.
2. For xy ′′ + x 2 y ′ + y = 0 ,
x2 1
p ( x=
) = x q ( x=
)
x x
7
NOTE: For a second order linear ODE this theorem guarantees two linearly independent
power series solutions.
Example:
(Note: This ODE does not fit the pattern of any that we have considered so far.)
p( x) = 0 q ( x) = −2 x
0 = 0 + 0x + 0 x2 + 0 x3 + ...
Ignoring the sigma notation for the moment, adding the terms of the last two rows and
equating coefficients of powers of x with those of the RHS of the ODE (all 0 in this case)
leads to:
=
2a2 0 ⇒=
a2 0
1
6a3 − 2a0 = 0 ⇒ a3 = a0
3
1
12a4 − 2a1 = 0 ⇒ a4 = a1
6
a
20a5 − 2a2 =0 ⇒ a5 = 2 =0
10
Hence, the series solution can be written as:
y ( x) = a 0 + a1 x + a 2 x 2 + a3 x 3 + ...
1 1
= a 0 + a1 x + a 0 x 3 + a1 x 4 + ... or
3 6
1 1
y ( x) = a 0 (1 + x 3 + ...) + a1 ( x + x 4 + ...).
3 6
Notice that there are two linearly independent solutions, each multiplied by an arbitrary
constant so this is the general solution.
8
Alternatively, sigma notation could be used as follows. Sigma notation is mathematically
“neater”, though it can look a little forbidding at first. Either method may be used in
exercises.
∞ ∞
=
y ′′ − 2 xy=
n 2=n 0
∑ n(n − 1)an x n−2 − 2∑ an x n+1
∞ ∞
=k 0=k 1
∑ (k + 2)(k + 1)ak +2 x k − 2∑ ak −1 x k
= (k =−
n 2 in first sum, k =+
n 1 in second)
∞ ∞
= 2a2 + ∑ (k + 2)(k + 1)ak + 2 x k − 2∑ ak −1 x k (make powers and start values the same)
=k 1=k 1
∞
= 2a2 + ∑ ( (k + 2)(k + 1)ak + 2 x k − 2ak −1 x k )
k =1
∞
= 2a2 + ∑ ( (k + 2)(k + 1)ak + 2 − 2ak −1 ) x k =0.
k =1
Notice that k is a dummy variable which does not really appear when the series is written
out in full. That is why it can be changed to two different values ( n − 2 and n + 1 ) in the
same equation. In fact, we could even change back to n in the third line above. The process
illustrated in this example aligns the series (same powers of x and same starting values for k).
Once this is done, equating coefficients of powers of x (all 0 on the RHS) gives 2a 2 = 0 and
(k + 2)(k + 1)a k + 2 − 2a k −1 = 0 for k = 1,2,... . This formula can be written as a recurrence
relation for the highest k value in terms of lower k values:
2a k −1
ak +2 = ( k = 1,2,... )
(k + 2)(k + 1)
which leads to the same values for the coefficients as found earlier (try it!).
We can also obtain the power series solution for a non-homogeneous equation. For a non
homogeneous equation write the function on the right hand side in terms of a power series
and then equate the coefficients of equivalent powers of x on both sides of the equation. The
coefficients on the right will now not all be zero.
9
Example:
Solve y ′′ + xy =
1 using power series.
∞
=y a0 + a1 x + a2 x 2 + a3 x3 +=
... ∑a x
n =0
n
n
∞
y′
= a1 + 2a2 x + 3a3 x 2 + 4a4 x 3 +=
... ∑ na x
n =1
n
n −1
∞
y′′
= 2a2 + 6a3 x + 12a4 x 2 + 20a5 x 3 +=
... ∑ n(n − 1)a x
n=2
n
n−2
∞
=xy a0 x + a1 x 2 + =
a2 x3 + ... ∑a x
n =0
n
n +1
1= 1 +0 x +0 x 2
+0 x 3
...
1
∴2a2= 1 ⇒ a2=
2
−a0
6a3 + a0 = 0 ⇒ a3=
6
−a1
12a4 + a1 = 0 ⇒ a4 =
12
−a2 −1
20a5 + a2 = 0 ⇒ a5 = =
20 40
1 2 −a0 3 −a1 4 −1 5
y =a0 + a1 x + x + x + x + x + ...
2 6 12 40
x3 1 1 1
= a0 (1 − + ...) + a1 ( x − x 4 + ...) + x 2 − x 5 + ...
6 12 2 40
10
Questions for Lecture/ Workshop
Find the general solution of the following differential equations:
1. x 2 y ′′ − 3 xy ′ − 3 y = 0 , x > 0
2. 4 x 2 y ′′ + 4 xy ′ − y = 0 , x > 0
3. x 2 y ′′ + 7 xy ′ + 9 y =
0, x > 0
4. x y ′′ + xy ′ + y = 0 , x > 0
2
ex
5. y ′′ − 2 y ′ + y = .
x
6. x 2 y ′′ − 2 xy=
′ + 2 y x3 e x ( x > 0)
7. Solve y ′′ + x 2 y ′ + xy = 0
8. y′′ + x 2 y′ + xy =
2x
Answers:
−1 1
2+ 7 2− 7
1. =
y ( x) c1 x + c2 x 2. y=
( x) c1 x 2
+ c2 x 2
3. ( x) c1 x −3 + c2 x −3 ln x
y=
6. y ( x) = c1 x + c2 x 2 + xe x .
5. y ( x) = c1e x + c2 xe x − xe x + xe x ln x .
x3 x4
7. y ( x) = a0 (1 − + ...) + a1 ( x − + ...).
6 6
x3 x4 x3
8. y ( x) = a0 (1 − + ...) + a1 ( x − + ...) + ( + ...)
6 6 3
11
Tutorial Questions
Solve the following ordinary differential equations, take x > 0 in each case:
(1) x 2 y ′′ + xy ′ − 2 y =
0
(2) x 2 y ′′ − 3 xy ′ + 13 y =
0
(3) x 2 y ′′ − 6 y =
0
(4) x 2 y ′′ + 3 xy ′ + y =
0
(5) 4 x 2 y ′′ + y =
0
d2 y
(6) +y=tan x
dx 2
ex
(7) ′′ ′
y − 2 y + y =3 .
x
(8) x y ′′ − xy ′ + y =
2
x ln x,
(9) x y ′′ + xy ′ − y =
2
x
(10) x 2 y ′′ + 9 xy ′ − 20 y = 50 x −3
(11) y ′′ − 2 xy =
0
(12) y ′′ + x 2 y ′ + xy =
0
(13) (1 + x 2 ) y ′′ − 2 y =0
(14) y ′′ − xy ′ − ( x + 2) y =
0
(15) y ′′ + x 2 y =
x
12
Answers:
− 2 −2
(1) y = + c2 x (2) y =x c1 cos 3ln x + c2 sin 3ln x (3) y =
c1 x + c2 x
2 2 3
c1 x
1 1
−1 −1
(4) y =
c1 x + c2 x ln x (5) y =
c1 x 2 + c2 x 2 ln x
Extra Questions
13