SCI111 Differen(Ce)(Tial)Eqns

Embed Size (px)

Citation preview

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    1/44

    June 16, 2011

    Handout: Difference / DifferentialEquations

    L.R. van den Doel

    [email protected]

    RooseveltAcademy Middelburg

    Lange Noordstraat 1NL-4331 CB Middelburg

    The Netherlandshttp://www.roac.nl

    http://localhost/var/www/apps/conversion/tmp/scratch_8/[email protected]://localhost/var/www/apps/conversion/tmp/scratch_8/[email protected]
  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    2/44

    Contents

    1 Linear Differential Equations with Constant Coefficients . . . . . . . . . . . . . . . . . . . 12 Solving Linear Homogeneous Differential Equations with Constant Coefficients 2

    2.1 The Solution of a First-Order Linear Homogeneous Differential Equation . 32.2 The Solution of a Second-Order Linear Homogeneous Differential Equation 4

    3 Solving Inhomogeneous Linear Differential Equations . . . . . . . . . . . . . . . . . . . . . . 134 The Complete Solution of an Inhomogeneous Linear Differential Equation . . . . 175 Linear Difference Equations with Constant Coefficients . . . . . . . . . . . . . . . . . . . . . 196 Solving Linear Homogeneous Difference Equations with Constant Coefficients. 19

    6.1 Solution of a First-Order Linear Homogeneous Difference Equation . . . . . . 206.2 Solving Second-Order Linear Homogeneous Difference Equations. . . . . . . . 24

    7 Solving Inhomogeneous Linear Difference Equations . . . . . . . . . . . . . . . . . . . . . . . 338 Fibonacci Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 Cobweb and First-Order Difference Equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    9.1 Logistic Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    3/44

    1. LINEAR DIFFERENTIAL EQUATIONS WITH CONSTANT COEFFICIENTS

    1 Linear Differential Equations with Constant Coefficients

    Here, we will discuss how to solve a very specific type of differential equations; namelyfirst and second-order linear homogeneneous and inhomogeneous differential equationswith constant coefficients. Two examples of such a type of differential equation are thefollowing:

    md2y(t)

    dt2 = b dy(t)

    dt ky(t) md

    2y(t)

    dt2 +b

    dy(t)

    dt +ky(t) = 0, (1.1)

    anddy(t)

    dt =k(y(t) kTa) dy(t)

    dt ky(t) = kTa. (1.2)

    The first example is actually Newtons second law (force equals mass times accelerationfor objects with constant mass) for a spring-mass system: m >0[kg] is the mass attachedto a spring with spring force constant k >0[N/m]; the termky(t) is the spring force,which is proportional to, but in opposite direction of the extension y(t) of the spring.

    The massm is oscillating under influence of a drag force bdy(t)dt

    (b >0) proportional to,

    but in opposite direction of the velocity of the mass, given by dy(t)dt

    . The last quantity isthe rate-of-change of the extension of the spring y(t). The boxed differential equation isa second-order linear homogeneous differential equation with constant coefficients.

    Firstly, it is a second-order differential equation, because the differential equationcontains the second derivative of the function y(t).

    Secondly, it is alineardifferential equation, since it contains only terms involving thefunctiony(t) and derivatives of that function. This implies that, ify1(t) is a solutionof the differential equation,i.e. y1(t) satisfies

    md2y1(t)dt2

    +b dy1(t)dt

    +ky1(t) = 0, (1.3)

    then c1y1(t) with c1 an arbitrary constant also satisfies the differential equation,because

    d

    dtc1y1(t) =c1

    dy1(t)

    dt ,

    d2

    dt2c1y1(t) =c1

    d2y1(t)

    dt2 . (1.4)

    Inserting these in the differential equation gives

    mc1d2y1(t)

    dt2 +bc1

    dy1(t)

    dt +kc1y1(t) = 0. (1.5)

    After dividing by the constant c1, we get the original differential equation back, i.e.

    the differential equation for which y1(t) was a solution. Furthermore, if y1(t) andy2(t) are two different solutions of the differential equation, then y1(t) + y2(t) is also asolution of the differential equation. The statementy1(t) is a solution of the differentialequation implies that y1(t) satisfies again

    md2y1(t)

    dt2 +b

    dy1(t)

    dt +ky1(t) = 0. (1.6)

    1

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    4/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Similar for y2(t); it satisfies

    md2y2(t)

    dt2 +b

    dy2(t)

    dt +ky2(t) = 0. (1.7)

    But

    ddt

    (y1(t) +y2(t)) = dy1(t)dt

    + dy2(t)dt

    , d2

    dt2(y1(t) +y2(t)) = d

    2

    y1(t)dt2

    + d2

    y2(t)dt2

    . (1.8)

    Insertingy1(t) +y2(t) in the differential equation gives

    md2

    dt2(y1(t) +y2(t)) +b

    d

    dt(y1(t) +y2(t)) +k(y1(t) +y2(t)) = 0, (1.9)

    but this can be written asm

    d2y1(t)

    dt2 +b

    dy1(t)

    dt +ky1(t)

    +

    m

    d2y2(t)

    dt2 +b

    dy2(t)

    dt +ky2(t)

    = 0. (1.10)

    Both sums between square brackets amount to zero, so the equality holds. Combiningthese two results gives the following: a differential equation is a linear differentialequation, if, fory1(t) andy2(t) being solutions of the differential equation, c1y1(t) +c2y2(t) is also a solution of the differential equation for every pair of constantsc1 andc2.

    Thirdly, the differential equation under discussion is a homogeneous differentialequation, since the right-hand side of the differential equation is zero. One shouldfirst bring all terms involving y(t) and its derivatives to the left-hand side and allterms involving t and constants to the right-hand side of the differential equation.If the right-hand side is zero, then the differential equation is homogeneous. If theright-hand side is not zero, then the differential equation is inhomogeneous.

    Finally, this differential equation is a differential equation with constant coefficients,since the parameters m, k, and b are all constants.

    In the remainder of this document, we will discuss how to solve this type of differentialequation.The second example is Newtons cooling law. The quantity y(t) represents the temper-ature of, for instance, the coffee in a mug. Because the hot coffee will release heat tothe environment, the temperature of the coffee will go down. The rate-of-change of thetemperature dy(t)

    dt is proportional to the difference of the current temperature of the coffee

    and the ambient temperature, the temperature of the environment Ta. The proportional-ity constant isk . The larger the temperature difference, the faster the coffee cools down.From the discussion so far, it should be clear that this differential equation is a first-order (since only the first derivative ofy(t) is present)linear(only terms involvingy(t)and its derivative) inhomogeneous (since the right-hand of the differential equation is

    not zero) differential equation with constant coefficients (since k is a constant).

    2 Solving Linear Homogeneous Differential Equations with ConstantCoefficients

    Although first-order and second-order linear homogeneous differential equations withconstant coefficients are solved in exactly the same way, we will first discuss how to

    2

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    5/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    solve first-order linear homogeneous differential equations and secondly the second-orderversion. Solving inhomogeneous linear differential equations will be discussed in the nextsection.

    2.1 The Solution of a First-Order Linear Homogeneous DifferentialEquation

    In general we can write a first-order linear homogeneous differential equation down as

    ady(t)

    dt +by(t) = 0, {a, b} R. (2.1)

    This equation tells us that we should be looking for a function y(t), such that when youmultiply the first derivative of that function by the constant a and you add b times theoriginal function to that result, it amounts to zero. What is that function?? This is not

    so straightforward to answer! But, it suggests that the derivative of the function dy(t)dtis proportional to the function y(t) itself. There is a function with this property: theexponential function y(t) = A exp(t). We propose that this function is the solution ofthe differential equation. Settingy(t) =A exp(t) implies

    dy(t)

    dt =A exp(t) =y(t), (2.2)

    such that

    ady(t)

    dt +by(t) = 0 ay(t) +by(t) = 0. (2.3)

    Dividing by y(t) amounts to the characteristic equation

    a+b= 0. (2.4)

    Solving this equation for gives = ba

    and the general solution or family ofsolutions is

    y(t) =A exp

    b

    at

    , A R. (2.5)

    The value of the constant A can be found by using an initial condition, if given;y(0) =y0. Inserting this initial condition in the solution gives

    y(t= 0) =A exp (0) =A = y0. (2.6)

    If the initial condition y(0) =y0 is given, then the solution of the differential equation isy(t) =y0exp( bat).

    3

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    6/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 2.1. Solving a first-order linear homogeneous differential equationFind the exact solution of the following differential equation:

    dy(t)

    dt + 2y(t) = 0, y(0) = 4. (2.7)

    This differential equation is a first-order linear homogeneous differential equation withconstant coefficients. Therefore, its solution is of the form y(t) =A exp(t), such that

    the first derivative of this function becomes y(t) = dy(t)dt

    =A exp(t) =y(t). Insert-ing this in the differential equation gives

    dy(t)

    dt + 2y(t) =y(t) + 2y(t) = 0, (2.8)

    which amounts to, after dividing by the function y(t), the characteristic equation+2 =0 or =2. Hence, y(t) = A exp(2t). Using the initial condition; y(0) = 4 givesy(0) = A = 4, such that the exact solution of the differential equation is y(t) =

    4exp(2t). CHECK: differentiate this function with respect to t to obtaindy(t)

    dt =

    d

    dt[4 exp(2t)] = 8exp(2t). (2.9)

    Finally, insert the first derivative and the solution in the differential equation to get

    dy(t)

    dt + 2y(t) = 8 exp(2t) + 2 4 exp(2t) = 0, (2.10)

    which is indeed correct!

    2.2 The Solution of a Second-Order Linear Homogeneous DifferentialEquation

    A second-order linear homogeneous differential equation with constant coefficients isdefined by

    ad2y(t)

    dt2 +b

    dy(t)

    dt +cy(t) = 0, {a,b,c} R. (2.11)

    We argue again that the general form of the solution of such a differential equation is anexponential function, since any derivative of an exponential function is proportional tothat exponential function. Thus, writingy(t) =A exp(t) implies

    dy(t)

    dt =A exp(t) =y(t),

    d2y(t)

    dt2 =

    2

    A exp(t) =

    2

    y(t). (2.12)Inserting these in the differential equation gives

    a2y(t) +by(t) +cy(t) = 0. (2.13)

    Dividing by the function y (t) amounts to the characterisitic equation

    a2 +b+c= 0. (2.14)

    4

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    7/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    This equation is quadratic in . Note that a first-order linear homogeneous differentialequation amounts to a characteristic equation of first-degree in , a second-order linearhomogeneous differential equation amounts to a characteristic equation of second-degreein , and so forth. The solutions of the characteristic equation are

    1,2=b

    b

    2

    4ac2a . (2.15)

    This result suggests that different solutions are possible:

    Ifb24ac >0, then b2 4acis a real number and1and2 are two distinct realnumbers. The general solution of the differential equation follows then as a linearcombination of two distinct real exponential functions:

    y(t) =C1exp(1t) +C2exp(2t), {1, 2} R (2.16)

    where the values of the constants C1 and C2 follow from 2 initial conditions; for

    instance y (0) =y0 and dy(t)

    dt t=0 =y 0. Ifb2 4ac= 0, then 1= 2= and there is only one distinct root of the char-acteristic equation. In this case, the general solution of the differential equationfollows as

    y(t) = (C1+C2t)exp(t). (2.17)

    This solution can be considered as a combination of two identical exponential func-tions, where one of them is multiplied byt. Again, the values of the constants C1 and

    C2 follow from 2 initial conditions; for instance y(0) = y0 and dy(t)

    dt

    t=0

    = y0. Note

    that you must use the product rule for differentiation here in order to get dy(t)dt

    !

    If b2 4ac < 0, then b2 4ac is actually the square-root of a negative number,which is purely imaginary! Consequently, we can write1,2= r

    ii, withr =

    b

    2athe real part of the solution of the characteristic equation and i = 12a4ac b2

    the imaginary part of the solution of the characteristic equation. The solutions ofthe characteristic equation are two complex numbers, which are each otherscomplex conjugate. The general solution follows now as

    y(t) =C1exp[(r+ ii)t] +C2exp[(r ii)t], {C1, C2} C. (2.18)

    This looks pretty awful; complex exponential functions and complex constants C1and C2. We are going to simplify this expression. First of all, realize that we willlimit ourselves to real-valued functions y(t); tandy are real numbers and so are thederivatives of y(t). Furthermore, the constant a, b, and c are also real numbers. in

    other words, we must set the imaginary part of the solution equal to zero. Lets firstexpand the exponential function, since exp(a+b) = exp a exp b:

    y(t) =C1exp rt exp iit+C2exp rt exp(iit) (2.19)Both terms have an exp rtin common; taking this factor apart gives

    y(t) = exp rt [C1exp iit+C2exp(iit)] . (2.20)

    5

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    8/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Now we can use the Euler formulas and write the complex exponential function asa cosine and a sine multiplied by i; exp(ix) = cos x i sin x. We will also makeexplicit thatC1 andC2 are complex numbers and write them as C1 = C1r+ iC1i andC2= C2r + iC2i, where the indexr means the real part and the index i the imaginarypart. Note thatC1r,C2r,C1i andC2i are all real numbers. We now get the following:

    y(t) = exp rt [(C1r+iC1i)(cos it+i sin it) + (C2r+iC2i)(cos it i sin it)] .(2.21)

    The part between square brackets consists of two terms and each term is the productof two factors of two terms. Expanding all this amounts to eight terms. Here theyare, remember that i2 = 1:

    y(t) = exp rt[ C1rcos it+iC1rsin it

    C1isin it+iC1icos it+C2rcos it iC2rsin it+C2isin it+iC2icos it] (2.22)

    There are four real terms and four imaginary terms; actually, there is a pair of realcosines and a pair of real sines and there is a pair of imaginary cosines and a pair ofimaginary sines. Collecting these pairs of terms gives

    y(t) = exp rt [(C1r+C2r)cos it+i(C1r C2r)sin it+(C1i+C2i)sin it+i(C1i+C2i)cos it] . (2.23)

    Now, we can set the imaginary part equal to zero by setting C1r C2r = 0 and(C1i+ C2i) = 0. Finally, we will replace C1r+ C2r byA andC1i+ C2i byB andobtain the following:

    y(t) = exp rt (A cos it+Bsin it) , (2.24)

    where r is the real part of the solutions of the characteristic equation and i is theimaginary part of the solutions of the characteristic equation. The constants A andB follow from the two initial conditions. In the last result,{A ,B,r, r} R.

    There is one special case in the previous part and that one is related to a second-orderlinear differential equation of the form

    ad2y(t)

    dt2 +cy(t) = 0,

    {a, c

    } R. (2.25)

    This differential equation misses the term containing the first derivative ofy(t); ac-tually b= 0! The characteristic equation related to this differential equation reducesto

    a2 +c= 0 1,2= c

    a. (2.26)

    6

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    9/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    This implies that if a and c have opposite signs, one is negative and the other ispositive, then the square-root amounts to two real numbers 1= 2= , which areeach other opposites. The solution is

    y(t) =A exp t+Bexp(t). (2.27)

    Ifa and c have the same sign, then the solutions of the characteristic equation arepurely imaginary:

    1,2= ii= i

    c

    a. (2.28)

    Comparing this with the result of the previous part

    1,2= r ii= b2a i 1

    2a

    4ac b2 (2.29)

    shows that the two results are equal by setting b = 0, and consequently by settingr = 0. Consequently, the solution of this differential equation is

    y(t) =A cos it+Bsin it. (2.30)

    Lets summarize what we have so far for a second-order linear homogeneous differentialequation with constant coefficients of the form

    ad2y(t)

    dt2 +b

    dy(t)

    dt +cy(t) = 0, {a,b,c} R. (2.31)

    Writing the solution of this differential equation as y(t) =A exp tamounts to a charac-teristic equation

    a2 +b+c= 0 1,2=b

    b2

    4ac

    2a . (2.32)

    if1and 2are two distinct real numbers, then the general solution is of the form

    y(t) =C1exp(1t) +C2exp(2t), (2.33)

    if1= 2= is onlyone distinct number, then the general solution is of the form

    y(t) = (C1+C2t)exp(t). (2.34)

    if1 and2 aretwo complex numbers (and each others conjugate) with real partr and imaginary part i, then the general solution is of the form

    y(t) = exp rt (A cos it+Bsin it) , (2.35)

    ifb= 0 and 1 = 2 = are two purely imaginary numbers (and each othersconjugate), then the general solution is of the form

    y(t) =A cos t+Bsin t. (2.36)

    7

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    10/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Here are a number of examples dealing with the different types of solutions:

    Example 2.2. Solving a second-order linear homogeneous differential equation withtwo distinct positive integral rootsFind the exact solution of the following differential equation:

    d2y(t)

    dt2 5 dy(t)

    dt + 6y(t) = 0, y(0) = 1,

    dy(t)

    dt

    t=0

    = 1. (2.37)

    The general solution of a linear differential equation is y(t) =A exp t, and thus dy(t)dt

    =

    A exp t= y(t), and d2y(t)dt2

    =2A exp t= 2y(t). Inserting these in the differentialequation and dividing by y (t) yields the characteristic equation:

    2 5+ 6 = ( 2)( 3) = 0. (2.38)

    The roots of this characteristic equation are = 2 and = 3. Hence, the generalsolution is

    y(t) =A exp2t+Bexp 3t. (2.39)

    The first derivative of this solution follows as

    dy(t)dt

    = 2A exp(2t) + 3Bexp(3t). (2.40)

    Inserting the initial conditions y(0) = 1 andy (0) = 1 yield the following two equationsin terms ofA and B :

    1 = A+B1 = 2A+ 3B

    (2.41)

    From the first equation follows B= 1A. Inserting this in the second equation yields1 = 2A+ 3 3A or A = 2, and hence B = 1. The exact solution is therefore

    y(t) = 2 exp2t exp3t. (2.42)

    Check:d2y(t)dt2

    = 8 exp 2t 9exp3t5dy(t)

    dt = 20exp2t+ 15exp 3t

    +6y(t) = 12 exp 2t 6exp3t+0 = (8 20 + 12) exp 2t+ (9 + 15 6)exp3t

    (2.43)

    8

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    11/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 2.3. Solving a second-order linear homogeneous differential equation withtwo distinct, one positive and one negative, integral roots:Find the exact solution of the following differential equation:

    d2y(t)

    dt2 +dy (t)

    dt 6y(t) = 0, y(0) = 0,dy(t)

    dtt=0

    = 1. (2.44)

    The general solution of a linear homogeneous differential equation is y(t) = A exp t,

    and thus dy(t)dt

    = A exp t = y(t), and d2y(t)dt2

    = 2A exp t = 2y(t). Inserting thesein the differential equation and dividing by y(t) yields the characteristic equation:

    2 + 6 = (+ 3)( 2) = 0. (2.45)

    The roots of this characteristic equation are =3 and = 2. Hence, the generalsolution is

    y(t) =A exp(3t) +Bexp(2t). (2.46)The first derivative follows as

    dy(t)

    dt = 3A exp(3t) + 2Bexp 2t. (2.47)

    Inserting the initial conditions y(0) = 0 andy (0) = 1 yield the following two equationsin terms ofA and B :

    0 = A+B1 = 3A+ 2B (2.48)

    From the first equation follows B =A. Inserting this in the second equation yields1 = 3A 2Aor A = 15 , and hence B= 15 . The exact solution is therefore

    y(t) = 15

    exp(3t) +15

    exp 2t. (2.49)

    Check:d2y(t)dt2

    = 95exp(3t) + 45exp 2tdy(t)dt

    = 35exp(3t) + 25exp 2t6y(t) = 65exp(3t) 65exp 2t+

    0 =95+ 35 + 65 exp2t+ 45+ 25 65 exp3t

    (2.50)

    9

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    12/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 2.4. Solving a second-order linear homogeneous differential equation withtwo distinct rational roots:Find the exact solution of the following differential equation:

    8d2y(t)

    dt2 6dy(t)

    dt +y(t) = 0, y(0) = 1,dy(t)

    dtt=0

    = 2 (2.51)

    The general solution of a linear homogeneous differential equation is y(t) = A exp t,

    and thus dy(t)dt

    = A exp t = y(t), and d2y(t)dt2 =

    2A exp t = 2y(t). Inserting thesein the differential equation and dividing by y(t) yields the characteristic equation:

    82 6+ 1 = 0. (2.52)

    The roots of this characteristic equation follow from

    1,2=6 36 4 8 1

    16 =

    6 216

    = 12 =

    1

    4. (2.53)

    Hence, the general solution is

    y(t) =A exp1

    2t+Bexp

    1

    4t. (2.54)

    The first derivative of this solution follows as

    dy(t)

    dt =

    1

    2A exp

    1

    2t+

    1

    4Bexp

    1

    4t. (2.55)

    Inserting the initial conditions y(0) = 1 andy (0) = 2 yield the following two equationsin terms ofA and B : 1 = A+B2 = 12A+ 14B (2.56)From the first equation follows B= 1A. Inserting this in the second equation yields2 = 12A+

    14 14A or 14A = 74 or A = 7, and hence B =6. The exact solution is

    therefore

    y(t) = 7 exp1

    2t 6exp1

    4t. (2.57)

    Check:8d

    2y(t)dt2

    = 14 exp 12t 3exp 14t6dy(t)

    dt = 21exp 12t+ 9 exp 14t

    y(t) = 7 exp 12t 6exp 14t+0 = (14 21 + 7) exp

    1

    2t+ (3 + 9 6)exp1

    4t

    (2.58)

    10

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    13/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 2.5. Solving a second-order linear homogeneous differential equation withwith one distinct positive integral root: Find the exact solution of the following differ-ential equation:

    d2y(t)

    dt2 6dy(t)

    dt + 9y(t) = 0, y(0) = 0,dy(t)

    dtt=0

    = 2 (2.59)

    The general solution of a linear homogeneous differential equation is y(t) = A exp t,

    and thus dy(t)dt

    = A exp t = y(t), and d2y(t)dt2

    = 2A exp t = 2y(t). Inserting thesein the differential equation and dividing by the function y(t) yields the characteristicequation:

    2 6+ 9 = ( 3)2 = 0. (2.60)The root of this characteristic equation is = 3. Hence, the general solution is

    y(t) = (A+Bt)exp3t. (2.61)

    The first derivative of this function, using the product rule for differentiation, followsas

    y(t) =Bexp 3t+ 3(A+Bt)exp3t= (3A+B+ 3Bt)exp3t. (2.62)

    Inserting the initial conditionsy(0) = 0 andy(0) = 2 yields the following two equationsin terms ofA and B :

    0 = A2 = 3A+B

    (2.63)

    From the first equation follows A = 0, and from the second equation B = 2. The exactsolution is therefore

    y(t) = 2t exp3t. (2.64)

    Check:

    d2y(t)dt2

    = (6 exp 3t) + (6 exp 3t+ 18t exp3t)

    6dy(t)dt

    = 6(2exp3t+ 6t exp3t)9y(t) = 9(2t exp3t) +

    0 = 12 exp 3t+ 18t exp3t 12exp3t 36t exp3t+ 18t exp3t(2.65)

    11

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    14/44

    2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 2.6. Solving a second-order linear homogeneous differential equation withtwo complex roots:Find the exact solution of the following differential equation:

    d2y(t)

    dt2 2dy(t)

    dt + 4y(t) = 0, y(0) = 1,dy(t)

    dtt=0

    = 2 (2.66)

    The general solution of a linear homogeneous differential equation is y(t) = A exp t,

    and thus dy(t)dt

    =A exp t= y(t), and d2y(t)dt2

    =2A exp t= 2y(t). Inserting this inthe differential equation yields the characteristic equation:

    2 2+ 4 = 0. (2.67)

    The roots of this characteristic equation follow from

    1,2=2 4 16

    2 = 1 +i

    3= 1 i

    3. (2.68)

    Hence, the general solution is

    y(t) =C1exp((1 +i

    3)t) +C2exp((1 i

    3)t). (2.69)

    The real part of this solution is, with new constants Aand B :

    y(t) = exp t

    A cos t

    3 +Bsin t

    3

    . (2.70)

    The first derivative of this solution, using again the product rule for differentiationfollows as

    dy(t)dt

    = exp t A cos t3 +Bsin t3 + exp t A3sin t3 +B3cos t3 (2.71)Inserting the initial conditionsy(0) = 1 andy(0) = 2 yields the following two equationsin terms ofA and B (sin0 = 0, cos 0 = 1):

    1 = A

    2 = A+B

    3 (2.72)

    The first equation givesA = 1. Inserting this in the second equation yields 2 = 1+

    3Bor B = 1

    3. The exact solution is therefore

    y(t) = exp t cos t3 + 13

    sin t3 . (2.73)By differentiating this function twice and inserting these results in the differential equa-tion, one can check that this is the correct result.

    12

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    15/44

    3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS

    Example 2.7. Solving a second-order linear homogeneous differential equation withtwo purely imaginary roots:Find the exact solution of the following differential equation:

    d2y(t)

    dt2 + 4y(t) = 0, y(0) = 1,dy(t)

    dtt=0

    = 2 (2.74)

    Note that this is the same differential equation as in the previous example, except forthe term containing the first derivative.The general solution of a linear homogeneous differential equation is y(t) = A exp t,

    and thus dy(t)dt

    =A exp t= y(t), and d2y(t)dt2

    =2A exp t= 2y(t). Inserting this inthe differential equation yields the characteristic equation:

    2 + 4 = 0 2 = 4 = 2i. (2.75)

    Hence, the general solution is

    y(t) =A cos2t+Bsin 2t. (2.76)

    The first derivative of this solution follows as

    dy(t)

    dt = 2A sin2t+ 2Bcos 2t (2.77)

    Inserting the initial conditionsy(0) = 1 andy(0) = 2 yields the following two equationsin terms ofA and B (sin0 = 0, cos 0 = 1):

    1 = A2 = 2A+ 2B (2.78)

    The first equation givesA = 1. Inserting this in the second equation yields 2 = 2+2Bor B = 2. The exact solution is therefore

    y(t) = cos 2t+ 2 sin 2t. (2.79)

    Check:d2y(t)dt2

    = 4cos2t 8sin2t4y(t) = 4 cos 2t+ 8 sin 2t+

    0 = (4 + 4) cos 2t+ (8 + 8) sin 2t(2.80)

    3 Solving Inhomogeneous Linear Differential Equations

    Thus far we have considered first and second-order linear homogeneous differential equa-tions of the form

    ad2y(t)

    dt2 +b

    dy(t)

    dt +cy(t) = 0, {a,b,c} R (3.1)

    13

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    16/44

    3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS

    and we have discussed how to find the solution of such a differential equation. The generalsolution, for instancey(t) =A exp 1t+Bexp 2tsatisfies the differential equation, whichmeans that after inserting this solution in the differential equation, we get zero equalszero. Now, we will discuss how to solve an inhomogeneous differential equation, i.e. adifferential equation where the right-hand side is not zero, but, for instance, 4 or 4t+ 3

    or sin2t or exp(t). What we are going to do is to TRY a solution by inserting itin the inhomogeneous differential and see if it holds or not; if it holds then the trialsolution is correct and the trial function is then called the particular solution of theinhomogeneous differential equation. If it fails, then we must try another trial function.The challenge is, obviously, to choose the right trial solution. Here are somes rules ofthumb:

    If the right-hand side of the inhomogeneous differential equation is a constant, thenthe particular solution is also a constant.

    If the right-hand side of the inhomogeneous differential equation is proportional tot, lets say 3t, then try as particular solution y(t) = at+ b. If this fails, then tryat2 +bt+c. If this fails, then try a general third-degree polynomial as solution, etc.

    If the right-hand side of the inhomogeneous differential equation is an exponentialfunction, lets say 3 exp(t), then try as particular solution y(t) = a exp(t), suchthat the exponents are identical. If this fails, then try (at+b) exp(t). If this fails,then try (at2 +bt+c)exp(t), etc.

    If the right-hand side of the inhomogeneous differential equation is a sine or a cosine,lets say 2 cos 2t, then try as particular solution y (t) =a cos2t+b sin2t.

    If the right-hand side of the inhomogeneous differential equation is t times an expo-nential function, lets sayt exp2t, then try as particular solution y(t) = (at+b)exp2t.If this fails, then try y(t) = (at2 +bt+c)exp2t, etc.

    If the right-hand side of the inhomogeneous differential equation is of the form

    exp(t)cos2tor exp(t)sin2t, then try as particular solutiony(t) = exp(t)(a cos2t+b sin2t).

    Below are some examples showing how to find the particular solution:

    Example 3.1. The particular solution of an inhomogeneous differential equation:Find the particular solution of the following differential equation:

    2d2y(t)

    dt2 2 dy(t)

    dt + 2y(t) = 4. (3.2)

    The right-hand side of this differential equation is a constant. TRY as particular so-lution a constant: y(t) = a, such that dy(t)

    dt = 0, and d

    2y(t)dt2

    = 0. Inserting these in thedifferential equation gives

    2a= 4 a= 2. (3.3)We conclude that the particular solution of this differential equation is y(t) = 2.

    14

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    17/44

    3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS

    Example 3.2. The particular solution of an inhomogeneous differential equation:Find the particular solution of the following differential equation:

    2d2y(t)

    dt2 2 dy(t)

    dt + 2y(t) = 3t. (3.4)

    The right-hand side of this differential equation is linear int. TRY as particular solution

    a linear function in t:y (t) =at+b, such that dy(t)dt

    =a, and d2y(t)dt2

    = 0. Inserting thesein the differential equation gives

    2 0 2a+ 2(at+b) = 3t. (3.5)

    Collecting terms involving t and constants gives

    (2a 3)

    =0

    t+ (2b 2a)

    =0

    = 0. (3.6)

    since this equation must be true for all values oft. Hencea = 32 andb = 32 . We concludethat the particular solution of this differential equation is

    y(t) =3

    2t+

    3

    2. (3.7)

    Example 3.3. The particular solution of an inhomogeneous differential equation:Find the particular solution of the following differential equation:

    d2y(t)dt2

    + 2 dy(t)dt

    +y(t) =t2 4. (3.8)

    The right-hand side of this differential equation is a polynomial of degree 2 in t. TRYas particular solution a quadratic polynomial in t:y(t) =at2 + bt + c, such that dy(t)

    dt =

    2at+b, and d2y(t)dt2

    = 2a. Inserting these in the differential equation gives

    (2a) + 2(2at+b) + (at2 +bt+c) =t2 4 (3.9)

    Collecting terms involving t2, t and constants gives

    (a

    1) =0 t

    2 + (4a+b) =0 t+ (2a+ 2b+c+ 4) =0 = 0. (3.10)since this equation must be true for all values oft. Hence a = 1 and b = 4 andc = 2.We conclude that the particular solution of this differential equation is

    y(t) =t2 4t+ 2. (3.11)

    15

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    18/44

    3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS

    Example 3.4. The particular solution of an inhomogeneous differential equation:Find the particular solution of the following differential equation:

    d2y(t)

    dt2 + 2

    dy(t)

    dt +y(t) = 2 exp(t). (3.12)

    The right-hand side of this differential equation is an exponential function. TRY asparticular solution a similar exponential function: y(t) = a exp(t), such that dy(t)

    dt =

    a exp(t) =y(t), and d2y(t)dt2

    = a exp(t) = y(t). Inserting these in the differentialequation gives

    a exp(t) 2a exp(t) +a exp(t) = 0 = 2exp(t), (3.13)

    which does not hold for all values of t. This trial function fails. Lets TRY y(t) =

    (at+b) exp(t), such that, using the product rule for differentiation, dy(t)dt

    =a exp(t)(at+b)exp(t) = (at+ab) exp(t), and d2y(t)

    dt2 = a exp(t)(at+ab) exp(t) =

    (at 2a+b) exp(t). Inserting this in the differential equation gives(at 2a+b)exp(t) + 2(at+a b)exp(t) + (at+b) exp(t) = 2 exp(t). (3.14)

    After dividing by exp(t), this reduces to

    (at 2a+b) + 2(at+a b) + (at+b) = 2. (3.15)

    Collecting terms involvingtand constants gives 0 = 2. In other words, this trial functionalso fails. Dont get desperate now. Lets TRY

    y(t) = (at2 +bt+c) exp(t)dy(t)

    dt = (2at+b) exp(t) (at2

    +bt+c)exp(t)= (at2 + (2a b)t+b c)exp(t)d2y(t)dt2

    = (2at+ 2a b)exp(t) (at2 + (2a b)t+b c)exp(t)= (at2 (4a b)t+ 2a 2b+c) exp(t)

    (3.16)

    Inserting these in the differential equation gives

    (at2 (4a b)t+ 2a 2b+c) exp(t)+2(at2 + (2a b)t+b c) exp(t)

    +(at2 +bt+c) exp(t) = 2 exp(t).(3.17)

    Dividing by exp(t) gives

    (at2 (4a b)t + 2a 2b + c) + 2 (at2 + (2a b)t + b c) + (at2 + bt + c) = 2. (3.18)

    16

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    19/44

    4. THE COMPLETE SOLUTION OF AN INHOMOGENEOUS LINEAR

    DIFFERENTIAL EQUATION

    Collecting terms involving t2, t and constants gives

    (0)t2 + (0)t+ (2a 2) = 0. (3.19)

    This must be zero for all values of t. Hence, a = 1. Finally, we found the particularsolution by trial and error:

    y(t) =t2 exp(t). (3.20)

    4 The Complete Solution of an Inhomogeneous Linear DifferentialEquation

    The examples in the previous section show that finding the particular solution is reallya matter of trial and error. The particular solution, however, is only part of the solution;

    it is not the complete solution! Why not? Well, we can always add zero to the right-handside of the differential equation; it does not change a thing. But then we write zero in theform of the general solution of the homogeneous form of the inhomogeneous differentialequation. The solution of the homogeneous form of the differential equation is calledthe complementary solution. Note that the complementary solution contains unknownconstants that are determined by the initial conditions. The particular solution is unique.The combination of the complementary function and the particular solution forms thecomplete solution of the differential equation. Below follows an example that shows youhow to find the complete solution of a second-order linear inhomogeneous differentialequation with constant coefficients.

    Example 4.1. The complete solution of an inhomogeneous differential equation:Find the complete solution of the following inhomogeneous linear differential equation:

    d2y(t)

    dt2 5 dy(t)

    dt + 6y(t) = 4t+ 2, y(0) = 1,

    dy(t)

    dt

    t=0

    = 1. (4.1)

    Lets first try to find the particular solution. The right-hand side of the equation islinear in t. Lets TRY as particular solution a linear function in t: y(t) =at +b, such

    that dy(t)dt

    =a and d2y(t)dt2

    = 0. Inserting thse in the differential equation gives

    5a+ 6(at+b) = 4t+ 2

    (6a

    4)t+ (

    5a+ 6b

    2) = 0. (4.2)

    This must hold for all values of t. Hence, 6a = 4 or a = 23 and 103 + 6b 2 = 0 or6b= 163 or b=

    1618 =

    89 and the particular solution is apparently

    y(t) =2

    3t+

    8

    9. (4.3)

    17

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    20/44

    4. THE COMPLETE SOLUTION OF AN INHOMOGENEOUS LINEAR

    DIFFERENTIAL EQUATION

    The homogeneous form of the differential equation is

    d2y(t)

    dt2 5 dy(t)

    dt + 6y(t) = 0 (4.4)

    The characteristic equation is

    2 5+ 6 = ( 2)( 3) = 0 = 2

    = 3. (4.5)

    The general solution of the homogeneous differential equation is

    y(t) =A exp2t+Bexp 3t. (4.6)

    The complete solution including the two unknown constants is

    y(t) =A exp2t+Bexp 3t+2

    3t+

    8

    9. (4.7)

    The first derivative of this solution follows as

    dy(t)

    dt = 2A exp2t+ 3Bexp 3t+

    2

    3. (4.8)

    Applying the boundary conditionsy(0) = 1 and y(0) = 1 amounts to two equations:A+B+ 89 = 12A+ 3B+ 23 = 1

    A+B = 192A+ 3B= 13

    (4.9)

    Multiplying the first equation by 2 and subtracting it from the second equation gives

    2A+ 3B= 132A+ 2B= 29B = 19

    (4.10)

    Multiplying the first equation by 3 and subtracting the second equation from it gives

    3A+ 3B= 132A+ 3B= 13A = 0

    (4.11)

    Conclusion the complete solution of the second-order linear inhomogeneous differentialequation is the sum of the complementary function and the particular solution:

    y(t) =1

    9exp 3t+

    2

    3t+

    8

    9. (4.12)

    18

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    21/44

    5. LINEAR DIFFERENCE EQUATIONS WITH CONSTANT COEFFICIENTS

    5 Linear Difference Equations with Constant Coefficients

    In the previous sections, we have discussed linear differential equations with constantcoefficients. We will now focus on linear difference equations with constant coefficients.A linear difference equation is an equation of the form

    un+1= 3un+ 4n+ 2, u0= 0. (5.1)

    To be more precise, this is a first-order linear inhomogeneous difference equation withconstant coefficients. Difference equations are also called recurrence equations. A recur-rence equation generates a list of numbers, where, as in this case, the next number on thelist depends on the current number on the list and on n. Here, the first number on the listis given:u0= 0. We can find the value ofu1 by settingn = 0 in the equation. This yieldsu1 = 3u0 + 4 0+2 = 2. The value ofu2 follows as, using n = 1,u2= 3u1 + 4 1 + 2 = 12.Insertingn = 2 gives u3= 3u2+ 4 2 + 2 = 46. It is clear that the numbersun in the listare getting larger and larger. Continuing these calculations allows for finding all valuesofun, but it requires a lot of work! In order to find the value ofu20, we need to find allvalues of the preceding un in the list. The challenge will be to find a way to solve this

    difference equation, such that we get an expression for un just in terms ofn and not interms ofun1. We will see that the strategy to solve these linear difference equations isalmost identical to the strategy for solving linear differential equations.The order of a linear differential equation was determined by the types of derivativesin the differential equation: a second-derivative gives rise to a second-order differentialequation. In the case of linear difference equations, we must consider the largest differenceof the indices. In the example given above, the index ofun+1is n+1 and the index ofunissimplyn. Hence, the difference in indices is one and the difference equation is first-order.The difference equations

    un+ 2un1+un2= 0, un+2+ 2un+1+un = 0. (5.2)

    are both second-order. The last two difference equations are also homogeneous, since theright-hand side of the difference equation is zero. The first example given in this sectionis an inhomogeneous difference equation, since it can be written as

    un+1 3un = 4n+ 2, u0= 0. (5.3)The linearity property of linear difference equations implies that ifu1[n] andu2[n] are twodifferent solutions of the difference equation, then any linear combinationc1u1[n]+c2u2[n]is also a solution of the difference equation. Note that u1[n] and u2[n] represent twodiscrete functions taking only integral numbers n as input; n = 0, 1, 2, . . .. Note thatthe output can be any real number. We will limit ourselves here to real-valued discretefunctionsu[n].

    6 Solving Linear Homogeneous Difference Equations with ConstantCoefficients

    In analogy to solving linear differential equations, we will first discuss how to solve first-order linear homogeneous difference equations and secondly how to solve second-orderlinear homogeneous difference equations.

    19

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    22/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    6.1 Solution of a First-Order Linear Homogeneous Difference Equation

    The general form of a first-order linear homogeneous difference equation is

    aun+1+bun = 0, {a, b} R. (6.1)

    If we write this difference equation in the form

    un+1= ba

    un, (6.2)

    then we see that the next number in the list is simply the current number in the listtimes b

    a. And since that number is also b

    atimes the number before that number, we

    get that the next number in the list is b

    a

    2times the number un1, or

    ba

    3times

    un2 or b

    a

    ntimes u1. This suggests that the general form of the solution of a linear

    difference equation is

    u[n] =un = A

    n

    . (6.3)

    Replacingn by n+ 1 gives

    u[n+ 1] =un+1= An+1 =An= un. (6.4)

    Inserting this in the difference equation gives

    aun+bun = (au[n] +bu[n] =) 0 (6.5)

    Dividing by the solution un (or u[n]) amounts to the characteristic equation

    a+b= 0. (6.6)

    Note that this is the same characteristic equation as the one for a first-order linearhomogeneous differential equation. The solution is = b

    a and the general solution or

    family of solutions is

    u[n] =un = A

    b

    a

    n. (6.7)

    The value of the constant A follows from the initial condition u0 =u[0] =U0. Insertingthis in the solution gives

    u[0] =U0= A b

    a0 =A, (6.8)

    such that the exact solution becomes

    u[n] =un = U0

    b

    a

    n. (6.9)

    20

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    23/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 6.1. Solving a first-order linear homogeneous difference equationFind the exact solution of the following difference equation:

    un+1+ 2un= 0, u0= 4. (6.10)

    This difference equation is a first-order linear homogeneous difference equation withconstant coefficients. Therefore, its solution is of the formun= A

    n, such thatun+1=An =un. Inserting this in the difference equation gives

    An + 2An = 0, u0= 4. (6.11)

    which amounts to, after dividing by the solutionun = An, the characteristic equation

    + 2 = 0 or = 2. Hence,u[n] =A(2)n. Using the initial condition; u[0] = 4 givesu[0] =A = 4, such that the exact solution of the differential equation is u[n] = 4(2)n.CHECK: replace n by n+ 1 in the solution to obtain

    un+1= 4(

    2)n+1 = 4(

    2)n(

    2) =

    8(

    2)n. (6.12)

    Finally, insert this and the solution in the difference equation to get

    un+1+ 2un= 0 = 8(2)n + 2 4(2)n = 0, (6.13)

    which is indeed correct! Compare this with the example of a first-order linear differentialequation.

    There are some subtle differences between first-order linear homogeneous difference anddifferential equations. The general form of the solution of a differential equation is

    y(t) = A exp(t) = Aet, whereas the general form of the solution of a difference equa-tion is u[n] = An. If is negative, then the solution of the differential equation is anexponentially decaying function. The solution of the difference equation is an oscillatingdiscrete function. Oscillating means that the sign of the values changes continuously.Furthermore, if the absolute value of is smaller than one, the solution of the differenceequation is decaying and if the absolute value of is larger than one, then the solutionof the difference equation is growing exponentially.

    21

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    24/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 6.2. Overview of solutions of first-order linear homogeneous difference equa-tionsHere are four different first-order linear difference equations with their solutions basedon two different initial conditions:

    un+1+ 2un = 0, u0= 1 u[n] = (2)nun+1+ 2un = 0, u0= 1 u[n] = (2)nun+1 2un = 0, u0= 1 u[n] = 2nun+1 2un = 0, u0= 1 u[n] = 2nun+1+

    12un = 0, u0= 1 u[n] =

    12nun+1+

    12un = 0, u0= 1 u[n] =

    12nun+1 12un = 0, u0= 1 u[n] =

    12n = 2nun+1 12un = 0, u0= 1 u[n] =

    12n = 2n(6.14)

    Make sure that you understand where these solutions come from. The first two solu-tions are oscillating and growing. The third and fourth solution are also growing; the

    third positively, the second one negatively. The fifth and the sixth solution are againoscillating, but now decaying. The seventh and the eighth solution are also decaying;the seventh one with positive values, the last one with negative values. Fig. 6.1showsthese solutions.

    22

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    25/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    2 4 6 8 10n

    500

    500

    1000

    2n

    2 4 6 8 10n

    1000

    500

    500

    2n

    2 4 6 8 10n

    200

    400

    600

    800

    1000

    2n

    2 4 6 8 10n

    1000

    800

    600

    400

    200

    2n

    2 4 6 8 10n

    0.4

    0.2

    0.2

    0.4

    0.6

    0.8

    1.0

    1

    2

    n

    2 4 6 8 10n

    1.0

    0.80.6

    0.4

    0.2

    0.2

    0.4

    1

    2

    n

    2 4 6 8 10

    n

    0.2

    0.4

    0.6

    0.8

    1.0

    2n

    2 4 6 8 10n

    1.0

    0.8

    0.6

    0.4

    0.2

    2n

    Fig.6.1. Different possible solutions of first-order difference equations.

    23

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    26/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    6.2 Solving Second-Order Linear Homogeneous Difference Equations

    The general form of a second-order linear homogeneous difference equation with constantcoefficients is

    aun+2+bun+1+cun = 0, {a,b,c} R. (6.15)

    Considering the similarities between difference and differential equations we have ob-served so far, we expect that the general form of the solution of a second-order linearhomogeneous difference equation is

    un = An, (6.16)

    such that

    un+1= An+1 =An =un, un+2= A

    n+2 =2An =2un. (6.17)

    Inserting these in the difference equation amounts to

    a2un+bun+cun= 0. (6.18)

    Dividing by the solution un gives the characteristic equation

    a2 +b+c= 0. (6.19)

    This characteristic equation is identical to the characteristic equation of the second-orderlinear differential equation. The solutions of the characteristic equation are

    1,2=b b2 4ac

    2a . (6.20)

    This result suggests that different solutions are to be expected:

    Ifb24ac >0, then b2 4acis a real number and1and2 are two distinct realnumbers. The general solution of the difference equation follows then as a linearcombination of two distinct exponential functions:

    u[n] =C1n1 +C2

    n2 , (6.21)

    where the values of the constants C1 and C2 follow from 2 initial conditions; forinstance u[0] =U0 and u[1] =U1.

    If b2

    4ac = 0, then 1 = 2 = and there is only one distinct root of the

    characteristic equation. In this case, the general solution of the difference equationfollows as

    u[n] = (C1+C2n)n. (6.22)

    This solution can be considered as a combination of two identical exponential func-tions, where one of them is multiplied by n. Again, the values of the constants C1and C2 follow from 2 initial conditions; for instance u[0] =U0 and u[1] =U1.

    24

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    27/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    If b2 4ac < 0, then b2 4ac is actually the square-root of a negative number,which is purely imaginary! Consequently, we can write1,2= r ii, withr = b2athe real part of the solution of the characteristic equation and i =

    12a

    4ac b2

    the imaginary part of the solution of the characteristic equation. The solutions ofthe characteristic equation are two complex numbers, which are each others

    complex conjugate. The general solution follows now asu[n] =C1(r+ii)

    n +C2(r ii)n, {C1, C2} C. (6.23)Similar to the second-order linear differential equation, this does not look very friendly!But, we can simplify this as follows. We have found the solution of the characteristicequation in standard form (z= x+iy). Writing the solution in complex exponentialform will solve the problem:

    r ii= || exp(i), (6.24)where|| is the absolute value of the two solutions in standard form defined by|| =

    2r+

    2i and is the argument of the two solutions, = arctan

    ir . Sincethe two solutions are always each others conjugate, the argument of one is the opposite

    of the argument of the other. Inserting this in our solution gives

    u[n] =C1||n exp(in) +C2||n exp(in) (6.25)or

    u[n] = ||n [C1exp(in) +C2exp(in)] . (6.26)This solution is now in exactly the same form as we found for the case of the second-order linear differential equation. Using exactly the same reasoning, we can write thissolution as

    u[n] = ||n [A cos(n) +Bsin(n)] , {A, B} R. (6.27)Here is again the solution of the second-order linear differential equation:

    y(t) = exp rt (A cos it+Bsin it) , (6.28)

    where r is the real part of the solutions of the characteristic equation and i is theimaginary part of the solutions of the characteristic equation. The constants A and Bfollow from the two initial conditions. The structure of the two solutions is identical;an exponential function multiplied by a linear combination of a cosine and a sine. Butthere are some small differences: the exponential function for the difference equationis the absolute value of the solution of the characteristic equation to the power n,whereas the argument of the exponential function of the solution of the differentialequation is thereal part of the solution of the characteristic equation. Furthermore,the argument of the cosine and the sine of the solution of the difference equation is

    n times the argument of the solution of the characteristic equation, whereas theargument of the cosine and the sine of the solution of the differential equation is theimaginary part of the solution of the characteristic equation. Finally, for second-order linear differential equations there was a special case for b = 0. This is not aspecial case for second-order linear differential equations. The argument, as we willsee in the examples, is 2 , such that the argument of the cosine and the sine is

    n2 and

    cos n2 and sinn2 amount to 1, 0, -1.

    25

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    28/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Lets summarize what we have so far for a second-order linear homogeneous differenceequation with constant coefficients of the form

    aun+2+bun+1+cun = 0, {a,b,c} R. (6.29)

    Writing the solution of this differential equation asun= An amounts to a characteristic

    equation

    a2 +b+c= 0 1,2=b

    b2 4ac2a

    . (6.30)

    if1and 2are two distinct real numbers, then the general solution is of the form

    y(t) =C1t1+C2

    t2, (6.31)

    if1= 2= is onlyone distinct number, then the general solution is of the form

    y(t) = (C1+C2n)n. (6.32)

    if1 and2 are two complex numbers (and each others conjugate) with absolute

    value|| and argument , then the general solution is of the form

    y(t) = ||n (A cos n+Bsin n) , (6.33)

    ifb= 0 and 1 = 2 = are two purely imaginary numbers (and each othersconjugate), then the general solution is of the form

    y(t) = ||n A cosn2 +Bsinn2 , (6.34)

    which is an example of the previous solution with = 2 .

    Here are a number of examples dealing with the different types of solutions:

    26

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    29/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 6.3. Solving a homogeneous difference equation with two distinct positiveintegral roots:

    un+2 5un+1+ 6un = 0, u0= 1, u1= 1. (6.35)Rewriting the difference equation as follows

    un+2= 5un+1 6un, (6.36)

    with u0 = 1, and u1 = 1 yields u2 =1, u3 =11, u4 =49, and u5 =179. Thegeneral solution of a linear homogeneous difference equation is un = A

    n, and thusun+1 = A

    n+1 = un, and un+2 = An+2 = 2un. Inserting this in the difference

    equation yields the characteristic equation:

    2 5+ 6 = 0. (6.37)

    The roots of this characteristic equation are = 2 or = 3. Hence, the general solutionis

    un= A(2)n +B(3)n. (6.38)

    Inserting the initial conditionsu0 = 1 and u1= 1 yields the following two equations interms ofA and B:

    1 = A+B1 = 2A+ 3B

    (6.39)

    From the first equation follows B= 1A. Inserting this in the second equation yields1 = 2A+ 3 3A or A = 2, and hence B = 1. The exact solution is therefore

    un = 2(2)n (3)n. (6.40)

    Checking the result for n= 2 yields u2 = 8

    9 =

    1, for n= 3 u3 = 16

    27 =

    11,

    forn= 4 u4= 32 81 = 49.

    27

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    30/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 6.4. Solving a homogeneous difference equation with two distinct, one pos-itive and negative, integral roots:

    un+2+un+1 6un = 0, u0= 0, u1= 1. (6.41)

    Rewriting the difference equation as follows

    un+2= un+1+ 6un, (6.42)

    with u0 = 0, and u1 = 1 yields u2 =1, u3 = 7, u4 =13, and u5 = 55. Thegeneral solution of a linear homogeneous difference equation is un = A

    n, and thusun+1 = A

    n+1 = un, and un+2 = An+2 = 2un. Inserting this in the difference

    equation yields the characteristic equation:

    2 + 6 = 0. (6.43)

    The roots of this characteristic equation are = 2 or =

    3. Hence, the general

    solution isun = A(2)

    n +B(3)n. (6.44)Inserting the initial conditionsu0 = 0 and u1= 1 yields the following two equations interms ofA and B:

    0 = A+B1 = 2A 3B (6.45)

    From the first equation follows B =A. Inserting this in the second equation yields1 = 2A+ 3A or A= 15 , and hence B= 15 . The exact solution is therefore

    un =1

    5[(2)n (3)n]. (6.46)

    Checking the result for n = 2 yields u2= 15(4 9) = 1, forn = 3u3= 15(8 + 27) = 7,

    forn= 4 u4= 15(16 81) = 13.

    28

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    31/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 6.5. Solving a homogeneous difference equation with two distinct rationalroots:

    8un+2 6un+1+un = 0, u0= 1, u1= 2 (6.47)Rewriting the difference equation as follows

    un+2=3

    4un+1 1

    8un, (6.48)

    with u0 = 1, and u1 = 2 yields u2 = 118, u3 =

    2532 , u4 =

    53128 , and u5 =

    109512 . The

    general solution of a linear homogeneous difference equation is un = An, and thus

    un+1 = An+1 = un, and un+2 = A

    n+2 = 2un. Inserting this in the differenceequation yields the characteristic equation:

    82 6+ 1 = 0. (6.49)

    The roots of this characteristic equation are

    1,2=6 36 32

    16 = 1

    4

    =

    1

    2. (6.50)

    Hence, the general solution is

    un = A

    1

    4

    n+B

    1

    2

    n. (6.51)

    Inserting the initial conditionsu0 = 1 and u1= 2 yields the following two equations interms ofA and B:

    1 = A+B2 = 14A+

    12B

    (6.52)

    From the first equation follows B= 1A. Inserting this in the second equation yields2 = 14A+

    12 12A orA= 6, and hence B= 7. The exact solution is therefore

    un = 6

    1

    4

    n+ 7

    1

    2

    n. (6.53)

    Checking the result for n= 2 yields u2 = 38 + 74 = 118, for n= 3 u3= 332 + 78 = 2532 ,forn= 4 u4= 3128+ 716 = 53128 .

    29

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    32/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 6.6. Solving a homogeneous difference equation with one distinct positiveintegral root:

    un+2 6un+1+ 9un = 0, u0= 0, u1= 2 (6.54)Rewriting the difference equation as follows

    un+2= 6un+1 9un, (6.55)

    with u0 = 0, and u1 = 2 yields u2 = 12, u3 = 54, u4 = 216, and u5 = 810. Thegeneral solution of a linear homogeneous difference equation is un = A

    n, and thusun+1 = A

    n+1 = un, and un+2 = An+2 = 2un. Inserting this in the difference

    equation yields the characteristic equation:

    2 6+ 9 = 0 ( 3)2 = 0. (6.56)

    The distinct root of this characteristic equation is = 3. Hence, the general solution is

    un = (A+Bn)(3)n. (6.57)

    Inserting the initial conditionsu0 = 0 and u1= 2 yields the following two equations interms ofA and B:

    0 = 3A2 = 3A+ 3B

    (6.58)

    From the first equation follows A = 0. Inserting this in the second equation yieldsB= 23 . The exact solution is therefore

    un =2

    3n(3)n. (6.59)

    Checking the result for n = 2 yields u2 = 23 18 = 12, for n= 3 u3 =

    23 81 = 54, for

    n= 4 u4= 23 4 81 = 216.

    30

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    33/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Example 6.7. Solving a homogeneous difference equation with two distinct complexroots:

    un+2 2un+1+ 4un = 0, u0= 1, u1= 2 (6.60)Rewriting the difference equation as follows

    un+2= 2un+1 4un, (6.61)

    with u0 = 1, and u1 = 2 yields u2 = 0, u3 =8, u4 =16, and u5 = 0. Thegeneral solution of a linear homogeneous difference equation is un = A

    n, and thusun+1 = A

    n+1 = un, and un+2 = An+2 = 2un. Inserting this in the difference

    equation yields the characteristic equation:

    2 2+ 4 = 0. (6.62)

    The roots of this characteristic equation follow from

    1,2= 2 4 162

    = 1 +i3= 1 i3. (6.63)Hence, the general solution is

    un = A(1 +i

    3)n +B(1 i

    3)n. (6.64)

    The absolute value follows as

    |1 +i

    3| =

    12 + (

    3)2 =

    1 + 3 =

    4 = 2, (6.65)

    and the argument follows as

    arg{1 +i3} = arctan 31

    = 3

    . (6.66)

    In terms of complex exponential functions this becomes:

    un= A(2exp(i

    3))n +B(2 exp(i

    3))n. (6.67)

    The real part of this solution is, with new constants Aand B :

    un = 2n

    A cosn

    3

    +Bsin

    n3

    . (6.68)

    31

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    34/44

    6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH

    CONSTANT COEFFICIENTS

    Inserting the initial conditionsu0 = 1 and u1= 2 yields the following two equations interms ofA and B:

    1 = A

    2 = 2( 12A+ 12

    3B)

    (6.69)

    Inserting the first equation in the second equation yields 2 = 1 +

    3B orB = 13

    . The

    exact solution is therefore

    un= 2n

    cos

    n3

    +

    13

    sinn

    3

    . (6.70)

    Checking the result for n= 2 yields

    u2= 4[cos

    2

    3

    +

    13

    sin

    2

    3

    ] = 4[1

    2+

    1

    2] = 0 (6.71)

    forn= 3

    u3= 8[cos3

    3

    + 1

    3sin

    33

    ] = 8 (6.72)

    and for n = 4

    u4 = 16[cos

    4

    3

    +

    13

    sin

    4

    3

    ] = 16[1

    21

    2] = 16. (6.73)

    32

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    35/44

    7. SOLVING INHOMOGENEOUS LINEAR DIFFERENCE EQUATIONS

    7 Solving Inhomogeneous Linear Difference Equations

    In this section we will discuss how to solve inhomogeneous linear difference equations.This discussion is actually very short: inhomogeneous linear difference equations aresolved in exactly the same way as inhomogeneous linear differential equations. Thus, youshould first TRY to find the particular solution and secondly you should add the com-plementary function to the particular solution. Recall that the complementary functionis the general solution of the homogeneous form of the difference equation. Finally, usethe initial conditions to find the complete solution of the difference equation. Below aresome worked out examples.

    Example 7.1. The particular solution of an inhomogeneous difference equation:Find the particular solution of the following inhomogeneous second-order linear differ-ence equation:

    un+2+ 2un+1+un = n2 4. (7.1)

    The right-hand side of this difference equation is a polynomial of degree 2 in n. TRYas particular solution a quadratic polynomial in n:un=u[n] =an2 + bn + c, such that

    un+1= u[n+1] =a(n + 1)2 +b(n +1)+ c, andun+2= u[n+2] =a(n+ 2)

    2+ b(n +2)+c.Inserting these in the difference equation gives

    a(n+ 2)2 +b(n+ 2) +c+ 2(a(n+ 1)2 +b(n+ 1) +c) + (an2 +bn+c) = n2 4(an2 + 4an+ 4a+bn+ 2b+c) + (2an2 + 4an+ 2a+ 2bn+ 2b+ 2c) + (an2 +bn+c) = n2 4

    (4a)n2 + (8a+ 4b)n+ (6a+ 4b+ 4c) = n2 4(7.2)

    or(4a 1) =0

    n2 + (8a+ 4b)

    =0n+ (6a+ 4b+ 4c+ 4)

    =0= 0, (7.3)

    since this equation must hold for all values ofn. Hence a = 14 andb = 12 andc = 78 .We conclude that the particular solution of this difference equation is

    un = u[n] =1

    4n2 1

    2n 7

    8. (7.4)

    33

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    36/44

    7. SOLVING INHOMOGENEOUS LINEAR DIFFERENCE EQUATIONS

    Example 7.2. The complementary function of an inhomogeneous difference equation:Find the complementary function of the following inhomogeneous second-order lineardifference equation:

    un+2+ 2un+1+un = n2 4. (7.5)

    The homogeneous form of this difference equation is

    un+2+ 2un+1+un = 0. (7.6)

    The corresponding characteristic equation becomes

    2 + 2+ 1 = 0 (+ 1)2 = 0. (7.7)

    The characteristic equation has one distinct root =1 and the complementaryfunction is

    un = u[n] = (A+Bn)(1)n. (7.8)

    34

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    37/44

    8. FIBONACCI NUMBERS

    Example 7.3. The complete solution of an inhomogeneous difference equation:Find the complete solution of the following inhomogeneous second-order linear differ-ence equation:

    un+2+ 2un+1+un = n2 4. (7.9)

    In the previous two examples we found that the particular solution and the comple-mentary function of this inhomogeneous difference equation are

    un = u[n] =1

    4n2 1

    2n 7

    8. (7.10)

    andun = u[n] = (A+Bn)(1)n. (7.11)

    The complete solution becomes

    un = u[n] = (A+Bn)(1)n +14

    n2 12

    n 78

    (7.12)

    Lets assume that the initial conditions are u0= 0 andu1 = 1, then we get the followingtwo equations in terms of the unknown constants A and B:

    u0= u[0] =A 78

    = 0 A= 78

    . (7.13)

    and

    u1= u[1] = A B+ 141

    27

    8= 1 B= 24

    8 = 3. (7.14)

    Finally, the complete solution of the difference equation is

    un = u[n] = 78 3n (1)n +

    1

    4

    n2

    1

    2

    n

    7

    8

    (7.15)

    8 Fibonacci Numbers

    The first two Fibonacci numbersFnare F0= 0 andF1= 1. The other Fibonacci numbersare simply the sum of the previous two Fibonacci numbers: F2 =F1+ F0 = 1 + 0 = 1,F3= F2+ F1= 1 + 1 = 2,F4= F3+ F2= 2 + 1 = 3. This generates the following list ofintegers:

    F0= 0, F1= 1, F2 = 1, F3= 2, F4= 3, F5 = 5, F6= 8, F7= 13, F8= 21, F9= 34, F10 = 55, . . . .(8.1)

    The Fibonacci numbers are generated by the following linear second-order homogeneousdifference equation:

    Fn+2= Fn+1+Fn Fn+2 Fn+1 Fn = 0. (8.2)The characteristic equation of this difference equation is

    2 1 = 0. (8.3)

    35

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    38/44

    8. FIBONACCI NUMBERS

    The roots of this characteristic equation are

    1,2=1 5

    2 1,2= 1

    2

    5

    2 . (8.4)

    The general form of the solution is

    Fn = A

    1

    2+

    5

    2

    n+B

    1

    2

    5

    2

    n. (8.5)

    UsingF0= 0 gives F0= 0 =A+B or B = A. Using F1= 1 gives

    F1= 1 =A

    2 +

    A

    5

    2 +

    B

    2 B

    5

    2 =

    A+B

    2 +

    (A B)52

    =A

    5, (8.6)

    or A= B= 15

    . The solution of the difference equation is

    Fn =

    1

    5 12+

    5

    2 n

    12

    5

    2 n

    . (8.7)The positive root of the characteristic equation is called the golden ratio :

    =1

    2+

    5

    2 1.618033988749894848204587. (8.8)

    The golden ratio appears at many different places in mathematics. We will mention justone beautiful example. Note that

    5

    2 1

    2

    5

    2 +

    1

    2

    = 1

    5

    2 1

    2=

    152 +

    12

    . (8.9)

    Now, we have

    =1

    2+

    5

    2 = 1 +

    5

    2 1

    2

    = 1 +

    152 +

    12

    , (8.10)

    but the denominator of the last fraction can be written as

    5

    2 +

    1

    2= 1 +

    15

    2 +

    1

    2

    , (8.11)

    such that we obtain a continued fraction

    = 1 +1

    1 +1

    1 +1

    1 +1

    1 +1

    1 +. . .

    . (8.12)

    36

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    39/44

    9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS

    For this reason, the golden ratio is sometimes called the most irrational number.OK, one more example:

    =1

    2+

    5

    2 2 =

    1

    2+

    5

    2

    2=

    1

    4+

    5

    2 +

    5

    4=

    3

    2+

    5

    2 = 1 +, (8.13)

    or=

    1 +, (8.14)

    which follows as well from the characteristic equation. Continuing to insert this resultunder the square-root gives the representation of as anested radical

    =

    1 +

    1 +

    1 +

    1 +

    1 +

    1 +

    1 +. . . (8.15)

    9 Cobweb and First-Order Difference Equations

    The cobweb is a useful graphical tool investigate the properties of first-order differenceequations. Lets consider the following first-order linear difference equation

    un+1=1

    3un+ 2, u0 = 10. (9.1)

    The number u0 =10 serves as input to calculate u1 from the difference equation.The output u1 = 103 + 2 = 43 . The output u1 serves now as input to obtain u2;u2 = 49 + 2 = 149 , and-so-forth. This process shows that an input yields an output,then the output becomes the new input, theinput generates an output and-so-forth.The cobweb is a graphical representation of a first-order difference equation and is shown

    for this example in Fig. 9.1.

    10 8 6 4 2 2 4 6 8input

    4321

    1234

    output

    Fig.9.1. The cobweb representation of the difference equation un+1= 1

    3un+ 2 with u0 = 10.

    The horizontal axis represents the inputs, the vertical axis represents the outputs.Furthermore, there is a line output = input, which would be the line y = x in thestandardxy-plane. We can consider this difference equation now also as the output equals

    37

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    40/44

    9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS

    a third of the input plus two, or writing this as a function of the form output = f(input)with f(input) = 13 input + 2. In other words, the linear first-order difference equationbecomes a straight line in the cobweb with slope 13 and intercept 2. The vertical dashedlines in the cobweb show the connection between the input and the corresponding output.The horizontal lines show the connection between output and the next input; the end-

    points of these lines are the line output = input. The cobweb suggests that the outputsof the difference equation iterate to the intersection point of the two lines in the cobweb;this is the point u = u. This point is also on the line output = input. Insertingun+1= un = u in the difference equation gives

    u=1

    3u+ 2 u= 3. (9.2)

    This point is called the fixed point. It is called fixed point, because the input u0 = 3generates the output u1 = 3. This fixed point is also stable, meaning that wherever westart on the horizontal axis, we will always iterate towards u = 3. Setting as general formfor the difference equation

    un+1= kun+a, (9.3)

    then we have the following results:

    for 1< k 1, there is one unstable fixed point given byu = a1k ; whereverwe start we will iterate away from the fixed point,

    fork= 1, there is no fixed point. Ifa >0, then we will iterate stepwise towards plusinfinity, ifa 1, the second intersection point is given by u=u2 +uor u= 1

    . Fig.9.4shows cobwebs of the logistic equation for various values of.

    The cobwebs show that for different values of one can obtain fixed points, two-cycles,four-cycles, eight-cycles, and so forth. Locations where fixed points changes into two-cycles are called bifurcation points. Fig. 9.5 shows these bifurcation points of the

    38

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    41/44

    9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS

    4 2 2 4 6input

    3

    2

    1

    1

    2

    3

    4

    5output

    4 2 2 4 6input

    3

    2

    1

    1

    2

    3

    4

    5output

    un+1= 3

    4un+ 1, u0 = 2 un+1 =

    3

    4un+ 1, u0 = 2

    4 2 2 4 6input

    3

    2

    1

    1

    2

    3

    4

    5output

    108642 2 4 6 8 10input

    10

    5

    5

    10

    15output

    un+1= 4

    3un+ 1, u0 = 2 un+1 =

    4

    3un+ 1, u0 = 2

    4 2 2 4 6input

    1

    1

    2

    3

    4

    5output

    4 2 2 4 6input

    1

    1

    2

    3

    4

    5output

    un+1= un+ 1, u0 = 2 un+1 = un 1, u0 = 5

    Fig.9.2. These graphs shows different types of cobwebs for first-order linear difference equations.

    39

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    42/44

    9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS

    4 2 2 4 6input

    4

    2

    2

    4

    6output

    un+1= un+ 2, u0 = 3

    Fig.9.3. This graph shows the cobweb of an oscillating first-order linear difference equation of the form

    un+1 = un+1+ a.

    logistic equation as a function of. The vertical axis shows the values ofun; if there isonly one value, then that value is a fixed point, if there are two values, then those valuesform a two cycle, etc.

    40

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    43/44

    9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS

    input

    0.2

    0.4

    0.6

    0.8

    1output

    input

    0.2

    0.4

    0.6

    0.8

    1output

    = 2.80 one fixed point = 3.05: two cycle

    {0.594117, 0.735483}

    input

    0.2

    0.4

    0.6

    0.8

    1

    output

    input

    0.2

    0.4

    0.6

    0.8

    1

    output

    = 3.45 four-cycle: = 3.55: eight cycle

    {0.413234, 0.838952, 0.467486, 0.861342} {0.881684, 0.370326, 0.827805, 0.506031,0.887371, 0.3548, 0.812656, 0.540475}

    input

    0.2

    0.4

    0.6

    0.8

    1output

    input

    0.2

    0.4

    0.6

    0.8

    1output

    = 3.565 sixteen-cycle: = 3.68: chaos{0.837168, 0.485973, . . . , 0.376832}

    Fig.9.4. These graphs shows cobwebs of the logistic equation for various values of.

    41

  • 8/12/2019 SCI111 Differen(Ce)(Tial)Eqns

    44/44

    9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS

    2.8 3 3.2 3.4 3.6 3.8 4

    0.2

    0.4

    0.6

    0.8

    1

    xn

    3.4 3.45 3.5 3.55 3.60.3

    0.35

    0.4

    0.45

    0.5

    0.55

    xn

    3.55 3.56 3.57 3.58 3.59 3.6

    0.32

    0.34

    0.36

    0.38

    0.4

    0.42

    xn

    3.565 3.57 3.575 3.58

    0.33

    0.34

    0.35

    0.36

    0.37

    xn

    Fig.9.5. These graphs shows bifurcation plots of the logistic equation at various scales