ENGI 9420 Engineering Analysis
Mid Term Test Solutions

2008 Fall
  1. By any valid method, find the complete solution to the initial value problem

    (2xy + 4x) dx - (y+2) dy = 0 ,   y(0) = -2


    Two methods for a solution are shown here.

    Separation of Variables:

    2x(y+2)dx = (y+2)dy
    y = -2  or  2x dx = dy
    Pursuing the non-singular solution,
    x^2 = y + c
    Imposing the initial condition,
    c = 2  ==>  y = x^2 - 2
    But the singular solution also satisfies the initial condition!
    Therefore the complete solution is

    y = x^2 - 2  or  y = -2

    Conversion to Exact Form (using an integrating factor):

    P = 2xy + 4y ,   Q = -(y + 2)
    Py not= Qx so ODE is not exact.
    Try to find an integrating factor as a function of   x   only:
    (Py - Qx) / Q  is NOT a function of x only
    Try to find an integrating factor as a function of   y   only:
    (Qx - Py) / P  =  -1 / (y+2)
    Int{R(y)}dy = ln((y+2)^(-1))
    I(y) = 1/(y+2)
    Multiplying the ODE by   I(y)   will render the ODE exact, unless y ident= -2, when a division by zero occurs.
    y ident= -2 is a singular solution to the ODE.
    The exact ODE is     2x dxdy = 0
    u = x^2 - y = A
    Imposing the initial condition,
    A = 2  ==>  y = x^2 - 2
    But the singular solution also satisfies the initial condition!
    Therefore the complete solution is

    y = x^2 - 2  or  y = -2


  1. By any valid method, find the function   y(t)   whose Laplace transform is
    Y(s) = 8 e^(-s) / [s^2 (s^2 + 4)]
    Hence (or otherwise) solve the initial value problem
    y" + 4y  =  8(t-1) H(t-1) , 
     y(0) = y'(0) = 0
    where   H(t – a)   is the Heaviside (or unit step) function   H(t-a) = {0 for t < a ;  1 for t >= a}


    Let G(s) = 8 / [s^2 (s^2 + 4)] then 
     Y(s) = G(s) e^(-s)
    Two methods for finding   g(t) = inverse LT {G(s)}   are presented here.

    Partial Fractions:

    G = A/s + B/s^2 + (Cs + 2D) / (s^2 + 4)
    8 = As(s^2 + 4) + B(s^2 + 4) + Cs^3 + 2Ds^2

    Matching coefficients:
    s^0 -->  B = 2
    s^1 -->  A = 0
    s^2 -->  D = -1
    s^3 -->  C = 0
    G(s) = 2/s^2 - 2 / (s^2 + 4)

    Integration Property:

    The factor   s2   in the denominator of   G(s)   corresponds to two successive integrations in t-space:
    [Integration property used twice]
    OR one may quote the inverse Laplace transform directly from the tables
    g(t) = (2t - sin 2t)

    Using the second shift theorem,
    y(t) = (2t - sin 2t)|t --> t-1 H(t-1)

    y(t) = (2(t-1) - sin 2(t-1)) H(t-1)


    One form of the second shift theorem is
    L{f(t-a) H(t-a)} = L{f(t)} e^(-as)
    Taking the Laplace transform of the initial value problem,
    (s^2 + 4)Y = 8/s^2 e^(-s)
    Y(s) = 8 e^(-s) / [s^2 (s^2 + 4)]
    which is precisely the inverse Laplace transform problem solved above.   Therefore

    y(t) = (2(t-1) - sin 2(t-1)) H(t-1)


  1. Find the MacLaurin series solution of the ordinary differential equation

    y" + xy' - y = 1 + x^2

    with arbitrary initial conditions   y(0) = a,   y' (0) = b , as far as the term in x7.


    Substitute the MacLaurin series solution   MacLaurin series   into the ODE:
    [series into  y" + xy' - y = 1 + x^2]
    Shift the indices on the first summation:
    [shift indices on y"]
    Combining the three summations together,
    Sum{[(n+2)(n+1)a_(n+2) + (n-1)a_n] x^n}  =  1 + x^2
    Matching coefficients of successive powers of   x :
    x^0:  a2 = (1 + a0) / 2
    x^1:  a3 = 0
    x^2:  a4 = (1 - a0) / 24
    For   n > 2   we have the recurrence relation
    a_(n+2) = (1-n) a_n / [(n+2)(n+1)]
    a_n = 0  for all odd n > 1
    a6 = -(1 - a0) / 240
    Also note that   y(0) = a0 = a   and   y'(0) = a1 = b
    Therefore the series solution to the ODE, as far as the term in x7, is

    y(x) = a + bx + (1+a)/2 x^2 + 0 x^3 + (1-a)/24 x^4
     + 0 x^5 - (1-a)/240 x^6 + 0 x^7

    This series can also be written as
    y(x) = a(1 + (1/2)x^2 - (1/24)x^4 + (1/240)x^6) 
     + bx + ((1/2)x^2 + (1/24)x^4 - (1/240)x^6)

    OR

    The Maclaurin series for   y(x)   is also
    y(x) = Sum { nth deriv. of y at 0 * x^n / n! }
    The two initial conditions provide the first two terms of the series immediately:
    y(0) = a   and   y'(0) = b
    Rearrange the ODE:
    y"(x) = 1 + x^2 + y - xy'
==>   y"(0) = 1 + a
    Differentiate the ODE repeatedly:
    y'''(0) = 0
    y^4(0) = 1-a
    y^5(0) = 0
    At this point a recurrence relationship develops:
    y^(n) = -(n-3)y^(n-2) - x y^(n-1)
    But   y'''(0) = 0   so that all odd-order derivatives of   y(x)   (except the first) are zero at   x = 0.
    Also   yIV(0) = 1 – a,   so that all higher even order derivatives at   x = 0   also include the factor (1 – a).
    These relationships are needed for the bonus question.
    The remaining term needed for this question is
    y^6(0) = 3(a-1)
    The series then follows:

    y(x) = a + bx + (1+a)/2 x^2 + 0 x^3 + (1-a)/24 x^4
     + 0 x^5 - (1-a)/240 x^6 + 0 x^7


    BONUS QUESTION
    Find the condition(s) on   a   and/or   b   under which the series solution has only a finite number of non-zero terms and write down that finite series solution.


    Note first that   a3 = 0  and  a4 = (1-a)/24.   Recall the recurrence relations
    a_(n+2) = (1-n) a_n / [(n+2)(n+1)]   or   y^(n) = -(n-3)y^(n-2) - x y^(n-1)
    Therefore the coefficients of all the odd powers of x (except 1) are zero and
    the coefficients of every even power of x from 4 onwards share the same factor of (1 – a).
    a = 1   ==>   a_n = 0  for all n > 2
    Therefore the series has only a finite number of non-zero terms if and only if

    a = 1
    when the series is
    1 + bx + x^2
    (where b remains arbitrary).

    Additional Note:   The complete series can be re-written as
    y(x) = a + bx + (1+a)/2 x^2 
     + Sum_(k=2)^inf {(-1)^k (1-a) (2k-3)! / [2^(k-2) (k-2)! (2k)!] 
       x^(2k)}


  1. The cubic equation
                  x^3 + 0.02x^2- 0.01x + 1 = 0
    is a special case (e = 0.01) of the perturbation
                  x^3 + 2ex^2 - ex + 1 = 0
    of the simple cubic equation
                  x^3 + 1 = 0
    Find the perturbation series, as far as the term in e2, for the root near x = –1 and hence find the solution of x^3 + 0.02x^2- 0.01x + 1 = 0 nearest to x = –1, correct to six decimal places.


    Solution by Expansion:

    Let the perturbation series be
    x(e)  =  x0 + x1 e + x2 e^2 + x3 e^3 + ...
    Substitute this series into the cubic equation:
    x(e)^3 + 2e x(e)^2- e x(e) + 1 = 0
    x(e)^3 + 2e x(e)^2- e x(e) + 1 = 0
    x(e)^3 + 2e x(e)^2- e x(e) + 1 = 0
    Rearrange the coefficients of   e 0, e 1, e 2   into a tabular display:
    [table]
    Equating coefficients of e 0:
    x0 = -1, (which is the only real solution to the unperturbed equation).
    Equating coefficients of e 1:
    x1 = -1
    Equating coefficients of e 2:
    x2 = -2/3
    Therefore the perturbation series is
    x(e)  =  -1 - e - (2/3) e^2 - ...
    The solution to the equation   x^3 + 0.02x^2- 0.01x + 1 = 0   is therefore
    x(0.01) = -1.010066...
    Therefore the solution to the perturbed cubic equation, correct to six decimal places, is

      x = –1.010 067  

    OR

    Solution by Iteration:

    An obvious iteration scheme is
    x_(n+1)  =  -(1 + [2e x_n^2 - e x_n])^(1/3)
    Use the standard binomial expansion
    (1 + z)^n  =  1 + nz + n(n-1) z^2 / 2 + ...
    (valid for   | z | < 1)
    and start the iterations with the solution to the unperturbed cubic equation   x0 = -1
    For   x1   discard all terms in the binomial expansion beyond   e 1 :
    x1 = -1 - e
    For   x2   discard all terms in the binomial expansion beyond   e 2 :
    x2 = -1 - e - (2/3)e^2
    This result must be verified by finding   x3 :
    For   x3   discard all terms in the binomial expansion beyond   e 3 :
    x3 = -(1 + [3e + 5e^2 + (16/3)e^3])^(1/3)
    x3 = -1 - e - (2/3)e^2 - (1/9)e^3
    This confirms the series as far as the term in   e 2.
    The same answer of   –1.010 067   then follows.

    [This answer is indeed correct to six decimal places.
    The exact answer is   –1.010 066 775 168...]


    Return to the index of assignments [Return to the index of assignments]
    Return to your previous page [Return to your previous page]