engi 3424 2 - second order linear odes page 2-01 2. second order linear...

38
ENGI 3424 2 - Second Order Linear ODEs Page 2-01 2. Second Order Linear Ordinary Differential Equations The general second order linear ordinary differential equation is of the form 2 2 dy dy Px Qx y Rx dx dx Of the second (and higher) order ordinary differential equations, the linear equations with constant coefficients will command most of our attention in this chapter: 2 2 dy dy P Qy Rx dx dx Contents: 2.1 Complementary Function 2.2 Particular Solution (Variation of Parameters) 2.3 Particular Solution (Undetermined Coefficients) 2.4 Higher Order Linear Ordinary Differential Equations 2.5. Numerical Methods

Upload: others

Post on 04-Feb-2021

12 views

Category:

Documents


0 download

TRANSCRIPT

  • ENGI 3424 2 - Second Order Linear ODEs Page 2-01

    2. Second Order Linear Ordinary Differential Equations

    The general second order linear ordinary differential equation is of the form

    2

    2

    d y dyP x Q x y R x

    dx dx

    Of the second (and higher) order ordinary differential equations, the linear equations with

    constant coefficients will command most of our attention in this chapter:

    2

    2

    d y dyP Q y R x

    dx dx

    Contents:

    2.1 Complementary Function

    2.2 Particular Solution (Variation of Parameters)

    2.3 Particular Solution (Undetermined Coefficients)

    2.4 Higher Order Linear Ordinary Differential Equations

    2.5. Numerical Methods

  • ENGI 3424 2.1 – Complementary Function Page 2-02

    2.1 Complementary Function

    The homogeneous equation associated with the ODE 2

    2

    d y dyP Q y R x

    dx dx is

    02

    2

    yQdx

    dyP

    dx

    yd

    The principle of superposition of solutions of the homogeneous equation is valid because

    it is linear. That is, if y = u(x) and y = v(x) are both solutions of the homogeneous

    ODE, then so also is any linear combination of these functions: y = c1 u(x) + c2 v(x) ,

    where c1 and c2 are any constants.

    Adding any solution of the homogeneous ODE to a particular solution of the original

    ODE generates another solution of the original ODE.

    Thus the general solution (abbreviated as G.S.) of

    xRyQdx

    dyP

    dx

    yd

    2

    2

    can be partitioned into two parts:

    the complementary function (C.F., which is the general solution of the associated

    homogeneous ODE) and a particular solution (P.S.).

    If xy e then

    Substituting xy e into the homogeneous ODE:

    from which the auxiliary equation (A.E.) follows:

    2 + P + Q = 0

    [The choice of xy e as a trial solution to the homogeneous ODE is justified later, on

    page 2-09, when a more general method for finding the complementary function is

    introduced.]

  • ENGI 3424 2.1 – Complementary Function Page 2-03

    The solution of the auxiliary equation 2 + P + Q = 0 is

    Distinct roots (1 2) the complementary function is

    [The case of equal roots will be dealt with later, on page 2.08 .]

    Example 2.1.1

    Solve the differential equation

    y" + 3y' 4y = 0

    The auxiliary equation is

    The complementary function (which is also the general solution) is

    Checking the solution:

  • ENGI 3424 2.1 – Complementary Function Page 2-04

    Example 2.1.2

    Solve

    y" 2y' + 2y = 0

    In general, when the roots of the auxiliary equation are a complex conjugate pair of

    values, = a ± bj , then the complementary function is

    1 2 3 4cos sinC jbx jbxax axy x e c e c e e c bx c bx (where the arbitrary constants are related by 3 1 2c c c and 4 2 1c j c c ) or

    yC(x) = A eax

    cos(bx )

    2 2 3 43 4 2 2 2 2

    3 4 3 4

    where , cos and sinc c

    A c cc c c c

    or

    yC(x) = A eax

    sin(bx )

    2 2 3 43 4 2 2 2 2

    3 4 3 4

    where , sin and cosc c

    A c cc c c c

    Note that, for an auxiliary equation of this type, with real coefficients, where the solution

    is constrained to be real, the arbitrary constants c3 and c4 are both real, but c1 and c2

    often are not. For this reason, the forms involving the trigonometric functions are

    usually preferred to the complex exponential form.

  • ENGI 3424 2.1 – Complementary Function Page 2-05

    Example 2.1.3

    A spring, that is not at its natural length, experiences a restoring force R that is

    proportional to the extension s beyond the natural length and is directed towards the

    equilibrium position. In the absence of friction, this would lead to undamped simple

    harmonic motion. Let us suppose that there is also a friction force D that is

    proportional to the speed and acts in the opposite direction to the velocity.

    Restoring force proportional to displacement

    Friction (drag) proportional to speed

    Newton’s second law of motion:

    Therefore the ODE governing the motion of the spring is

  • ENGI 3424 2.1 – Complementary Function Page 2-06

    Example 2.1.3 (continued)

    Suppose that m = 1 kg, b = 6 kg s−1

    , c = 25 kg s−2

    and that the spring begins at its

    equilibrium position, but moving at 2 m s−1

    to the right, so that s(0) = 0 and v(0) = 2, then

    the ODE becomes

    Note that if b = 0 (no friction at all), then the system is totally undamped and exhibits

    simple harmonic motion:

    s(t) = A sin (kt )

    .wherem

    ck

  • ENGI 3424 2.1 – Complementary Function Page 2-07

    The General Spring Problem

    2

    20

    d s b ds cs

    dt m dt m

    Case 1:

    2

    4b c

    m m

    λ =

    Case 2:

    2

    4b c

    m m

    λ =

    Case 3:

    2

    4b c

    m m

    λ =

    or

    or

  • ENGI 3424 2.1 – Complementary Function Page 2-08

    Complementary Function when the Auxiliary Equation has Equal Roots

    1 2 the ODE becomes

    y" − 2λ y' + λ 2

    y = 0

    One solution to this equation is 1

    xy C e

    We require another solution that is independent of this one (so that there will be two

    distinct arbitrary constants of integration in the complementary function).

    Try 2xf x C xe

    [This second form arises naturally from the operator method, on page 2.09.]

    Then f '(x) =

    and f "(x) =

    Example 2.1.4

    Solve

    y" 6y' + 9y = 0

  • ENGI 3424 2.1 – Complementary Function Page 2-09

    The Operator Method

    The homogeneous ordinary differential equation with constant coefficients,

    02

    2

    yQdx

    dyP

    dx

    yd

    can also be written, using differential operators, in the form

    021

    yk

    dx

    dk

    dx

    d

    Justification:

    The second order ODE can therefore be re-written as a linked pair of first order linear

    ordinary differential equations [the method of reduction of order, section 1.4]:

    01

    k

    dx

    d, (A)

    where

    ykdx

    dy2 . (B)

    Solution:

  • ENGI 3424 2.1 – Complementary Function Page 2-10

    Operator Method (continued)

  • ENGI 3424 2.1 – Complementary Function Page 2-11

    Operator Method (continued)

    Summary for the Complementary Function:

    ODE: y" + P y' + Q y = 0

    A.E.: λ 2

    + P λ + Q = 0

    λ real and distinct C1 2x xy A e B e

    λ real and equal Cxy Ax B e

    λ complex conjugate pair

    C cos sin , where Re , Imaxy e C bx D bx a b

  • ENGI 3424 2.2 – Variation of Parameters Page 2-12

    2.2 Particular Solution (Variation of Parameters)

    The method of variation of parameters is a general method for finding the particular

    solution of a linear ODE.

    If the complementary function for the ODE

    xRyQdx

    dyP

    dx

    yd

    2

    2

    is 1 1 2 2Cy x C y x C y x , (so that 1 2,y x y x is a basis for the space of all solutions to the homogeneous ODE), then the particular solution is

    1 2Py x u x y x v x y x ,

    where the functions u(x) and v(x) need to be determined.

    We need two constraints in order to pin down the functional forms of u(x) and v(x).

    An obvious constraint is that 1 2u x y x v x y x be a particular solution of the ODE. We have considerable freedom as to what the other constraint will be.

    1 2Py u y v y

    Impose our “free” constraint,

  • ENGI 3424 2.2 – Variation of Parameters Page 2-13

    Define the Wronskian function W(x) to be

    1 2

    1 21 2,

    dety yy y

    W xy y

    together with the associated determinants

    2 1

    1 2 2 1

    2 1

    0 0det and det

    y yW y R W y R

    R y y R

    then Cramer’s rule yields solutions for u' and v' :

    1 2and .W W

    u vW W

    Therefore a particular solution is 1 2Py u y v y , where

    1 22 1

    1 2

    , ,y yy x R x y x R x

    u x dx v x dx W xy yW x W x

    Note that we can ignore the arbitrary constants of integration in both integrals, because

    1A y and 2B y are both solutions of the homogeneous ODE and can therefore be

    absorbed into the complementary function.

    Example 2.2.1

    Find the general solution of the ODE 2 22 3 xy y y x e .

  • ENGI 3424 2.2 – Variation of Parameters Page 2-14

    Example 2.2.1 (continued)

    Particular Solution by Variation of Parameters:

  • ENGI 3424 2.2 – Variation of Parameters Page 2-15

    Example 2.2.1 (continued)

  • ENGI 3424 2.2 – Variation of Parameters Page 2-16

    Example 2.2.2

    Find the general solution of:

    y" + y = tan x

  • ENGI 3424 2.2 – Variation of Parameters Page 2-17

    Example 2.2.2 (continued)

  • ENGI 3424 2.2 – Variation of Parameters Page 2-18

    Example 2.2.3

    Use the variation of parameters method to find the particular solution, then find the

    complete solution of the initial value problem

    y" − 2y' + y = ex, y(0) = 0, y'(0) = 1

  • ENGI 3424 2.2 – Variation of Parameters Page 2-19

    Example 2.2.3 (continued)

    Note that a complete solution requires additional information (often in the form of

    initial conditions). Two pieces of information are needed in order to evaluate both

    arbitrary constants of integration. However, do not substitute these conditions into the

    complementary function; wait until the general solution has been obtained.

  • ENGI 3424 2.2 – Variation of Parameters Page 2-20

    The method of variation of parameters may also be used to find the particular solution of

    a linear second order ODE whose coefficients are not constant. However, general

    methods for finding the complementary functions in these cases are beyond the scope of

    this course.

    Example 2.2.4

    Verify that the complementary function for the ODE 2

    2

    2 5 8 3d y dy

    x x y xdx dx

    is 4 2Cy Ax B x

    and hence find the general solution of the ODE.

    4 2

    C Cy Ax B x y

    The particular solution is

    1 2 1 24 2where andPy x u x y x v x y x y x y x

  • ENGI 3424 2.2 – Variation of Parameters Page 2-21

    Example 2.2.4 (continued)

    [This example appeared in the journal note “A seldom used formula for ODEs”,

    George, G.H., Mathematical Gazette, vol. 92, #524, pp. 344-348]

  • ENGI 3424 2.3 – Undetermined Coefficients Page 2-22

    2.3 Particular Solution (Undetermined Coefficients)

    The general solution to

    xRyQdx

    dyP

    dx

    yd

    2

    2

    is the sum of the complementary function and any one solution (the particular solution)

    that we can find to the original inhomogeneous ODE.

    The method of variation of parameters to find the particular solution is powerful, but it

    can involve an unnecessary level of effort. In some cases, an alternative method

    (undetermined coefficients) is available that is often faster to use.

    If the function R(x) does not contain any part of the complementary function, then

    assume that the particular solution yP(x) is of the same form as R(x).

    Example 2.3.1 (same as Example 2.2.1)

    Find the general solution of the ODE 2 22 3 xy y y x e .

    A.E.:

    C.F.:

    P.S.: R(x) contains neither 3xe nor xe .

    R x is the sum of a quadratic function and 2xe .

    Therefore try the sum of a quadratic function and a multiple of 2xe ,

    where all four coefficients are to be determined.

  • ENGI 3424 2.3 – Undetermined Coefficients Page 2-23

    Example 2.3.1 (continued)

    2 2Pxy ax bx c d e

    Matching coefficients:

    G.S.: C Py x y x y x

    Therefore

  • ENGI 3424 2.3 – Undetermined Coefficients Page 2-24

    General Method:

    xRyQdx

    dyP

    dx

    yd

    2

    2

    If the function R x does not contain any part of the complementary function, then

    assume that the particular solution Py x is of the same form as R x .

    If k xR x e ,

    then try Pk xy ce , with c to be determined.

    If R x = (a polynomial of degree n),

    then try Py = (a polynomial of degree n), with all (n + 1) coefficients to be determined.

    If R(x) = (a multiple of cos k x and/or sin k x ),

    then try cos sinPy c k x d k x , with c and d to be determined.

    This method can be extended to cases where

    R x = (a sum and/or product of the functions above).

    But: if part (or all) of Py is included in the complementary function Cy , then

    multiply Py by x and try again.

    As seen above in Example 2.3.1, the method of undetermined coefficients can be used in

    Example 2.2.1 2 2xR x x e . It can also be used in Example 2.2.3 xR x e .

    However, in Example 2.2.2, tanR x x , which does not fall into any of these categories. The method of undetermined coefficients cannot be used in this case to find

    the particular solution (which was cos ln sec tanPy x x x ).

  • ENGI 3424 2.3 – Undetermined Coefficients Page 2-25

    Example 2.3.2

    Consider a model of the simple series RLC

    circuit, where the constants R, L, C are the

    resistance, inductance and capacitance

    respectively, E(t) is the applied electromotive

    force, t is the time and i t is the resulting current.

    Examine the voltage drops around the circuit:

    :R

    :L

    :C and note that .dQ

    idt

  • ENGI 3424 2.3 – Undetermined Coefficients Page 2-26

    Example 2.3.2 (continued)

    Particular solution

    If E(t) = Eo (constant), then

    Suppose that the e.m.f. is sinusoidal, so that E(t) = Eo sin ωt , then

    o cos1 E tdE

    L dt L

    P.S.: Try

    sin cosPi a t b t

    sin cosPi b t a t

    2 2sin cosPi a t b t

    P P P

    2 2

    o

    1

    sin cos

    0 sin cos

    Ri i i

    L LC

    b R a a R ba t b t

    L LC L LC

    Et t

    L

    2 21b R a a

    a b LCL LC RC

    2 2 o1

    1Ea R a

    LCL RC LC L

    2

    2

    o1a LCa R RC C E

    RC LC RC LC L

    oo

    2 22 22 21 1

    E C RCE RC LCa

    L RC LC RC LC

    22oo

    2 22 22 2

    11

    1 1

    E C LCE C RCLCb

    RC RC LC RC LC

  • ENGI 3424 2.3 – Undetermined Coefficients Page 2-27

    Example 2.3.2 (continued)

    Therefore the particular solution is

    2

    o

    P 22 2

    sin 1 cos

    1

    E C RC t LC ti

    RC LC

    which is a steady-state sinusoidal response to the sinusoidal electromotive force, but with

    a phase difference of

    22 2

    arccos

    1

    RC

    RC LC

    .

    The total current is then

    2

    22 2

    2sin 1 cos

    sin cos2 2 1

    transient steady state

    RtL

    E C RC t LC tD Di t e A t B t

    L L RC LC

    As a specific example, if E(t) = 17 sin 2t, R = 120 Ω, C = 1 mF and L = 10 H,

    then it can be shown that

    61

    sin8 cos8 sin 2 4cos 2120

    ti t e A t B t t t

    The transient current, C6 sin8 cos8ti t e A t B t , dies away very quickly.

    Its magnitude falls to under 1% of the total current permanently in less than a second.

    The values of the two arbitrary constants can be found from the initial conditions, but,

    given that the complementary function becomes negligible in a very short time, one often

    does not try to evaluate them.

    Example 2.3.3

    Find the complete solution of the initial value problem

    2 , 0 0 1xy y y e y y

  • ENGI 3424 2.3 – Undetermined Coefficients Page 2-28

    Example 2.3.3 (continued)

  • ENGI 3424 2.4 - Higher Order ODEs Page 2-29

    2.4 Higher Order Linear Ordinary Differential Equations

    The nth

    order ordinary differential equation

    xRyadx

    dya

    dx

    yda

    dx

    yda

    dx

    yda

    dx

    ydnnnn

    n

    n

    n

    n

    n

    12

    2

    22

    2

    21

    1

    1

    (where the coefficients ia are all constant) can be solved as follows.

    Form the auxiliary equation

    1 2 2 11 2 2 1 0n n n

    nn na a a a a

    Find all n values for .

    Form the complementary function Cy , which will be a linear combination of

    1 2, , , nx x xe e e (except for repeated roots). Complex conjugate pairs can be re-written in terms of sine and cosine functions.

    Find a particular solution Py (by inspection, undetermined coefficients, or variation of

    parameters, as extended to this higher order equation).

    Write down the general solution C Py y y .

    n initial and/or boundary conditions will be needed at this stage to evaluate all of the n

    arbitrary constants of integration.

    Example 2.4.1 Find the general solution of

    xdx

    dy

    dx

    yd

    dx

    yd

    dx

    yd

    dx

    yd84432

    2

    2

    3

    3

    4

    4

    5

    5

    Auxiliary equation:

    5 4 3 22 3 4 4 0

  • ENGI 3424 2.4 - Higher Order ODEs Page 2-30

    Example 2.4.1 (continued)

  • ENGI 3424 2.4 - Higher Order ODEs Page 2-31

    Example 2.4.2

    A thin uniform beam of length L experiences a transverse deflection y(x) at location x

    (0 < x < L) due to a transverse force per unit length W(x) . From the elementary theory

    of beams, the governing differential equation is

    4

    4

    d yEI W x

    dx

    where EI is the flexural rigidity of the beam,

    E is Young’s modulus and I is the moment

    of inertia of the beam about its central axis.

    If the beam has uniform elastic properties and a uniform cross section along its length,

    then its flexural rigidity EI is constant.

    The initial conditions are:

    0y a the deflection at x = 0,

    0y b the slope at x = 0,

    0EI y c the bending moment at x = 0 and

    0EI y d the shear at x = 0.

    Find the deflection for a cantilever beam with uniform load W(x) = W (constant).

    For a cantilever beam, the deflection and slope are zero at the fixed end (x = 0), while the

    bending moment and the shear are zero at the free end (x = L ).

  • ENGI 3424 2.4 - Higher Order ODEs Page 2-32

    Example 2.4.2 (continued)

  • ENGI 3424 2.5 - Numerical Methods Page 2-33

    2.5. Numerical Methods [not examinable]

    An initial value problem with an nth order ordinary differential equation can be re-written

    as a linked set of n first order initial value problems. Where analytical solutions are

    difficult or impossible, extensions of numerical methods, such as the Euler and RK4

    methods, can be applied to obtain approximate solutions to these initial value problems at

    particular values of the independent variable.

    A more general case for initial value problems involving second order ODEs,

    2

    2, , , 0 , 0

    d y dyP x y Q x y y R x y a y b

    dx dx ,

    transforms into the linked pair of first order initial value problems

    , 0dy

    z y adx

    and , , , 0dz

    R x Q x y y P x y z z bdx

    This pair of problems can be solved sequentially (as in the operator method on pages 2.09

    to 2.11) if the coefficients , 0Q x y and ,P x y f x . Otherwise analytical solutions are mostly beyond the scope of this course. Symbolic algebra software, such

    as Maple®, may be able to provide exact solutions or numerical approximations.

    Example 2.5.1

    Use software to estimate the value of y(0.5) given that

    2

    2

    2sin , 0 0 , 0 1

    d y dyy y x y y

    dx dx .

    Using Maple software, the commands > with(DEtools):

    > DEplot(diff(y(x),x$2)+y(x)*y(x)*diff(y(x),x)+y(x)-sin(x),y(x), x=-3..12, [[y(0)=0,D(y)(0)=1]],

    y=-6..3, stepsize=.05, linecolour=[blue]);

    produce the plot

  • ENGI 3424 2.5 - Numerical Methods Page 2-34

    Example 2.5.1 (continued)

    which does not resemble any standard function.

    Zooming in (to x=0..0.5, y=0..0.5 and enhancing slightly),

    we can see that our estimate is

    0.5 0.495y

    The Maple worksheet is on the course web

    site, at

    "www.engr.mun.ca/~ggeorge/3424/

    demos/ex251.mws"

    The further sequence of Maple commands

    > ode1 := diff(y(x),x$2)+y(x)*y(x)*diff(y(x),x)+y(x)-sin(x);

    > ic1 := y(0) = 0, D(y)(0) = 1;

    > dsol1 := dsolve({ode1, ic1}, numeric, range=0..1);

    > dsol1(0.5);

    produces y(0.5) = .494 671...

  • ENGI 3424 2.5 - Numerical Methods Page 2-35

    Example 2.5.2

    Find the general solution of the ordinary differential equation 2

    2

    26 12 24

    d y dyx x y

    dx dx

    and find the complete solution given the additional information 1 2, 1 1y y .

    This is an example of a “dimensionally homogeneous” ODE (also known as a Cauchy-

    Euler ODE). A change of variables tx e will convert the ODE into a form with

    constant coefficients, which can be solved exactly using the methods in the earlier

    sections of this chapter.

    The sequence of Maple commands > with(DEtools):

    > ode1 := x^2*diff(y(x),x$2) - 6*x*diff(y(x),x) + 12*y(x) - 24;

    > ic1 := y(1) = 2, D(y)(1) = 1;

    > dsolve(ode1);

    produces the general solution

    y(x) = x^3 _C2 + x^4 _C1 + 2

    The additional command > dsolve({ode1, ic1});

    produces the complete solution

    y(x) = –x^3 + x^4 + 2

    The Maple worksheet is available at

    "www.engr.mun.ca/~ggeorge/3424/demos/ex252.mws"

    One can easily verify that this complete solution is correct:

  • ENGI 3424 2.5 - Numerical Methods Page 2-36

    Example 2.5.2 (continued)

    The exact solution (not examinable except possibly as a bonus question) is obtained as

    follows:

    Let t tdx

    x e e xdt

    By the chain rule, 1tdy dy dt dy dx dy dy dy dye x

    dx dt dx dt dt dt x dt dx dt

    2 2

    2 2

    1 1t t td y d dy d dy dx d dy d y dye e edx dx dx dt dx dt x dt dt x dt dt

    2 2 22

    2 2 2 2

    1 d y dy d y d y dyx

    x dt dt dx dt dt

    Any Cauchy-Euler ODE of the type 2

    2

    2

    d y dyx bx cy r x

    dx dx ,

    (where b and c are constants) therefore transforms into the ODE

    2 2

    2 21

    d y dy dy d y dyb cy r x b cy r x

    dt dt dt dt dt

    In this case, b = –6, c = 12 and r(x) = 24.

    The equivalent ODE is 2

    27 12 24

    d y dyy

    dt dt

    A.E.: 2 7 12 0 3 4 0 3, 4

    C.F.: C C3 4

    3 43 4t t t ty t Ae Be A e B e y x Ax Bx

    P.S.: r x is a constant. Therefore try P P P0 0y x c y x y x

    Substituting into the ODE: P0 0 12 24 2 2c c y x

    Therefore the general solution is 3 4 2y x Ax Bx

    Applying the conditions 1 2, 1 1y y quickly leads to 1, 1A B .

    The complete solution is therefore 4 3 2y x x x .

  • ENGI 3424 2.5 - Numerical Methods Page 2-37

    Example 2.5.3 (same as Example 5.11.2)

    Find the general solution (as a power series about x = 0) to the ordinary differential

    equation 2

    2

    20

    d yx y

    dx

    The sequence of Maple commands > with(DEtools):

    > ode := diff(y(x),x$2) + x*x*y(x);

    > dsolve(ode);

    produces the exact general solution

    2 21 1

    _ 1 BesselJ , _ 2 BesselY ,4 2 4 2

    x xy x C x C x

    where the Bessel functions J x and Y x are beyond the scope of this course.

    Converting the exact solution into a power series, > Order := 15;

    > dsolve(ode, y(x), series);

    produces

    4 5 8 91 1 1 1

    0 D 0 0 D 0 0 D 012 20 672 1440

    y x y y x y x y x y x y x

    12 13 151 1

    0 D 0 O88704 224640

    y x y x x

    Letting 0A y and 0B y this solution can be re-written as

    4 8 121 1 1

    112 672 88704

    y x A x x x

    5 9 131 1 1

    20 1440 224640B x x x x

  • ENGI 3424 2.5 - Numerical Methods Page 2-38

    [Space for Additional Notes]

    END OF CHAPTER 2

    2 - Second Order Linear ODEs2.1 Complementary functionGeneral spring problem2.2 Variation of parameters2.3 Undetermined coefficients2.4 Higher order ODEs2.5. Numerical methods