Академический Документы
Профессиональный Документы
Культура Документы
1
Second order linear ODEs
A second order linear differential equation can be written in the standard form
y ′′ + p ( x) y ′ + q ( x) y = r ( x)
A differential equation of this form with a term on the right hand side that doesn’t contain a
derivative term or the dependent variable, i.e. the right hand side is a function of the
independent variable or a constant, is called a non-homogeneous differential equation. A
differential equation written in the form where all the derivative terms and the dependent
variable are on the left hand side and the right hand side is equal to zero is called an
homogeneous differential equation
y ′′ + p ( x) y ′ + q ( x) y =
0.
Dy =
d
( y ) = dy
dx dx
d2y
D y= 2
2
dx
d4y
D y= 4
4
etc.
dx
Examples:
yy ′′ + y ′ 0
1. = (non-linear) : ⇒ yD 2=
( y ) + D( y ) 0 or (=
yD 2 + D) y 0
y ′′ + e x y ′ + y e - x sin x
2.= (linear): ( D 2 + e x D + 1) y e - x sin x
⇒ =
d
3. ( sin x ) = D ( sin x )
dx
2
Preliminary theory for solutions of homogeneous linear ODEs
Recall that a solution of a second order ODE is a function y = h(x) which, with its
derivatives h ′(x) and h ′′(x), satisfies the given ODE.
The theory is similar for other order (first, third etc) homogeneous linear ODEs.
Example:
Verify that y1 = cos x and y 2 = sin x are solutions of the homogeneous linear ODE
y ′′ + y = 0 .
y1 = cos x y 2 = sin x
′
y1 ' = − sin x y 2 = cos x
″ ″
y1 = − cos x y 2 = − sin x
″ ″
y1 + y1 = − cos x + cos x y 2 + y 2 = − sin x + sin x
=0 = 0.
We also could verify y1 = 3 cos x and y 2 = 2 sin x are also solutions and y = 3 cos x + 2 sin x
is a solution. In fact we could verify that any linear combination of cos x and sin x is a
solution. So these two functions form a basis for the solution of y ′′ + y = 0 . Finally, we
could say that the general solution is in fact=
y ( x) c1 cos x + c2 sin x .
3
Homogeneous second order linear ODEs with constant coefficients
To find a general method of solution, consider the similar first order case y ′ − λ y = 0 .
The general solution (use separation of variables or the linear ODE formula) is y = Ce λx .
So the exponential function y = e λ x forms a basis for solution of the first order ODE. Will
this function solve the second order case? Verify that this function is a solution of the second
order case by evaluating the first and second derivatives and substituting into the original
differential equation.
λx dy λx d2y
y=e ⇒ = λe and 2
= λ2 e λ x
dx dx
2
d y dy
so 2
+ a + b y = 0 becomes
dx dx
λ e + aλ e λ x + b e λ x = 0
2 λx
( )
e λ x λ 2 + aλ + b = 0 or
λ 2 + aλ + b = 0 (since e λ x ≠ 0).
This is a quadratic equation which will, in general, have the two solutions λ1 and λ2.
So a basis for solution of the constant coefficient homogeneous second order linear ODE will
be
y1 = e λ1x and y 2 = e λ2 x (as long as λ1 ≠ λ 2 - why?).
The type of solution of the characteristic equation can have three possible forms:
d2y dy
The solutions of 2
+ a + b y = 0 will then take three corresponding forms.
dx dx
4
Case 1: A basis will be y1 = e λ1x and y 2 = e λ2 x , so the general solution can be written as
y ( x) = c1e λ1x + c 2 e λ2 x .
Example:
Find the general solution of y ′′ + 6 y ′ + 8 y =
0.
Case 2: Since λ1 = λ 2 = λ , there is only one linearly independent solution of the form
y1 = e λx . Another linearly independent solution can be shown to be y 2 = xe λx (check this by
substitution and see the text for further details), so the general solution can be written as
y ( x) = c1e λx + c 2 xe λx = (c1 + c 2 x)e λx .
Example:
Find the general solution of y ′′ − 10 y ′ + 25 y = 0
The characteristic equation is λ2 − 10λ + 25 = 0 ⇒ (λ − 5) 2 = 0 ⇒ λ = 5 .
Case 3: A basis could be y1 = e (α +iβ ) x and y 2 = e (α −iβ ) x but it would be better to have a
general solution in terms of real functions if possible so the general solution can be written as
y ( x) = c1eα x cos β x + c2eα x sin β x or y ( x) = eα x (c1 cos β x + c 2 sin β x ) .
NOTE: This solution can be constructed using Euler’s formula e i θ = cosθ + i sin θ . So
(ignoring the x factor for the moment),
( )
eα + i β = eα ei β = eα (cos β + i sin β ) αnd eα − i β = eα (cos β − i sin β ) .
Taking linear combinations of these two solutions (which will also be solutions) gives
eα + i β + eα − i β eα + i β − eα − i β
= eα cos β αnd = eα sin β
2 2i
Example:
5
Solution using differential operators ( an alternate notation)
dy
( D − r ) y = 0 ⇒ Dy − ry = 0 ⇒ − ry = 0 ⇒ y = Ce rx (as before).
dx
Now consider the following example of a homogeneous second order linear ODE with
constant coefficients.
d2 y dy
2
− 5 + 4y = 0
dx dx
( D 2 − 5 D + 4) y = 0 ⇒ ( D −−4) ( D 1) y = 0 so either
( D − 4) y =0 ⇒ y =c1e 4 x or
( D − 1) y = 0 ⇒ y = c2 e x
which gives y ( x) = c1e 4 x + c 2 e x .
prime notation y ′′ + ay ′ + b = 0 or
( )
differential operator notation D 2 + aD + b y = 0 .
6
Non-homogeneous linear ODEs with constant coefficients
We have investigated methods for finding the solution of some homogeneous linear ODEs.
Consider the following three non-homogeneous linear ODEs:
y ′′ + 2 y ′ + y = e x y ′′ + 2 y ′ + y = x 2 y ′′ + 2 y ′ + y = cos x.
Note the similarity of the ODEs except for the function on the right hand side. Each ODE
will have the same general solution for the homogeneous case (RHS = 0). Since this will
already contain two arbitrary constants, the non-homogeneous general solution only requires
an additional function particular to the RHS so that it actually satisfies the required ODE.
y ( x) = y h ( x) + y p ( x)
where y h (x) is the general solution of the corresponding homogeneous equation and y p (x)
is any particular solution of the non-homogeneous ODE.
NOTE: In general, this argument only works for linear ODEs. It can be proved by
substituting the general solution y = y h + y p into the general non-homogeneous linear ODE
y ′′ + p ( x) y ′ + q ( x) y = r ( x) . (Try it!)
In many cases, particular solutions can be found by “guess work” or the more formal methods
of “undetermined coefficients” and “variation of parameters”.
Step 3 Substitute the final version of y p (x) into the ODE to evaluate the unknowns.
7
Modifications:
If your choice for y p is a solution of the homogeneous equation then multiply it by x (or by
x2 if this solution corresponds to a double root of the homogeneous equation).
If r ( x) is a linear combination of functions then add these choices for y p (x) corresponding
to each of the terms in r (x) .
Examples:
∴ choose y p ( x=
) Bx + A .
Step 3. Substitute:
= y ′p B=
and y ′′p 0
y ′′p −−
2 y ′p 3 y p =−−
0 2 B 3( Bx + A) =4x
−−−
3Bx 2 B 3 A =
4 x.
−4
By equating coefficients: −3B = 4 ⇒ B =
3
8
−−
2B 3 A = 0 ⇒ A =
9
4 8
so y p ( x) = − x+
3 9
4 8
and the general solution is y ( x) = y h ( x) + y p ( x) = c1e 3 x + c 2 e − x − x+ .
3 9
8
Step 3. Substitute:
y ′p = 2 Axe 2 x + 2 Ax 2 e 2 x
y ′p′ = 4 Ax 2 e 2 x + 8 Axe 2 x + 2 Ae 2 x
( ) ( )
y ′′ − 4 y ′ + 4 y = 4 Ax 2 e 2 x + 8 Axe 2 x + 2 Ae 2 x − 4 2 Axe 2 x + 2 Ax 2 e 2 x + 4 Ax 2 e 2 x = 12e 2 x .
This consists of a mass attached to the lower end of a spring that is suspended vertically from
a mounting. The mass is large enough so the mass of the spring is negligible. The system is in
its equilibrium position when it is at rest. The mass is set in motion. If the downward
direction is taken as the positive direction, Newton’s Second Law of Motion is
mass × acceleration = Force
d2 y
i.e. m 2 =F
dt
If the spring is stretched downward from its original position y = 0 by some distance y > 0
then using Hooke’s Law the upward or restoring force F1 (which restores the mass back to
the y = 0 position) is given by F1 = −ky ,where k is the spring constant.
9
Undamped systems
Every system will have some damping but in practices this could be considered to be
negligible and so the only force acting is F1 . Hence the model of the mechanical system
without damping is the linear constant coefficient ode.
my ′′ + ky =
0.
k
This has the general solution y (t ) =A cos w0 t + B sin w0 t , where w0 = .
m
Given the initial conditions y (0) = y0 (initial position) and y ′(0) = v0 (an initial velocity) we
could evaluate the constants A and B.
If an external force f (t ) is applied to the system the resulting differential equation would be
the non-homogeneous equation
my ′′ + ky =f (t ) .
my ′′ + cy ′ + ky =f (t )
where c y ′ represents the friction or other energy loss and c is called the damping constant.
The motion described by this solution is called a harmonic oscillation. Since the functions
cos w0 t and sin w0 t have a period of 2π , the frequency of the oscillation will be also
w0
w
given by 0 cycles per second.
2π
Examples:
1. A mass of 2kg is suspended from a spring with a known spring constant of 10N/m and
allowed to come to rest. It is then set in motion by giving it an initial velocity of 150cm/sec.
Find an expression for the displacement y, assuming no air resistance.
=
Given: m 2=
kg , k 10 N / m,= y ′(0) 150cm
y (0) 0,= = / sec 1.5m / sec
2 y ′′ + 10 y =
0
=
∴ y A cos 5t + B sin 5t
y (0) = 0
=0 A cos 0 + B sin 0 ⇒= A 0
y = B sin 5t
y ′(0) = 1.5
y ′ = B 5 cos 5t
=
1.5 B 5 ⇒ B ≈ 0.6708
∴y=0.6708sin 5t.
10
2. A 10kg weight is attached to a spring having a spring constant of 40N/m. The mass is
started in motion with no initial velocity by displacing it 50cm above the equilibrium position
and by simultaneously applying to the mass an external force f (t ) = 10sin t N . Assuming no
air resistance, find the subsequent motion of the mass
Given m =
10kg , k =
40kg / m, y (0) = −0.5m, y ′(0) =
−50cm = 0, f (t ) =
10sin t
10 y ′′ + 40 y = 10sin t or
y ′′ + 4 y =
sin t.
yh : λ 2 + 4 =0 ⇒ λ =±2i ⇒ yh ( x) =A cos 2t + B sin 2t
=y p A cos t + B sin t
y p′ =
− A sin t + B cos t
y p′′ =
−−
A cos t B sin t
1
( −−
A cos t B sin t ) + 4 ( A cos t + B sin =
t) sin t ⇒=
A 0, =
B
3
1
∴ y (=
t ) A cos 2t + B sin 2t + sin t
3
1 1 1
y (0) =−− , =A + 0 + 0 ⇒ A =−
2 2 2
1
y′(t ) =
sin 2t + 2 B cos 2t + cos t ,
3
1 1
y′(0) =0, 0 = 2B + ⇒B= −
3 6
1 1 1
∴ y (t ) =−− cos 2t sin 2t + sin t.
2 6 3
11
Electric circuits
Using Kirchhoff’s voltage law (the equivalent of Newton’s Second law for mechanical
systems used above) it can be shown that for the RLC circuit
1
LI ′′ + RI ′ + I=
E0 w cos wt
C
and for a charge Q = ∫ I dt on the capacitor the following equation can be obtained:
1
LQ′′ + RQ′ +
Q= E0 sin wt .
C
(This is a non-homogeneous linear second order ordinary differential equation with constant
coefficients). This can be solved in the usual manner with the non-homogeneous solution
given by:
=I p a cos wt + b sin wt
I p′ =
w(−a sin wt + b cos wt )
I p′′ =−−
w2 ( a cos wt b sin wt ).
a
Lw2 (−a ) + Rwb + = E0 w (coefficients of cos wt ) and
C
b
Lw2 (−b) + Rw(−a ) + = 0 (coefficients of sin wt )
C
− E0 S E0 R 1
∴ a= and b = where S is called the reactance and is given by S = wL − .
R +S
2 2
R +S
2 2
wC
12
Example:
Find the current I in an RCL- circuit with R = 100 ohms, L= 0.1 henry, C = 10-3 farads which
is connected to a source of voltage E (t ) = 155sin 377t , assuming zero current and capacitor
charge when t = 0.
1
LI ′′ + RI ′ + I = E0 w cos wt
C
1
so 0.1I ′′ + 100 I ′ + −3 I = 155 × 377 cos 377t .
10
The homogeneous solution is given by:
0.1ll 2
+ 100 + 1000 = 0
∴ll ≈ −−−−
10, 990 (more closely = 10.102051, 989.897949) so
I =c1e −−
10 t
+ c2 e 990t + I p
and I p is given by
=I p a cos wt + b sin wt
1 1
The reactance is S = wL − = 377 × 0.1 − = 35.0
wC 377 × 10−3
−E S −155 × 35.0
and a = 2 0 2 = = −0.484
R +S (100) 2 + (35) 2
155 × 100
= b = 1.380
(100) 2 + (35) 2
∴I (t )= c1e −−
10 t
+ c2 e 990t − 0.484 cos 377t + 1.380sin 377t .
I (0) = 0 gives
0 = c1 + c2 − 0.484 (1)
1 1
we can use the equation LI ′ + RI +
C ∫ I dt= LI ′(t ) + RI (t ) + Q(t=
C
) E (t )
1 1
and solving for I ′(t ) ⇒ I ′(t )= E (t ) −−
RI (t ) Q(t ) .
L C
=
At t 0,= E (0) 0,= I (0) 0 and= I ′(0) 0.
Q(0) 0 so=
Differentiating I (t ) ⇒
I ′(t ) =
10c1e −−
−− 10 t
990c2 e 990t + 0.484 × 377 sin 377t + 1.380 × 377 cos 377t
∴ 0=−−
10c1 990c2 + 1.380 × 377. (2)
−0.042e −−
∴ I (t ) = 10 t
+ 0.526e 990t − 0.484 cos 377t + 1.380sin 377t (3dp).
13
Questions for Lecture/ Workshop
d2y dy
a) 2
−5 =0
dx dx
b) 9 y ′′ − 12 y ′ + 4 y = 0
c) y ′′ + 9 y = 0
d) y ′′ − 5 y ′ + 4 y = 8 cos x .
e) y ′′ + 4 y ′ + 4 y = e 4 x
f) y ′′ + y ′ = x
g) y ′′ − 2 y ′ = 2 x + 5 − e −2 x
2. A 16kg mass is attached to a spring having spring constant of 4 N/cm. The mass is
started in motion by stretching the spring 2cm from the equilibrium position and releasing it
from rest, i.e. the initial velocity is zero.
(i) Find the position of the mass as a function of time
(ii) How far from the equilibrium position will the mass be after 10seconds?
Answers:
Q1 a) y ( x) =
c1e0 x + c2 e5 x =+
c1 c2 e5 x
2x 2x 2x
b) y ( x) =
c1e 3 + c2 xe 3 or y ( x) =
(c1 + c2 x)e 3
c) y ( x) =e0 x ( c1 cos 3 x + c2 sin 3 x ) =c1 cos 3 x + c2 sin 3 x
12 20
d) y ( x) = c1e 4 x + c2 e x + cos x − sin x
17 17
1 4x
e) y ( x) = yh ( x) + y p ( x) = c1e −−
2x
+ c2 xe 2 x + e
36
1 2
f) y ( x) =yh ( x ) + y p ( x ) =c1 + c2 e − x +
x −x
2
1 2 1 −2 x
g) y ( x) = yh ( x) + y p ( x) = c1 + c2 e 2 x −−−x 3x e
2 8
1
2. (i) y = 2 cos t (ii) 0.57 cm below the equilibrium
2
14
Tutorial Questions
1. Solve the following second order linear ODEs:
(i) y ′′ − 9 y = 0
(ii) 4 y ′′ + 20 y ′ + 25 y =
0
(iii) ( D 2 + 3D − 5) y = 0
(iv) y ′′ − 4 y ′ + 13 y = 1, y ′(0) =
0, y (0) = −2.
d2 y dy
(v) 2
− 4 + 4y = 0
dx dx
(vi) y ′′ − 5 y ′ = 0
(vii) ( D 2 −− D 2) y = 0
(viii) y ′′ + y ′ + y =0
d2 y
(ix) + 9y =
0
dx 2
(i) ( D 2 − 2 D + 1) y = e− x
(ii) y ′′ + 25 y = 6sin x.
(iii) y ′′ − 2 y ′ − 3 y = 4 x
(iv) ( D 2 − D − 2) y = 2 sin x + 5 x
(v) y ′′ − 4 y ′ + 4 y = 12e 2 x + x 2
3. A mass of 20g is suspended from a spring with a known spring constant of 2880dynes/cm
and allowed to come to rest. It is then set in motion by stretching the spring 3cm from its rest
position and giving it an initial velocity of 10 cm/sec. Find an expression for the motion of
the mass assuming no air resistance.
4. An RCL circuit connected in series has R = 180 ohms, C = 1/280 farads, L = 20 henries,
and an applied voltage E (t ) = 10sin t . Assuming no initial charge on the capacitor but an
initial current of 1 ampere at t = 0 when the voltage is first applied, find the subsequent
current I in the circuit.
15
Answers:
−3+ 29 −3− 29
x x
−3 x −5 / 2 x −5 / 2 x
1. (i) y = c1 e + c2 e y = c1 e + c 2 xe (iii) y = c1 e
+ c2 e
3x 2 2
(ii)
4
(iv) y = e 2 x cos 3x − sin 3x (v) y = c1 e 2 x + c 2 xe 2 x (vi) y = c1 + c 2 e 5 x
3
−x
−1
x 3 3
(vii) y = c1 e 2x
+ c2 e (viii) y = e 2
c1 cos x + c 2 sin x
2 2
1
2. (i) y =c1e x + c2 xe x + e − x
4
1 4 8
(ii) y = c1 cos 5 x + c 2 sin 5 x + sin x (iii) y = c1 e 3 x + c 2 e − x − x +
4 3 9
1 3 5 5
(iv) y = c1 e 2 x + c 2 e − x + cos x − sin x − x +
5 5 2 4
1 2 1 3
(v) y = c1 e 2 x + c 2 xe 2 x + 6 x 2 e 2 x + x + x+
4 2 8
5
3. =
y (t ) 3cos12t + sin12t 4. I (t ) = 1.414e −−
7t
− 0.44e 2t + 0.026 cos t + 0.018sin t.
6
Extra Questions
2. from Kreyszig
Page 59 Set 2.2: 1-15, 21-26.
Page 84 Set 2.7: 1-10
3. from Stewart
Page 1117 , 17.1: 1-13
Page 1124, 17.2: 1-18.
16
17