Chap_3_ODE

Embed Size (px)

DESCRIPTION

ode

Citation preview

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    1

    Topic 3: Ordinary Differential Equation

    3.1 Ordinary differential equations An ordinary differential equation (ODE) is an equation involving an unknown function, y

    with independent variable x say, ands its derivatives.

    For example:

    )(2)( xxyxy -- (1)

    And

    xxydx

    dy

    dx

    yd2cos72sin432

    2

    2

    -- (2)

    are ordinary differential equations. The solution of an ODE is a function that satisfies the

    equation at every point of its domain. For example, )exp()( 2xxy is a solution of (1), while

    xxxy 2cos)exp()( is a solution of (2).

    Other notations for OED are possible, such as an ODE for x as a function of t:

    07532

    2

    xdt

    dx

    dt

    xd -- (3)

    Often derivatives with respect to t are denoted by dots, eg 2

    2

    ,dt

    xdx

    dt

    dxx , etc , so that (3)

    may be also be written as

    0753 xxx

    Hence, the following ODE are equivalent:

    034 yyy

    0342

    2

    xdt

    dx

    dt

    xd

    034 xxx

    ODEs arise quite naturally in a wide variety of physical situations, as described below.

    Example:

    Newtons law of cooling It states that the rate of decrease of the temperature of a body is proportional to the difference

    between the temperature T of the body and the temperature T0 of the surrounding air, i.e.

    0TTdt

    dT

    Or equivalently,

    )( 0TTkdt

    dT

    for some constant k.

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    2

    Example:

    Motion of a mass on a spring in a resistive medium

    x = 0 x = X (t)

    Let X(t) denote the displacement of the mass at time t. The resistive force is given by

    dt

    dXkk 11 )speed( -- (4)

    and the spring restoring force by

    )()extension( 22 lXkk -- (5)

    where k1 and k2 are constants and l is the natural length of the spring. By Newton's Second

    Law, the total force F acting on the body must equal the acceleration a of the body times its

    mass m, i.e. F = ma. Hence

    2

    2

    21 )(dt

    XdmlXk

    dt

    dXk -- (6)

    lkXkdt

    dXk

    dt

    Xdm 2212

    2

    -- (7)

    Which is an ODE for the displacement X(t)

    3.2 Classification of ODEs

    ODEs may be separated into different categories, according to their general characteristics.

    Independent and dependent variables

    In equations (1) and (2) y is called the dependent variable and x is the independent variable.

    In equation (3) x is called the dependent variable and t is the independent variable.

    Order

    The order of an ODE is the highest derivative occurring in the equation.

    For example,

    01062

    2

    ydx

    dy

    dx

    yd

    Is second-order

    043 3 xydx

    dy

    Is first order

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    3

    Degree The degree of an ODE is the power to which the highest-order derivative is raised, after the

    equation has been rationalised to contain only integer powers of derivatives. Hence

    0

    72

    4

    4

    y

    dx

    dyx

    dx

    yd

    Is fourth-order and second degree

    04

    7

    2

    2

    y

    dx

    dy

    dx

    yd

    Is second order and degree 4, since in order to remove fractional powers, we rearrange as

    follows 4

    2

    27

    2

    247

    dx

    ydy

    dx

    dy

    dx

    ydy

    dx

    dy

    Hence the highest derivative is raised to the power of 4.

    Linearity

    An ODE is linear, if

    (a) the y-dependent terms are y itself and derivatives of y and

    (b) these terms do not appear multiplied together. ODEs containing products of y

    dependent terms, or functions of y, are said to be nonlinear.

    xeydx

    dy

    dx

    yd

    45

    3

    2

    2

    Is second order and nonlinear, whilst

    06102

    2

    ydx

    dy

    dx

    yd

    Is second order and linear

    03 xdx

    dyy 0 ye

    dx

    dy

    Are first order and nonlinear, whilst

    xeyxdx

    dy 434

    Is first order and linear.

    Notice that the coefficients in the ODE might depend upon the independent variable (x in this

    case).

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    4

    3.3 Homogeneous and inhomogeneous ODEs

    Suppose we are given a linear differential equation. Let us assume that terms containing the

    dependent variable are on the left-hand side of the equality sign and terms involving the

    independent variable and constants on the right-hand side.

    Then homogeneous equations have the right-hand side zero and inhomogeneous equations

    have the right-hand side non-zero.

    For example,

    02

    2

    ydx

    dyx

    dx

    yd

    Is a homogeneous, linear second order ODE and

    xydx

    dyx

    dx

    ydcos2

    2

    2

    is an inhomogeneous, linear, second-order ODE.

    3.4 Solving ODEs

    The general solution of an ODE is the most general function y that satisfies the equation; it

    will contain constants of integration that may be determined by the application of suitable

    initial or boundary conditions. The general solution of an nth-order ODE will contain n

    arbitrary constants of integration and we therefore need n initial conditions in order to

    determine these constants. When the initial conditions have been applied and the constants

    determined then we are left with a particular solution to the ODE which obeys the given

    initial conditions. When a possible solution to the ODE has been found it is always possible

    to check its validity by substituting it into the original ODE and checking that it satisfies the

    initial conditions.

    The ODE may possess an analytical solution where the dependent variable can be expressed

    as a function of the independent variable. For example,

    xdx

    dy4

    has an analytical solution

    cxxy 22)(

    where c is a constant of integration. Here the dependent variable y has been expressed as a

    function of the independent variable x.

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    5

    Alternatively, it might be possible to use graphical methods. For example, suppose we

    consider

    xdx

    dy

    2

    1

    We can compute dx

    dy at any point in the xy plane, as follows. Suppose we consider a grid of

    points in the xy plane. At each point, draw a short line segment with gradientdx

    dy. This is the

    direction field which consists of line-segments that are tangent to the solution curves. Thus

    the solution curves may be inferred

    Direction fields of the ODEs 2/xy with solution curve

    3.5 First order ODEs

    These are usually written in the form

    ),( yxfdx

    dy

    Where f is a given function. Sometimes they are written in the equivalent form

    ),()( yxfxy

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    6

    Separable first order ODEs

    In this case, the function f separates into the product of a function of x and a function of y.

    Then we can write

    )()(),( yhxgyxf

    So that the equation becomes

    )()(),( yhxgyxfdx

    dy

    We can then rearrange this into the form

    )()(

    1xg

    dx

    dy

    yh

    Integrating with respect to x we get

    dxxgdyyh

    )()(

    1+ c

    remember to include the arbitrary constant of integration c

    Example:

    Solve the equation

    kydx

    dy

    We have

    kxcckx eeey

    ckxy

    cdxkdyy

    kdx

    dy

    y

    ||

    ||ln

    1

    1

    Hence, kxkxc Aeeey

    Where ceA is an arbitrary constant.

    Example:

    Solve the differential equation

    y

    x

    dx

    dy

    Solution:

    Axy

    Cxy

    Cxdxydy

    22

    22

    22

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    7

    Example:

    Solve the differential equation

    xydx

    dy 2/1

    Solution:

    Cx

    y

    Cxy

    Cx

    dyy

    Cxdxdyy

    22

    22/1

    2

    1

    2

    22

    1

    2

    2

    1

    2/1

    Example:

    Solve the differential equation

    yxedx

    dyx 2)1( 2

    Solution:

    Cxe

    Cdxx

    xdye

    Cdxx

    xdy

    e

    y

    y

    y

    |1|ln

    )1(

    2

    )1(

    21

    2

    2

    2

    Example:

    Solve the differential equation

    yey

    x

    dx

    dy

    1

    2

    Solution:

    Cxeye

    Cxdyey

    Cxdxdye

    y

    ey

    x

    dx

    dy

    yy

    y

    y

    y

    2

    2

    )1(

    )1(

    21

    1

    2

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    8

    Linear first order ODEs

    Recalling our definition of a linear differential equation, we see that for

    ),( yxfdx

    dy

    To be linear we must have

    )()(),( xqyxpyxf

    for given functions p and q. Then the equation becomes

    )()( xqyxpdx

    dy -- (8)

    No `y'-terms are multiplied together and there are no functions of y. If a linear first-order

    equation is written as in (8) it is said to be in standard form. Notice that if q(x) = 0 the

    equation is also separable. For then

    0)( yxpdx

    dy yxp

    dx

    dy)(

    Hence,

    cdxxpdyy)(

    1

    Where c is a constant of integration, so that

    cdxxpy )(||ln

    Taking exponentials, dxxpAey )(

    Where ceA is an arbitrary constant.

    Integrating factors

    dxxpdx

    dye

    dx

    dyee

    dx

    dy

    dx

    dyeye

    dx

    d dxxpdxxpdxxpdxxpdxxp)(

    )()()()()(

    And also

    )())(()()( dxxpdxxp

    yedx

    dyxp

    dx

    dye -- (9)

    and integrating the RHS then just gives dxxp

    ye)(

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    9

    Theory Hence, to solve the linear ODE in standard form

    )()( xqyxpdx

    dy

    We multiply by the integrating factors dxxp

    e)(

    dxxp

    e)(

    yxp

    dx

    dy)(

    dxxp

    e)(

    )(xq

    From (9), we then have

    dxxpdxxp exqyedx

    d )()()(

    Now integrate both sides with respect to x:

    cexqyedxxpdxxp

    )()(

    )(

    Final result:

    dxxpdxxpdxxp

    cedxexqey)()()(

    )(

    If, q(x) = 0, then we get the same result as before.

    Example:

    Solve 332 xydx

    dyx

    Solution:

    232

    xyxdx

    dy )()( xqyxp

    dx

    dy

    Integrating factor 2ln22

    xee xdx

    x

    Cxyx

    dxxyxdx

    d

    xxxyxdx

    d

    52

    42

    4222

    5

    3

    3

    33

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    10

    Example: (Bernoulli differential equation)

    Solve )cos(432 txdt

    dxtxt

    Solution:

    3

    4 )cos(1

    t

    txx

    tdt

    dx ayxQyxP

    dt

    dy)()(

    Let 31 )()()( txtxty a

    Therefore, dt

    dxx

    dt

    dy 43 and dt

    dyx

    dt

    dx

    3

    4

    Then 3

    34

    3

    4 cos33cos1

    3 t

    tx

    tdt

    dyx

    t

    tx

    tdt

    dyx

    3

    cos33

    t

    ty

    tdt

    dy

    The integrating factor 3ln33

    tee tdt

    t

    Ctyt

    Cdttytdt

    d

    tt

    ttyt

    dt

    d

    sin3

    cos3

    cos3cos3

    3

    3

    3

    33

    But 31 )()()( txtxty a or 3

    1

    xy

    So

    3/13

    3

    3

    3

    sin3

    sin31

    sin3

    Ct

    tx

    Cttx

    Ctyt

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    11

    Example:

    Solve 222

    yxyx

    y .

    Solution:

    2 1 2

    2

    2

    12

    2ln 2

    2 2 2

    2 4

    52

    2 5

    2

    2

    1Let

    2

    solve this differential equation by First order linear equation

    Integrating factor is

    2

    5

    5

    5

    dxxx

    y y y xx

    wy

    yw

    y

    w w xx

    e e x

    x w w x xx

    dx w dx x dx C

    dx

    xx w C

    x xC

    y

    xy

    x

    5 A

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    12

    Example:

    Solve 234

    yxyx

    y .

    Solution:

    ||ln1

    ||ln1

    ||ln1

    11

    141

    1 isfactor gIntegratin

    equationlinear order First by equation aldifferenti thissolve

    4

    1Let

    4

    4

    4

    4

    4

    3

    44

    4

    ln4

    14

    3

    2

    312

    xCxy

    xCxy

    xCwx

    Cdxx

    dxwxdx

    d

    xx

    wx

    wx

    xee

    xwx

    w

    y

    yw

    yw

    xyx

    yy

    xdx

    x

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    13

    Example:

    Solve 4

    3

    1yey

    dx

    dy x .

    Solution:

    x

    x

    x

    eww

    eww

    yy

    w

    yw

    eydx

    dy

    y

    3

    3

    1

    3

    1

    3

    1Let

    3

    11

    4

    3

    3

    4

    xdx ee

    1

    isfactor gIntegratin

    equationlinear order First by equation aldifferenti thissolve

    )3(1

    31

    3

    3

    3

    3

    3

    3

    xCey

    Cxy

    e

    Cxwe

    Cdxdxwedx

    d

    wedx

    d

    eewwe

    x

    x

    x

    x

    x

    xxx

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    14

    Example:

    Solve .3xyydx

    dyx

    Solution:

    22

    11

    2

    1

    2

    1Let

    1111

    3

    2

    23

    3

    wx

    w

    wx

    w

    yy

    w

    yw

    xydx

    dy

    y

    yx

    y

    dx

    dy

    2

    12 1

    isfactor gIntegratin

    equationlinear order First by equation aldifferenti thissolve

    xe

    dxx

    2

    2

    2

    2

    2

    2

    22

    22

    22

    2

    1

    21

    2

    21

    21

    21

    2121

    Cxxy

    Cxxy

    Cxxw

    Cx

    wx

    Cdxx

    wx

    xw

    xdx

    d

    xw

    xw

    x

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    15

    Example:

    Solve 2ByAydx

    dy , where A and B is constant.

    Solution: 2ByAyy

    a = 2, therefore let y

    yyu a1211

    and yy

    u 2

    1 yuy 2

    then 2ByAyy 122 AyBuByAyuy

    so BAuuAuBu

    so the general solution is A

    BCeu At

    A

    BCe

    uy

    At

    11

    Exercise:

    Solve xeydx

    dy 2

    Solution:

    xeydx

    dy 2 )()( xqyxp

    dx

    dy

    Integrating factor xdx

    ee 22

    xx

    xx

    xx

    xxxx

    Ceey

    Ceye

    dxeyedx

    d

    eeeyedx

    d

    2

    2

    2

    22

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    16

    Euler homogeneous equation

    Some functions have the property that, for any

    ),(),( yxfyxf n

    Such functions are called homogeneous of degree n. For example,

    i. ),()(),(),( yxfxyxyyxfxyyxf

    ii. 2 2 2 2 2 2 2 2 2 2( , ) ( , ) ( ) ( , )g x y y x g x y y x y x g x y

    In the above, f is homogeneous of degree one, g is homogeneous of degree two.

    A homogeneous differential equation is one that may be written in the form

    ),(

    ),(

    yxB

    yxA

    dx

    dy

    Where A(x,y) and B(x,y) are homogeneous functions of the same degree. The RHS of a

    homogeneous ODE can be written as a function of y/x, because

    )/()/,1(

    )/,1(

    ),(

    ),(xyF

    xyB

    xyA

    yxB

    yxA

    dx

    dy

    The homogeneous equation, rewritten in the form

    x

    yF

    dx

    dy

    May then be solved by making the substitution y = v x so that,

    vFdx

    dvxv

    dx

    dy or vvF

    dx

    dvx

    This equation is now separable and can be solved as follows

    xdx

    vvF

    dv

    )( -- (11)

    Hence, the solution method is first to check whether the equation is homogeneous. If so,

    make the substitution y = vx, then separate variables as in (11) and solve directly. Finally

    replace v by y/x to obtain the solution.

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    17

    Example:

    Solve

    xy

    xy

    dx

    dy

    Homogeneous equation with degree one,

    Let ),(),(),( yxfyxfxyyxf

    ),(),(),( yxgyxgxyyxg

    Since f and g is homogeneous degree one, so substitute y = vx

    dx

    dvxv

    dx

    dy

    Then we have

    xy

    xy

    dx

    dy

    1

    1

    1

    1 2

    v

    vv

    v

    v

    dx

    dvx

    This equation is separable and we get

    Cx

    yyx

    Cxvv

    dxx

    dvv

    v

    )(tan||ln2

    1

    ||ln)(tan|1|ln2

    1

    1

    1

    1

    122

    12

    2

    Example:

    Solve

    x

    y

    x

    y

    dx

    dytan

    This equation is homogeneous of degree zero, let y = vx to get

    vvdx

    dvxv tan

    Hence,

    Axxy

    Cxv

    Cdxx

    dvv

    1sin

    ||ln|sin|ln

    1cot

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    18

    3.6 Initial conditions

    We have seen that the general solution of a first-order ODE involves one unknown constant.

    Generally, the number of unknown constants in the general solution equals the order of the

    ODE. To determine a particular solution, we must find these constants. We therefore need as

    many conditions on the solution as there are unknown constants. These conditions usually

    involve the value of the unknown function and/or some of its derivatives at certain points. For

    a first-order equation we only need one such condition, called initial condition. The

    terminology stems from the fact that one may think of the independent variable in the ODE as

    representing time t. Specifying the value of the solution at a given time, for example at t = 0,

    then amounts to fixing the initial value of the dependent variable.

    Example:

    Solve

    xyx

    x

    dx

    dy

    21

    With initial condition y (1) = 0

    Solution:

    Integrating factor 2/12)( 1 xe dxxp

    2

    2

    2/322

    22

    22

    11

    3

    1

    13

    11

    11

    11

    x

    Cxy

    Cxxy

    dxxxxydx

    d

    xxxydx

    d

    Given y = 0 when x = 1 0)1( y

    22

    11 1 0

    3 1 1

    2 2

    3

    C

    C

    2

    2

    1

    1

    3

    221

    3

    1

    xxy

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    19

    Example:

    Suppose that a variable current I(t), where t is time in seconds, flows through a coil with

    inductance L and a resistor of resistance R with an applied voltage V , where we assume that

    L, R and V are constants. Suppose also that the current is zero at time t = 0. Then the current

    satisfies the ODE

    VRIdt

    dIL

    Subject to the initial condition

    I(0) = 0

    Solution:

    The general solution is t

    L

    R

    ceR

    VtI

    )( and given I(0) = 0, so we get C = R

    V

    Therefore the particular solution is

    tL

    R

    eR

    VtI 1)(

    Exercise:

    The rate of increase of the concentration of a chemical is proportional to the concentration at

    that time. Experiment shows that the concentration doubles in four hours. If the initial

    concentration is c0, what is the concentration after six hours?

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    20

    3.7 Second order ODEs

    Homogeneous We start by considering second-order ODEs of the general form

    02

    2

    cydx

    dyb

    dx

    yda

    where a, b and c are given constants.

    These are called constant coefficient, homogeneous, linear second-order ODEs. Recall that

    homogeneous here refers to the right-hand side being zero; we will also consider the case

    when there is a non-zero function there, i.e. inhomogeneous equations. Other notation is

    possible; for example, the ODE might be in terms of x(t) and its derivatives with respect to t.

    Suppose we start by considering the case where a = 0: Then

    0 cydx

    dyb

    and we know how to solve this (by separating the variables). The solution is

    xb

    c

    Aey

    Alternatively, if we try y = Aemx

    as a solution

    0 cydx

    dyb

    0 ( ) 0mx mx mxbmAe cAe Ae bm c

    Hence,

    b

    cm

    And we have got the same answer as before.

    Suppose we adopt the same approach for the second-order equation:

    If y = Aemx

    then mxmAedx

    dy and mxAem

    dx

    yd 22

    2

    Substituting into the ODEs, we get

    0)(

    0

    2

    2

    cbmamAe

    cAebmAeAeam

    mx

    mxmxmx

    00 2 cbmamAemx -- (12)

    So m satisfies a quadratic equation called the auxiliary equation.

    It turns out that if the auxiliary equation has two distinct roots, say m1 and m2, then the

    general solution is

    xmxm

    BeAey 21

    Where A and B are arbitrary constants.

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    21

    Example:

    We start with an example. Suppose we wish to solve

    ydx

    yd 22

    2

    We first check that xy sin is a solution:

    yxyxy 22 sin,cos

    Next, we check that xy cos is a solution:

    yxyxy 22 cos,sin

    We can show that xy cos2 is a solution:

    yxyxy 22 cos2,sin2

    More generally, it is possible to show that the general solution is

    xBxAxy cossin)(

    Where A and B are constants.

    Example:

    Solve

    022

    2

    ydx

    dy

    dx

    yd

    Solution:

    Try mxAey then we have 0)2( 2 mmAemx

    Solve the equation m = 2 , m = -1

    The general solution for y is then

    xx BeAey 2

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    22

    Example

    Solve

    0342

    2

    ydx

    dy

    dx

    yd

    Solution:

    Try mxAey then we have 0)34( 2 mmAemx

    Solve the equation m = 3 , m = 1

    The general solution for y is then xx BeAey 3

    Since as we've seen in (12) m1 and m2 are the roots of a quadratic equation with real

    coefficients, three different cases are possible:

    - m1 and m2 are real and distinct (as in the previous two examples) - m1 and m2 are real and repeated (i.e. m1 = m2) - m1 and m2 are complex conjugates

    We now consider the second and third cases, the first having already been dealt with.

    Real and repeated roots

    If m1 = m2, the general solution appears to be xmxmxmxm

    CeBAeBeAey 1111 )(

    The solution now only contains one constant of integration, but we know that it should

    contain two. In this case, the solution is xm

    eBxAy 1)(

    Where A and B are arbitrary.

    Example:

    Solve

    096 yyy

    Try mxAey then we have 0)96( 2 mmAemx

    Solve the equation m = 3 , m = 3 (repeat)

    The general solution for y is then

    xeBxAy 3

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    23

    Complex conjugate roots

    Suppose the roots are

    im 1 im 2

    The general solution for y is now xixi BeAey )()( xixxix eBeeAe

    xixix BeAee xDxCe x sincos

    Where C and D are arbitrary constants (they are, in fact, combinations of A and B)

    This is the general solution in this case.

    Example:

    Solve

    04 yy

    Solution:

    Try mxAey then we have 0)4( 2 mAemx

    Solve the equation m = 2i , m = -2i (repeat)

    0 and 2

    The general solution for y is then

    xDxCy 2sin2cos

    3.8 Inhomogeneous second order ODEs

    Here we consider second-order ODEs of the general form

    )(2

    2

    xfcydx

    dyb

    dx

    yda

    The general solution consists of the complementary function + the particular integral.

    The complementary function is the solution of the homogeneous equation

    02

    2

    cydx

    dyb

    dx

    yda

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    24

    And can be found using the methods of previous section. Here we will discuss how to find

    the particular integral. There is no general rule for finding the particular integral. In certain

    cases it is possible to find a particular integral by first guessing the general form of the

    particular integral in terms of a function containing a number of as yet undetermined

    constants, and then adjusting the constants so as to turn the function into a solution. This

    technique is known as the method of trial functions and we will illustrate it by a number of

    examples.

    Example:

    Find the general solution of

    xydx

    dy

    dx

    yd 2

    2

    2

    Solution:

    The complementary function is the solution of

    022

    2

    ydx

    dy

    dx

    yd

    Which we know from above is xx BeAey 2

    To find the particular solution, we consider the trial function

    DCxy

    Then direct substitute into the differential equation and get

    xDCxC )(2

    Equating the coefficients of the various power of x on the left and right sides give

    02 DC 12 C Which we have

    2

    1C and

    4

    1D

    So that the particular integral is

    4

    1

    2

    1)( xxy

    Thus, the general solution is

    pc yyxy )(

    )(xy xx BeAe 2

    4

    1

    2

    1 x

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    25

    Example:

    Find the general solution of

    xydx

    dy

    dx

    yd 42

    2

    495

    Solution:

    The complementary function is the solution of

    xydx

    dy

    dx

    yd 42

    2

    495

    Which we know from above is xx

    c BeAey615615

    2

    1

    2

    1

    To find the particular solution, we consider the trial function

    xCey 4

    Then direct substitute into the differential equation and get

    xxxx eCeCeCe 4444 92016

    Equating the coefficients of the various power of x on the left and right sides give

    27

    1C

    So that the particular integral is

    x

    p exy4

    27

    1)(

    Thus, the general solution is

    pc yyxy )(

    )(xy xx

    BeAe615615

    2

    1

    2

    1 xe4

    27

    1

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    26

    Example:

    Find the general solution of

    xydx

    dy

    dx

    yd2cos95

    2

    2

    Solution:

    The complementary function is the solution of

    xydx

    dy

    dx

    yd2cos95

    2

    2

    Which we know from above is xx

    c BeAey615615

    2

    1

    2

    1

    To find the particular solution, we consider the trial function

    xDxCy 2sin2cos

    Then direct substitute into the differential equation and get

    4 cos2 4 sin 2 5( 2 sin 2 2 cos2 ) 9( cos2 sin 2 ) cos2C x D x C x D x C x D x x

    Equating the coefficients of the various power of x on the left and right sides give

    269

    13C and

    269

    10D

    So that the particular integral is

    xxxy p 2cos132sin10269

    1)(

    Thus, the general solution is

    pc yyxy )(

    )(xy xx

    BeAe615615

    2

    1

    2

    1 xx 2cos132sin10

    269

    1

    In summary, trial function for particular integrals of equations of the form

    )(2

    2

    xfcydx

    dyb

    dx

    yda

    Are as follows

    If f (x) is a polynomial in x of degree p, the trial function should be a polynomial in x of

    degree p.

    e.g. if f (x) = 6x2 + 4x + 3 try Cx

    2 + Dx + E.

  • UECM1653 Mathematics for Engineering I

    UECM1683 Mathematics for Physics I Jan 2015

    27

    If f (x) is an exponential function of x, the trial function should be an exponential function of

    x.

    e.g. if f (x) = 6e5x

    try Ce5x

    If f (x) consists of the sine or cosine of a multiple of x, the trial function should be a linear

    combination of sine and cosine of the same multiple of x.

    e.g. if f (x) = cos 5x try Csin 5x + Dcos 5x.

    (In all the above, C, D an E are arbitrary constants)

    3.9 Initial conditions second order ODEs

    We have seen that the general solution for a second-order ODE contains two unknown

    constants. To determine these constants we need two initial conditions. Note the initial

    conditions must only be applied once the general solution (complementary function plus

    particular integral) has been determined.

    Example:

    Solve

    xydx

    dy

    dx

    yd 2

    2

    2

    Subject to the initial condition y(0) = 0 and 0)0( y

    Solution:

    The general solution is

    4

    1

    2

    12 xBeAey xx

    To determine A and B, we now apply the initial conditions

    12

    1

    3

    1

    02

    12)0(

    04

    1)0(

    B

    A

    BAy

    BAy

    Therefore we get 4

    1

    2

    1

    12

    1

    3

    1 2 xeey xx