0% found this document useful (0 votes)
14 views118 pages

ADVANCED Mathematics For Mechinical Engineering

The document discusses measurement uncertainty and errors in numerical computations, emphasizing the importance of numerical methods due to potential inaccuracies from rounding, human, and machine errors. It outlines how to classify errors, calculate relative and percentage errors, and apply methods like Newton-Raphson for approximating roots. Additionally, it provides examples and activities to illustrate error estimation and management in mathematical calculations.

Uploaded by

Dumisani Sithole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views118 pages

ADVANCED Mathematics For Mechinical Engineering

The document discusses measurement uncertainty and errors in numerical computations, emphasizing the importance of numerical methods due to potential inaccuracies from rounding, human, and machine errors. It outlines how to classify errors, calculate relative and percentage errors, and apply methods like Newton-Raphson for approximating roots. Additionally, it provides examples and activities to illustrate error estimation and management in mathematical calculations.

Uploaded by

Dumisani Sithole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 118

𝑽 = ∬𝑮 (𝒙𝟐 + 𝒚𝟐 )𝒅𝑨


𝒄𝒐𝒔𝒂𝒙 𝝅
∫ 𝟐 𝟐 𝟐
𝒅𝒙 = 𝟑 (𝟏 + 𝒂𝒃)𝒆−𝒂𝒃 , 𝒂 > 0 , 𝑏 > 0)
𝟎 (𝒙 + 𝒂 ) 𝟒𝒃

By: M.J Mbongwe


1

Unit 1

1.Measurement uncertainty: Errors

Introduction
Scientific calculators and computers have become part of everyday living. There are
certain mathematical calculations which are almost impossible to perform without
these devices. For instance, there are certain integration problems, such as
𝜋
∫0 (1 + 𝑥 2 )10 𝑑𝑥, which are difficult/impossible to evaluate without a computing
algorithm or computing device.
The disadvantage when using a computing device is that the answers may not be
accurate enough due to some or other rounding off errors hence numerical analysis
techniques become handy during computations.
Why is there a need for numerical methods?
• Computational methods may have some errors inherited or unintended.
These errors may require detection and correction before results may be
published.
• Most numerical methods give answers that are mostly approximations to
desired true solutions. The approximations themselves may result into the
propagation of these errors, thus they also require refinement.
• Refinement implies that there is a need to set bounds or restrictions to errors
to have meaningful results at the end.

By the end of this unit, you should be able to:

1. classify errors and identify sources of errors

2. determine relative errors, maximum errors and percentage errors

3. determine linear and quadratic interpolants

4. use differentials to determine error estimates.

5. use Newton-Raphson method to approximate roots and determine minimizers

or maximizers of functions
2

1.1 Classification of errors and sources


Numerical computations are susceptible to the following types of errors
• Rounding off errors
• Human errors
• Error in data
• Machine errors
• Instrument calibration errors
NB: Only human errors can be avoided
In solving a mathematical problem an exact or true solution say 𝑥𝑇 is what is
needed. If 𝑥𝐴 is an approximate value of 𝑥𝑇 (𝑥𝐴 assumed/guessed) then the
absolute/modulus error is given by
|∆𝑥| = 𝑥𝐴 − 𝑥𝑇 ⇒ 𝑥𝑇 = 𝑥𝐴 − |∆𝑥|
That is (𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 = 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒 − 𝑒𝑟𝑟𝑜𝑟 )
∆𝑥
The relative error denoted by 𝑟 is then given by 𝑟 = |𝑥 |. Without loss of meaning
𝐴
∆𝑥
we may just write 𝑟 = | 𝑥 |. The percentage error is then given by 𝑃𝑟 = 100 × 𝑟

Example 1.1
The square root of 3 is estimated to be 1,732 (3D). Determine the relative error and
then the percentage error.
Solution

∆𝑥 = 𝑥𝐴 − 𝑥𝑇 = 1,732 − √3
= −0,00005
|∆𝑥| = 0,00005
∆𝑥 0,00005
𝑟 = |𝑥|= = 0,0000289
1,732

𝑃𝑟 = 100 × 0,0000289 = 0,00289


This is ≈ 0,003%
Why is there a need for relative error?

Example 1.2
Two lengths are measured as 473 mm to the nearest millimeter and as 1 km to
within 1 m on either side. A calculation using one of these measurements needs to
be used to minimize costs. Decide which measurement will minimize the costs.
3

Solution
We have 473 ± 1𝑚𝑚 𝑎𝑛𝑑 1000 ± 1𝑚. The actual error magnitudes differ
significantly. One might be tempted to opt for the error in 𝑚𝑚 as it seems to be the
best to use, however in this instance relative error or error percentages need to be
compared to get a clear picture and in making the right choice based on the
accuracy and precision in the measurements. The process leading to making a
choice is as follows:
0,5
𝑟1 = 473 = 0,001057 , 𝑃1 = 0,001057 × 100 ≈ 0,11%
0,5
𝑟2 = 1000 = 0,0005 , 𝑃2 = 0,0005 × 100 ≈ 0,05%

Since 𝑃1 > 𝑃2 or 𝑃2 > 𝑃1 , measurements in meters will be the best choice to


minimize the costs.

Activity 1.1
1. An iron rod of length 100 mm is heated and allowed to expand by no more than
0,5 mm on either side.
Determine:
(a) The value 𝑥𝐴 that may be assumed to be closest to the true length.
(b) The absolute error, relative error and percentage error
2. For a displacement transducer having calibration 𝑌 = 𝐾𝐸 where 𝐾 𝑎𝑛𝑑 𝐸 are
sensibility indices, estimate the uncertainty in displacement for 𝑌 if 𝐸 = 5,00 𝑉,
𝐾 = 10,10𝑚𝑚/𝑉 with tolerances ∆𝐾 = ±0,10 𝑚𝑚/𝑉 and ∆𝐸 = 0,01 𝑉

1.2 Evaluating maximum error using the method of small changes


Suppose based on calculations we found 𝑦 in terms of 𝑥 (𝑦 = 𝑓(𝑥)) and that we
know the original limits of accuracy, limits of accuracy being within 1% either way. If
∆𝑦 𝑑𝑦
we want to estimate the resulting error, we use the approximation = for every
∆𝑥 𝑑𝑥
𝑑𝑦
small increment ∆𝑥 and ∆𝑦. Since we know ∆𝑥 and we can find ∆𝑦 from the
𝑑𝑥
differential
𝑑𝑦
∆𝑦 ≈ 𝑑𝑥 ∆𝑥
4

Example 1.3
Estimate the maximum error in 𝑦 if 𝑦 = 𝑠𝑖𝑛2 𝑥 for 𝑥 = 0,61 ± 0,005
Solution
We are given |∆𝑥| = 0,005
𝑑𝑦
So |∆𝑦| ≈ |𝑑𝑥 | |∆𝑥|

= |2𝑠𝑖𝑛𝑥. 𝑐𝑜𝑠𝑥| × |∆𝑥|


= |𝑠𝑖𝑛2𝑥| × |∆𝑥|
= |𝑠𝑖𝑛2(0,61)| × 0,005
= 0,93909 × 0,005
≤ 0,0047
Also 𝑦 = 𝑠𝑖𝑛2 (0,61) = 0,32818 , hence 0,32348 ≤ 𝑦 ≤ 0,33288
So 𝑦 = 0,3228 ± 5 × 10−3 𝑓𝑜𝑟 𝑥 = 0,61 ± 5 × 10−3

Activity 1.2
1. Determine the maximum error for
(a) 𝑦 = 1 + 𝑐𝑜𝑠𝑥 ; 𝑥 = 0,5 ; ∆𝑥 = 0,01
(b) 𝑦 = 𝑥𝑠𝑖𝑛𝑥 ; 𝑥 = 0,3 ; ∆𝑥 = 0,1
(c) 𝑦 = 1 + 𝑥 2 − 3𝑥 3 , 𝑥 = 0,3 ; ∆𝑥 = 0,1
(d) 𝑦 = 𝑠𝑒𝑐𝑥 ; 𝑥 = 0,12 ; ∆𝑥 = 0,01
(e) 𝑦 = ln(1 + 𝑥) ; 𝑥 = 1,0 ; ∆𝑥 = 0,02
(f) 𝑦 = 𝑠𝑖𝑛ℎ2𝑥 ; 𝑥 = 0,6 ; ∆𝑥 = 0,1

1.3 Evaluating maximum error for a function of two variables


Given 𝑧 = 𝑓(𝑥; 𝑦) where 𝑥 𝑎𝑛𝑑 𝑦 are independent variables and ∆𝑥 𝑎𝑛𝑑 ∆𝑦 are
errors for 𝑥 𝑎𝑛𝑑 𝑦 respectively. To compute the error ∆𝑧 𝑖𝑛 𝑧 we use the
approximation differential
𝜕𝑧 𝜕𝑧
∆𝑧 ≈ 𝜕𝑥 ∆𝑥 + 𝜕𝑦 ∆𝑦.

Analogously for a function 𝑢 = 𝑓(𝑥; 𝑦; 𝑧)


𝜕𝑢 𝜕𝑢 𝜕𝑢
∆𝑢 ≈ 𝜕𝑥 ∆𝑥 + 𝜕𝑦 ∆𝑦 + 𝜕𝑧 ∆𝑧
5

Example 1.4
Let 𝑢 = 𝑥 2 𝑦 3 𝑧 2 𝑤ℎ𝑒𝑟𝑒 ∆𝑥 = 0,2 ; ∆𝑦 = 0,1 𝑎𝑛𝑑 ∆𝑧 = 0,3. If 𝑥, 𝑦 𝑎𝑛𝑑 𝑧 are
𝑥 = 12, 𝑦 = 14 𝑎𝑛𝑑 𝑧 = 12 respectively, determine the maximum error of the product
function 𝑢.
Solution
𝑙𝑛𝑢 = 2𝑙𝑛𝑥 + 3𝑙𝑛𝑦 + 2𝑙𝑛𝑧
1 𝑑𝑢 2 1 𝑑𝑢 3 1 𝑑𝑢 2
=𝑥 ; =𝑦 ; =𝑧
𝑢 𝑑𝑥 𝑢 𝑑𝑥 𝑢 𝑑𝑥

1 𝑑𝑢 2 3 2
= ∆𝑥 + ∆𝑦 + ∆𝑧
𝑢 𝑑𝑥 𝑥 𝑦 𝑧

2 3 2
∆𝑢 = 𝑥 ∆𝑥 + 𝑦 ∆𝑦 + 𝑧 ∆𝑧

2 3
| ∆𝑢| = 𝑢 | | |∆𝑥| + 𝑢 | | |∆𝑦| + 𝑢|∆𝑧|
𝑥 𝑦

Since 𝑥 = 12 , 𝑦 = 14 , 𝑧 = 12 we have
2 3 2
∆𝑢 = 𝑢(12 . 0,2 + 14 . 0,1 + 12 . 0,3)

= 𝑢(0,1047)
≈ 𝑢(0,105) (3𝐷)
∴ maximum % error = 10,5 %

Class activity
Apply the principle as in the example above to calculate the maximum error for
𝑢 = (𝑥 = 1.23)4 (𝑦 = 3,45)2 (𝑧 = 8,54)2
where ∆𝑥 = ∆𝑦 = ∆𝑧 = 0,05

Example 1.5
Given measured quantities 𝐴 = 15,3 , 𝐵 = 5,112 , 𝐶 = 3,9567 and 𝐷 = 11,9457
𝐴2 𝐵𝐶
Determine the error in the calculation of 𝐾 = and determine the interval of
𝐷
accuracy and 𝐾𝑏 (the best accurate value of 𝐾), where ∆𝐴 = 0,05
∆𝐵 = 0,0005 𝑎𝑛𝑑 ∆𝐶 = ∆𝐷 = 0,00005
6

Solution
𝜕𝐾 𝜕𝐾 𝜕𝐾 𝜕𝐾
∆𝐾 = ∆𝐴 + 𝜕𝐵 ∆𝐵 + 𝜕𝐶 ∆𝐶 + 𝜕𝐷 ∆𝐷
𝜕𝐴

2𝐴𝐵𝐶 𝐴2 𝐶 𝐴2 𝐵 𝐴2 𝐵𝐶
∆𝐾 = . ∆𝐴 + ∆𝐵 + ∆𝐶 − ∆𝐷
𝐷 𝐷 𝐷 𝐷2

Let ∆𝐾 = 𝑒𝑘 , ∆𝐴 = 𝑒𝐴 , ∆𝐵 = 𝑒𝐵 , ∆𝐶 = 𝑒𝐶 , ∆𝐷 = 𝑒𝐷
Taking moduli and applying Schwartz inequality (|𝑎 ± 𝑏| ≤ |𝑎| + |𝑏|) we have
2𝐴𝐵𝐶 𝐴2 𝐶 𝐴2 𝐵 𝐴2 𝐵𝐶
|𝑒𝐾 | = | . 𝑒𝐴 + 𝑒𝐵 + . 𝑒𝐶 − . 𝑒𝐷 |
𝐷 𝐷 𝐷 𝐷2

2𝐴𝐵𝐶 𝐴2 𝐶 𝐴2 𝐵 𝐴2 𝐵𝐶
|𝑒𝐾 | ≤ | . 𝑒𝐴 | + | 𝑒𝐵 | + | . 𝑒𝐶 | + |− . 𝑒𝐷 |
𝐷 𝐷 𝐷 𝐷2

2𝐴𝐵𝐶 𝐴2 𝐶 𝐴2 𝐵 𝐴2 𝐵𝐶
|𝑒𝐾 | ≤ | | × 0,05 + | | × 0,0005 + | . 𝑒𝐶 | × 0,00005 + |− . 𝑒𝐷 | × 0,00005
𝐷 𝐷 𝐷 𝐷2

|𝑒𝐾 | ≤ 2,5906 … + 0,0388 … + 0,0050 … + 0,0017 …


≤ 2,6361
𝐴2 𝐵𝐶
But 𝐾 = = 𝟑𝟗𝟔, 𝟑𝟔𝟒𝟗
𝐷

∴ The best value of 𝐾𝑏 lies in the interval [393,7288 … ; 399,001 … ]


The least accurate value in measured quantities is 𝐴 = 15,3 to 3 sf (significant
figures). We round off based on this least accurate value.
Working with (2D) in rounding off we realize that 𝐾𝑏 ∈ [393,73 … ; 399,00 … ]
and ∴ 𝐾𝑏 ≈ 𝟑𝟗𝟔, 𝟎𝟎 (2D)

Activity 1.3
1. (a) For measured quantities 𝑥 = 0,1 𝑎𝑛𝑑 𝑦 = 0,2 𝑤ℎ𝑒𝑟𝑒 ∆𝑥 = 0,005 𝑎𝑛𝑑
∆𝑦 = 0,002, determine the maximum % error in the calculation of
𝑧 = 𝑐𝑜𝑠ℎ2 (𝑥 + 𝑦)
(b) The volume 𝑉 𝑐𝑚3 of a circular cylinder of radius 𝑟 𝑐𝑚 and height ℎ 𝑐𝑚
is given by 𝑉 = 𝜋𝑟 2 ℎ. If 𝑟 = 3 𝑐𝑚 𝑎𝑛𝑑 ℎ = 5 𝑐𝑚 where deviations are 1%
and 5% respectively, determine the absolute maximum error in the calculation
of 𝑉.
(c) Determine the maximum and negative minimum error in the calculation of
𝑅 = ln (3𝐴2 + 2𝐵 3 ) for the measured quantities 𝐴 = 1,41 ; 𝐵 = 1,3 subject to
the tolerance levels ±0,001 𝑎𝑛𝑑 ± 0,002 respectively.
7

(d) The dimensions of a rectangular box are to be measured to be 50 𝑐𝑚 ,


40 𝑐𝑚 and 30 𝑐𝑚, and each measurement is correct to within ±0,2𝑐𝑚.
Estimate the largest possible error when the volume of the box is calculated
and then determine the allowable minimum negative error.
1
(e) The lift 𝐿 of a body in fluid of density 𝜌 is given by 𝐿 = 2 𝐶𝜌𝑉 2 𝐴 where 𝐶

is the lift coefficient, 𝑉 is free stream velocity and 𝐴 is the area covered by
the fluid. If 𝐶 can be measured to within 1%, 𝜌 to within 0,5% , 𝑉 to within
0,6% and 𝐴 to within 1%, determine the maximum percentage error in the
(f) The volume 𝑉 𝑐𝑚3 of a cylinder of radius 𝑟 𝑐𝑚 and height ℎ 𝑐𝑚 is given by
𝑉 = 𝜋𝑟 2 ℎ. If 𝑟 = 3 𝑐𝑚 𝑎𝑛𝑑 ℎ = 5 𝑐𝑚 where deviations are 1% and 5%
from true values respectively. Determine the absolute relative maximum
error in the calculation of the volume of the cylinder.
2. (a) For measured quantities 𝐴 = 2,41 ; 𝐵 = 4,0 ; 𝐶 = 2,91 𝑎𝑛𝑑 𝐷 = 1,711 with
deviation allowances of 0,5% , 5% , 4% 𝑎𝑛𝑑 0,5% respectively, determine
𝐴𝐵
the interval of accuracy in the calculation of 𝑇 = 𝐶 2 𝐷3

(b) Given measured values 𝐶 = 0,211 𝑎𝑛𝑑 𝐷 = 0,4115 and the individual error
deviations of 5 × 10−4 and 5 × 10−5 respectively, determine the limits of
accuracy and the best value 𝑃𝑏 in the calculation of 𝑃 = 𝐶𝑐𝑜𝑠(2𝜋𝐷)

1.4. General Iterative methods


In measurement approximations in general there is always a need to track and
implement tools to minimize errors during calculations to reach meaningful results.
Numerical iterative methods or algorithms become a necessary and handy tool in
this regard.
In computational mathematics an iterative method is a mathematical procedure that
uses an initial guess to generate a sequence/series of improving approximate
solutions to a true solution. Algorithms are often used to generate iterates that
ultimately converge to the true solution.
An iterative method is called convergent if the recurrence of iterates approach a
specific value and agree by a specified number of decimal places.
An iterative sequence/series is one generated by the recurrence relation
𝑥𝑛+1 = 𝑓(𝑥𝑛 ) (𝑛 = 0, 1, 2, … ), the starting value or guessed value is normally 𝑥0 .
8

Illustration
Suppose we want to solve the system of equations
2𝑥 + 3𝑦 = 4 (1)
𝑥2 + 𝑦2 = 3 (2)
using some iterative procedure.
1. The starting point will be to sketch the given curves and note some intercepts that
can help in guessing the starting value 𝑥0

𝑦
4
𝐵
3
2
𝐴 3

𝐶 𝐷 𝑥

√3 ≈ 1,732

2. Assume a value for the intersection point A based on the value of C.

The 𝑥 value at A should slightly be less than √3 say 𝑥 ≈ 1,5. From equation (1)
4−3
if 𝑥 = 1,5 , 𝑦 = ≈ 0,333. Substitution of 𝑦 = 0,333 into (2) ⇒ 𝑥 2 = 3 − (0,333)2
3

∴ 𝑥 ≈ ±1,6997
Now discard the negative value and use 𝑥1 = 1,6997. Return to equation (1) to
determine another 𝑦 – value 𝑦1 that will generate another 𝑥-value 𝑥2 . Use this
value to generate another 𝑦-value that is 𝑦2 . Apply this process until two successive
𝑥-values agree by say 4 decimal places. Rounding off to two decimal places will give
the approximate value of 𝑥 𝑡ℎ𝑎𝑡 𝑖𝑠 𝑥 ∗ 𝑎𝑛𝑑 ℎ𝑒𝑛𝑐𝑒 𝑦 ∗ can be determined. This
process also illustrates the convergence behaviour of 𝑦 𝑣𝑎𝑙𝑢𝑒𝑠 towards a true
solution of the system.
If the process is carried out consistently and accurately the iterates will be as follows

𝑥0 𝑎𝑠𝑠𝑢𝑚𝑒𝑑, 𝑎𝑙𝑙 𝑜𝑡ℎ𝑒𝑟 𝑥 𝑣𝑎𝑙𝑢𝑒𝑠 𝑓𝑟𝑜𝑚 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 (2) 𝑦 𝑣𝑎𝑙𝑢𝑒𝑠 𝑓𝑟𝑜𝑛 𝑢𝑠𝑖𝑛𝑔 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 (1)
𝒙 𝒚
𝑥0 = 1,50 ; 0,3333
𝑥1 = 1,699 ; 0,2000
𝑥2 = 1,721 ; 0,1863
𝑥3 = 1,722 ; 0,1853
9

𝑥4 = 1,722 ; 0,1852
𝑥5 = 1,722 ; 0,1852
∴ 𝑥 ∗ ≈ 1,72 𝑎𝑛𝑑 𝑦 ∗ ≈ 0,19
NB: Rounding off in intermediate steps may result into a slight difference in values
compared to the above scheme. The total error deviation at the end is a result of the
propagated errors inherited in between steps.

Class Activity
Establish an iterative procedure to determine the root of the polynomial
𝑦 = 𝑓(𝑥) = 𝑥 3 + 2𝑥 − 4

Formal iterative algorithms


Algorithms for iterative procedures may be established using mathematical
manipulations based on recurrence relations observed and or the sequence of data
generation in computations as in the next example.

Example 1.6
Determining the algorithm for a sum to infinity of a convergent geometric progression
Given a geometric progression
𝑆 = 𝑎 + 𝑎𝑟 + 𝑎𝑟 2 + 𝑎𝑟 3 + ⋯ + 𝑎𝑟 𝑛−1 + ⋯
Let the sum of 𝑎 to 𝑛 terms be 𝑆𝑛 then
𝑆𝑛 = 𝑎 + 𝑎𝑟 + 𝑎𝑟 2 + 𝑎𝑟 3 + ⋯ + 𝑎𝑟 𝑛−1
= 𝑎 + 𝑟(𝑎 + 𝑎𝑟 + 𝑎𝑟 2 + ⋯ + 𝑎𝑟 𝑛−2 )
= 𝑎 + 𝑟𝑆𝑛−1
So 𝑆𝑛 = 𝑎 + 𝑟𝑆𝑛−1 is the iterative formula to find the sum to infinity.
This simple manipulation results into an algorithm that can be used to test
convergence of iterates in a geometric progression.

1.5 Newton-Raphson (Determining the roots of non-linear equation)


One of many algorithms for iterative procedures is the Newton-Raphson method.
The Newton- Raphson method is an iterative process of approximating the root(s) of
non-linear equations based on an assumed/guessed value or a value which can be
obtained by graphing.
10

The Newton-Raphson general formula is given by


𝑓(𝑥 )
𝑥𝑛+1 = 𝑥𝑛 − 𝑓ʹ(𝑥𝑛 ) , 𝑓ʹ(𝑥𝑛 ) ≠ 0 𝑤ℎ𝑒𝑟𝑒 𝑛 = 0, 1, 2, …
𝑛

Given 𝑓(𝑥) = 0 we assume a value 𝑥0 within the identified range from graphing. We
then substitute this value in the formula to generate the next value 𝑥1 value and use
𝑥1 to generate 𝑥2 , …
The iteration values generated by this formula will converge towards the root of the
function. Approximations may be terminated after two successive 𝑥 values agree by
a pre-determined or stated number of decimal places. If by rounding off the last two
iterates we find that these numbers are equal, then this becomes the approximation
to the solution of the equation correct to the required number of decimal places

Example 1.6
Use Newton-Raphson method to approximate the root of the equation 𝑥 3 − 𝑥 − 1 = 0
closest to 𝑥0 = 1. Do calculations until two successive iterations agree by 5 decimal
places and then give the approximation correct to three decimal places.
Solution
𝑓(𝑥𝑛 ) = 𝑥 3 − 𝑥 − 1 𝑎𝑛𝑑 𝑓ʹ(𝑥𝑛 ) = 3𝑥 2 − 1
Assumed value 𝑥0 = 1, starting with 𝑛 = 0
𝑓(𝑥 )
𝑥1 = 𝑥0 − 𝑓ʹ(𝑥0 )
0

(1)3 −(1)−1
= 1−[ ]
3(1)2 −1

= 1,50000
(1,5)3 −(1,5)−1
𝑥2 = 1,5 − [ ]
3(1,5)2 −1

= 1,34783
Carrying on we find that 𝑥3 = 1,32520 , 𝑥4 = 1,32472 𝑎𝑛𝑑 𝑥5 = 1,32472
The last two iterates agree by 5 decimal places. Rounding off 𝑥4 𝑎𝑛𝑑 𝑥5 correct to
three decimal places we get 𝑥 ≈ 1,325
The Newton-Raphson method can be used to solve optimization problems by
constructing a sequence {𝑥𝑛 } from an initial guess 𝑥0 ∈ ℝ that converges towards
a minimizer 𝑥 ∗ of 𝑓(𝑥) by using a sequence of second order Taylor
approximations of 𝑓(𝑥) around iterates.
The general form of this numerical iteration is
𝑓ʹ(𝑥 )
𝑥𝑛+1 = 𝑥𝑛 − 𝑓″(𝑥𝑛 ) , 𝑓 ″ (𝑥𝑛 ) ≠ 0, 𝑛 = 1, 2, 3, …
𝑛
11

Example 1.7
An object moves according to the equation 𝑠(𝑡) = 𝑡 4 − 2𝑡 2 − 4.
Use Newton-Raphson method to approximate the minimum saddle/ stationery point
closest to 𝑡 = 1,1 and then determine the minimum displacement.
Solution
𝑠(𝑡) = 𝑡 4 − 2𝑡 2 − 4 , 𝑠ʹ(𝑡) = 4𝑡 3 − 4𝑡 , 𝑠 ″ (𝑡) = 12𝑡 2 − 4 , 𝑡0 = 1,1
𝑓ʹ(𝑡 )
𝑡𝑛+1 = 𝑡𝑛 − 𝑓″(𝑡𝑛 )
𝑛

4(1,1)3 −4(1,1)
𝑡1 = 1,1 − [ ]
12(1,1)2 −4

= 0,9741
4(0,9741)3 −4(0,9741)
𝑡2 = 0,9741 − [ ]
12(0,9741)2 −4

= 1,0011
4(0,9741)3 −4(0,9741)
𝑡3 = 0,9741 − [ ]
12(0,9741)2 −4

= 1,0011
4(1,0011)3 −4(1,0011)
𝑡4 = 1,0011 − [ ]
12(1,0011)2 −4

= 1,0000
𝑡5 = 1,0000
∴ 𝑡 ≈ 1,00 (2D)
Minimum displacement is 𝑠(1) = −5 ⇒ 5 units below the horizontal

Activity 1.4
1. Use Newton-Raphson method to approximate the roots of the following equations
correct to three decimal places subject to the initial condition given
(a) 𝑥 − 𝑐𝑜𝑠𝑥 = 0 , 𝑥0 = 0,7
(b) 𝑒 𝑥 − 2𝑥 − 5 = 0 , 𝑥0 = −2
(c) 𝑙𝑛𝑥 − 5 = 0 , 𝑥0 = 0,5
(d) 𝑐𝑜𝑠ℎ2𝑥 − 𝑥 = 0 , 𝑥0 = 0,3
12

2. The motion of an object is defined by 𝑠𝑖𝑛𝑥 + 𝑐𝑜𝑠𝑥 − 1 = 0. Use Newton-Raphson


method to approximate the position of the object closest to the point 𝐵 if the
guessed value is 𝑥0 = 1.2. Do all calculations correct to four decimal places and
give the final answer correct to 2 decimal places.
3. If a body moves according to the equation 𝑓(𝑥) = 𝑐𝑜𝑠2𝑥 − 𝑥.
Use Newton-Raphson to approximate the saddle point closest to −0,25.
Test whether this is a minimizer or not? (Use 4 decimal places throughout the
calculation).
4. Given that an object follows a path defined 𝑠(𝑡) = 12ℎ2 − 4ℎ − 1 , determine
whether the iterations closest to 𝑡 = 0,15 converge towards the minimizer or
𝑡𝑛+1 −𝑡𝑛
maximizer, and then compute the error in the 2nd iterate if |∈𝑎 | = | |.
𝑡𝑛+1

Compute until two successive iterates agree to 4 decimal places and provide final
answer correct to 2 decimal places.
13

Unit 2

2.Finite differences and Interpolation

Introduction
Interpolation is a process of finding equations to approximate straight lines and
curves that best fit given sets of data/experimental data. This process also
involves the establishment of schemes or construction of tables using forward,
backward, shift, central and divided differences iterative techniques.

By the end of this unit, you should be able to:

1. establish forward, backward and divided difference schemes

2. use interpolation schemes to approximate function values

3. predict errors in interpolation schemes

4. solve differential equations using finite differences

1. use Newton-Raphson method to determine minimizers /maximizers


Classification of difference operators
of functions
• Forward difference operator, ∆𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥)
• Backward difference operator, ∇𝑓(𝑥) = 𝑓(𝑥) − 𝑓(𝑥 − ℎ)
𝑓(𝑥𝑛+1 )−𝑓(𝑥𝑛 )
• Divided difference operator, 𝛿𝑓(𝑥) = (𝑥𝑛+1 )−𝑥𝑛
, 𝑛 = 0, 1 2, … , 𝑛 − 1

2.1. Interpolation
Many times, data is given only at discrete points such as
(𝑥0 ; 𝑦0 ) , (𝑥1 ; 𝑦1 ), … (𝑥𝑛−1 ; 𝑦𝑛−1 ), (𝑥𝑛 ; 𝑦𝑛 )
A continuous function 𝑓(𝑥) may be used to represent the 𝑛 + 1 data values with
𝑓(𝑥) passing through the 𝑛 + 1 points. As a result one can find the value of 𝑦 at any
other value of 𝑥 . This is called interpolation.
If the value to be approximated falls outside the range of the data given, the process
of estimating such a value is called extrapolation. To illustrate this method we start
with linear interpolation.
14

Definition 2.1
Let 𝐴(𝑥0 ; 𝑦0 ) 𝑎𝑛𝑑 𝐵(𝑥1 ; 𝑦1 ) be distinct points on the 𝑥𝑦- plane, then the linear
interpolation curve that passes through the points is given by
𝑥−𝑥1 𝑥−𝑥0
𝑃(𝑥) = 𝐿0 𝑓(𝑥0 ) + 𝐿1 𝑓(𝑥1 ) where 𝐿0 = 𝑥 𝑎𝑛𝑑 𝐿0 = 𝑥
0 −𝑥1 1 −𝑥0

Example 2.1
Determine the linear interpolation polynomial that best fit the points
1
𝑄 (2 ; 0) 𝑎𝑛𝑑 𝑅(3; 5) and then use the polynomial to estimate 𝑓(−1)

Solution
1
𝑥−𝑥1 𝑥−3 𝑥−3 𝑥−𝑥0 𝑥− 2𝑥−1
2
𝐿0 = 𝑥 = 1 =− , 𝐿1 = 𝑥 = 1 =
0 −𝑥1 −3 10 1 −𝑥0 3− 5
2 2

𝑃(𝑥) = 𝐿0 𝑓(𝑥0 ) + 𝐿1 𝑓(𝑥1 )


𝑥−3 2𝑥−1
= ×0+ ×5
10 5

= 2𝑥 − 1
Hence 𝑓(−1) = 2(−1) − 1 = −3

2.2. Quadratic Interpolation


If 𝐴(𝑥0 ; 𝑦0 ) , 𝐵(𝑥1 ; 𝑦1 ) 𝑎𝑛𝑑 𝐵(𝑥2 ; 𝑦2 ) are given points, then the quadratic
interpolation polynomial is given by
𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥0 𝑥−𝑥2 𝑥−𝑥0 𝑥−𝑥1
𝑃(𝑥) = 𝑥 ×𝑥 . 𝑓(𝑥0 ) + ×𝑥 . 𝑓(𝑥1 ) + ×𝑥 . 𝑓(𝑥2 )
0 −𝑥1 0 −𝑥2 𝑥1 −𝑥0 1 −𝑥2 𝑥2 −𝑥0 2 −𝑥1

Class Activity
1. (a) Determine the quadratic interpolation polynomial that passes through the points
(0; 1) , (2; 1) 𝑎𝑛𝑑 (3; 4) and then use the resulting curve to evaluate 𝑓(5) .

2.3. Lagrange Interpolation


The Lagrange general interpolation formula for 𝑁 number of paired points is given by
(𝑥−𝑥1 )(𝑥−𝑥2 )… (𝑥−𝑥𝑁 ) (𝑥−𝑥0 )(𝑥−𝑥1 ) … (𝑥−𝑥𝑁 )
𝑃(𝑥𝑁 ) = (𝑥 . 𝑓(𝑥0 ) + . 𝑓(𝑥1 ) +
0 −𝑥1 )(𝑥0 −𝑥2 ) … (𝑥0 −𝑥𝑁 ) (𝑥1 −𝑥0 )(𝑥1 −𝑥2 ) …( 𝑥1 −𝑥𝑁 )

(𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑁−1 )
…+ . 𝑓(𝑥𝑁 )
(𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … (𝑥𝑁 − 𝑥𝑁−1 )
15

Example 2.2
Use Lagrange interpolation polynomial of the 1𝑠𝑡 and the 2𝑛𝑑 order to evaluate
𝑓(2) for
𝑥0 = 1 𝑓(𝑥0 ) = 0
𝑥1 = 4 𝑓(𝑥1 ) = 1,386294
𝑥2 = 6 𝑓(𝑥2 ) = 1,791760

Solution
Evaluating using polynomial of the first order
𝑥−𝑥1 𝑥−𝑥0
𝑓1 (𝑥) = 𝑥 × 𝑓(𝑥0 ) + 𝑥 × 𝑓(𝑥1 ) , 𝑓(2) ⇒ 𝑥 = 2
0 −𝑥1 1 −𝑥0

So
2−4 2−1
𝑓1 (2) = .0 + . 1,386294
1−4 4−1

= 0,4620981
Evaluating using polynomial of the second order
(𝑥−𝑥1 )(𝑥−𝑥2 ) (𝑥−𝑥0 )(𝑥−𝑥2 )
𝑓1 (𝑥) = (𝑥 × 𝑓(𝑥0 ) + (𝑥 × 𝑓(𝑥1 )
0 −𝑥1 )(𝑥0 −𝑥2 ) 1 −𝑥0 )(𝑥1 −𝑥2 )

(𝑥−𝑥0 )(𝑥−𝑥2 )
+ × 𝑓(𝑥2 ) , 𝑓(2) ⇒ 𝑥 = 2
(𝑥2 −𝑥0 )(𝑥2 −𝑥1 )

So
(2−4)(2−6) (2−1)(2−6) (2−1)(2−4)
𝑓1 (2) = (1−4)(1−6) . 0 + (4−1)(4−6) . 1,386294 + (4−1)(6−4) . 1,791760

= 0,56584444

2.4. Finite Difference interpolation schemes


Introduction
In using finite differences for interpolating polynomials that best fit given discrete
data we start by constructing a difference table based on the sequence of values,
say … , 𝑥−2 , 𝑥−1 , 𝑥0 , 𝑥1 , 𝑥2 , … of 𝑥 and corresponding function values 𝑓(𝑥) of 𝑥. In
the work that follows 𝑓(𝑥) will usually be a polynomial in 𝑥 or will be an approximate
to a polynomial in the range of values under consideration. There are three common
types of finite differences that will be used in this section, ∆𝑓 and operator denoting
(forward differences, ∇𝑓 denoting backward differences and 𝛿𝑓 denoting divided
differences.
16

The procedure of constructing a finite difference table is demonstrated through the


next example.

Example 2.3
Suppose an experimental data is tabulated for 𝑥 values (inputs) and corresponding
values 𝑦 = 𝑓(𝑥) (outputs) as indicated below. Construct a finite difference scheme
for the data.

𝑥 0 1 2 3 4 5 6 7 8

𝑦 0,00 0,21 0,51 0,96 1,66 2,68 4,10 5,98 8,40

Solution
The finite difference scheme is as follows

𝑥 𝑓(𝑥)
0 0,00
0,21
1 0,21 0,09
0,30 0,06
2 0,51 0,15 0,04
0,45 0,10 -0,07
3 0,96 0,25 -0,03 0,11
0,70 0,07 0,04 -0,18
4 1,66 0,38 0,01 -0,07 0,32
1,02 0,08 -0,03 0,14
5 2,68 0,40 -0,02 0,07
1,42 0,06 0,04
6 4,10 0,46 0,02
1,88 0,08
7 5,98 0,54
2,42
8 8,40

2.4.1 Newton’s forward interpolation


Let 𝑥0 , 𝑥1 , 𝑥2 , … ., 𝑥𝑛 be discrete points and have associated function values
𝑥−𝑥0
𝑦0 = 𝑓(𝑥0 ), 𝑦1 = 𝑓(𝑥1 ), 𝑦2 = 𝑓(𝑥2 ), … , 𝑦𝑛 = 𝑓(𝑥𝑛 ) , 𝑝 = , 𝑥 being the value

𝑏−𝑎
to be approximated, and ℎ = 𝑛−1 is called the step size.

The forward interpolation polynomial is then given by


17

𝑝∆𝑦0 𝑝(𝑝−1)∆2 𝑦0 𝑝(𝑝−1)(𝑝−2)∆3 𝑦0


𝑃(𝑥) = 𝑦0 + + + +⋯
1! 2! 3!

𝑝(𝑝−1)(𝑝−2)(𝑝−3)…(𝑝−𝑛+1)∆𝑛 𝑦𝑛
+ 𝑛!

Example 2.4
Use Newton’s forward interpolation scheme to determine the polynomial that best fit
the given data and use the polynomial to estimate 𝑓(3,17)

𝑥 0 0,6 1,0 1,2 1,3


𝑓(𝑥) 3,1 3,2 3,3 3,4 3,5

Solution
The forward difference scheme isType equation here.
𝑥 𝑓(𝑥) ∇𝑓 ∆2 𝑓 ∆3 𝑓 ∆4 𝑓 ∆5 𝑓 ∆6 𝑓 ∆7 𝑓
3.1 0
0,6
3.2 0,6 -0,2
0,4 0
3.3 1,0 -0,2 0,1
0,2 0,1
3.4 1.2 -0,1
0,1
3.5 1,3

𝑛 = 5 , 𝑓(3,17) ⇒ 𝑥 = 3,17
𝑏−𝑎 3,5−3.1 𝑥−𝑥0 3,17−3.1
ℎ = 𝑛−1 = = 0,1 𝑝= = = 0,7
4 ℎ 0,1

𝑝∆𝑦0 𝑝(𝑝−1)∆2 𝑦0 𝑝(𝑝−1)(𝑝−2)∆3 𝑦0


𝑃(𝑥) = 𝑦0 + + + +⋯
1! 2! 3!

𝑝(𝑝−1)(𝑝−2)(𝑝−3)…(𝑝−𝑛+1)∆𝑛 𝑦𝑛
+ 𝑛!

Replace ∆′ 𝑠 𝑏𝑦 𝑥, 𝑥 2 , 𝑥 3 𝑎𝑛𝑑 𝑥 4
𝑝𝑥 𝑝(𝑝−1)𝑥 2 𝑝(𝑝−1)(𝑝−2)𝑥 3 𝑝(𝑝−1)(𝑝−2)(𝑝−3)𝑥 4
𝑃(𝑥) = 𝑦0 + + + +
1! 2! 3! 4!

0,7𝑥 0,7(−0,3)𝑥 2 0,7(−0,3)(−1,3)𝑥 3 0,7(−0.3)(−1,3)(−2,3)𝑥 4


𝑝 = 0,7 ⇒ 𝑓(𝑥) = 𝑦0 + + + +
1! 2! 3! 4!

= 𝑦0 + 0,7𝑥 − 0,105𝑥 2 + 0,046𝑥 3 − 0,026𝑥 4 (1)

Apply the replacement 𝑦0 𝑏𝑦 0 ; 𝑥 𝑏𝑦 0,6 ; 𝑥 2 𝑏𝑦 − 0,2 ; 𝑥 3 𝑏𝑦 0 ; 𝑥 4 = 0,1 into


equation (1)
18

So 𝑓(3,17) = 0 + 0,7(0,6) − 0,105(−0,2) + 0,046(0) − 0,026(0,1)


= 0,4383
≈ 0,44 (2D)

2.4.2 Newton’s backward interpolation


Let 𝑥0 , 𝑥1 , 𝑥2 , … ., 𝑥𝑛 be discrete points and have associated function values
𝑦0 = 𝑓(𝑥0 ), 𝑦1 = 𝑓(𝑥1 ), 𝑦2 = 𝑓(𝑥2 ), … , 𝑦𝑛 = 𝑓(𝑥𝑛 )
𝑥−𝑥𝑛
and 𝑝 = (𝑤ℎ𝑒𝑟𝑒 𝑥 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑡𝑜 𝑏𝑒 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒𝑑) 𝑎𝑛𝑑

𝑏−𝑎
ℎ(𝑠𝑡𝑒𝑝 𝑠𝑖𝑧𝑒) = 𝑛−1 and 𝑎 ≤ 𝑥 ≤ 𝑏, then the backward interpolation polynomial is
given by
𝑝∆𝑦1 𝑝(𝑝+1)∆2 𝑦2 𝑝(𝑝+1)(𝑝+2)∆3 𝑦3
𝑃(𝑥) = 𝑦𝑛 + + + +⋯
1! 2! 3!

𝑝(𝑝+1)(𝑝+2)(𝑝+3)…(𝑝+𝑛−1)∆𝑛 𝑦𝑛
+ 𝑛!

Example 2.5
Estimate 𝑓(42) from the given data using Newton’s backward interpolation

𝑥 20 25 30 35 40 45
𝑓(𝑥) 354 332 291 260 231 204

Solution
The forward difference scheme isType equation here.
𝑥 𝑓(𝑥) ∇𝑓 ∇2 𝑓 ∇3 𝑓 ∇4 𝑓 ∇5 𝑓 ∇6 𝑓 ∇7 𝑓
20 354
-22
25 332 -19
-41 29
30 291 -10 -37
-31 -8 45
35 260 2 8
-29 0
40 231 2
-27
45 204

𝑛 = 6 , 𝑓(42) ⇒ 𝑥 = 42
𝑏−𝑎 45−20 𝑥−𝑥𝑛 42−45
ℎ = 𝑛−1 = =5 𝑝= = = −0,6
5 ℎ 5
19

𝑝𝑥 𝑝(𝑝+1)𝑥 2 𝑝(𝑝+1)(𝑝+2)𝑥 3 𝑝(𝑝+1)(𝑝+2)(𝑝+3)𝑥4 𝑝(𝑝+1)(𝑝+2)(𝑝+3)(𝑝+4)𝑥 5


𝑃(𝑥) = 𝑦𝑛 + + + + +
1! 2! 3! 4! 5!

−0,6𝑥 −0,6(0,4)𝑥 2 −0,6(0,4)(1,4)𝑥3 −0,6(0.4)(1,4)(2,4)𝑥4 −0,6(0.4)(1,4)(2,4)(3,4)𝑥 5


𝑓(𝑥) = 𝑦𝑛 + + + + +
1! 2! 3! 4! 5!

= 204 − 0,6𝑥 − 0,120𝑥 2 − 0,056𝑥 3 − 0,034𝑥 4 − 0,023𝑥 5


Replacement: 𝑥 𝑏𝑦 127, 𝑥 2 𝑏𝑦 2 , 𝑥 3 𝑏𝑦 0 , 𝑥 4 𝑏𝑦 8 𝑎𝑛𝑑 𝑥 5 𝑏𝑦 45
So 𝑓(42) = 204 − 0,6(−27) − 0,120(2) − 0,056(0) − 0,034(8) − 0,023(45)
= 218,653
≈ 218,7 (2D)

2.4.3 Newton’s divided difference interpolation


Let 𝑥0 , 𝑥1 , 𝑥2 , … ., 𝑥𝑛 be discrete data values/experimental measurements
and 𝑦0 = 𝑓(𝑥0 ), 𝑦1 = 𝑓(𝑥1 ), 𝑦2 = 𝑓(𝑥2 ), … , 𝑦𝑛 = 𝑓(𝑥𝑛 ) be associated function
values then the divided difference polynomial that best fit the given data is
described by
𝑃(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 )𝑓(𝑥0 ; 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓(𝑥0 ; 𝑥1 ; 𝑥2 )
+ ⋯ + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … 𝑓(𝑥0 ; 𝑥1 ; 𝑥2 ; … 𝑥𝑛−1 )
𝑓(𝑥1 )−𝑓(𝑥1 ) 𝑓(𝑥2 )−𝑓(𝑥1 )
where 𝑓(𝑥0 ; 𝑥1 ) = , 𝑓(𝑥0 ; 𝑥1 ; 𝑥2 ) = , ….
𝑥1 −𝑥0 𝑥2 −𝑥1

Example 2.6
Determine the divided difference polynomial for the data below and then
estimate 𝑓(1).
𝑥 -1 0 2 5
𝑓(𝑥) 7 10 22 235

Solution
The divided difference scheme is as follows
𝑥 𝑓(𝑥) 𝛿1 𝑓 𝛿2 𝑓 𝛿3 𝑓 𝛿4 𝑓 𝛿5 𝑓 𝛿6 𝑓 𝛿7 𝑓
-1 7
3
0 10 1
6 2
2 22 13
71
5 235
20

𝑓(1) ⇒ 𝑥 = 1
𝑓(𝑥) = 7 + (𝑥 + 1) × 3 + (𝑥 + 1)(𝑥) × 1 + (𝑥 + 1)(𝑥)(𝑥 − 2) × 2
= 2𝑥 3 − 𝑥 2 + 10
∴ 𝑓(1) = 2(1)3 − (1)2 + 10
= 11

Activity 2.1
1. Use the data in the table to determine the Lagrange polynomial of the first and
second order and then use both orders to estimate 𝑓(4) 𝑎𝑛𝑑 𝑓(−3).
𝑥 1 0 2 3
𝑓(𝑥) 2 7 8 6

2. Determine the forward difference interpolation polynomial for the data in the table
and then estimate 𝑓ʹ(6)
3. Estimate 𝑓(−1) 𝑎𝑛𝑑 𝑓(6) for the data in the table using the backward interpolation
𝑥 0 1 2 3 4
𝑓(𝑥) 1 3 13 37 81

4. Deduce the divided difference polynomial from the scheme of the data given and
then approximate 𝑓(2)
𝑥 -1,0 0,0 0,5 1,0 2,5
𝑓(𝑥) 3,0 -2,0 -0,375 3,0 16,125

5. Use Newton’s divided difference scheme to determine the polynomial satisfied by


(−4; 1245) , (−1; 33), (0; 5), (2; 9), (5; 1335)

2.5. Propagation of Errors


When working with difference schemes one obvious observation is the common
characteristic spread of the values. If one value has an error, then this error is
carried over in a triangular form throughout the expansion. Ignoring the signs of
coefficients, the pattern resembles the binomial expansion.
21

The pattern of how the errors spread resemble the Pascal’s triangle.
1
1 1
1 2 1
The coefficients in the triangle show the pattern of the error magnitude. This
phenomenon is known as error propagation.
Illustration
0 , 𝑖≠𝑘
Consider the function ∈𝑖 = { , which is zero at all grid points except where
∈ , 𝑖=𝑘
it is ∈.The resulting difference scheme is as follows

0
0
0 0
0 0
0 0 ∈
0 ∈
0 ∈ -4∈
∈ -3∈
∈ −2 ∈ 6∈
-∈ 3∈
0 ∈ -4∈
0 −∈
0 0 ∈
0 0
0 0
0
0

2.6. Solutions of differential equations using finite differences


In approximating solutions, we may be interested in tracking steps towards the
solution using intermediate steps instead of looking only at the final solution
We study a method of approximating a solution to a differential equation by first
observing the behaviour at interior mesh points (iterates). The general form of the
differential equation of interest is
𝑦 ″ = 𝑓(𝑥; 𝑦; 𝑦ʹ) ; 𝑦(𝑎) = 𝛼 ; 𝑦(𝑏) = 𝛽 over the interval [𝑎 ; 𝑏]
where 𝑛 = 𝐴 is the number of subintervals of [𝑎 ; 𝑏].
22

Recall the Taylor series expansion of a function 𝑦 = 𝑓(𝑥) about a point 𝑥 = 𝑥0


ℎ𝑓ʹ(𝑥0 ) ℎ2 𝑓″(𝑥0 ) ℎ3 𝑓‴(𝑥0 )
given by 𝑓(𝑥) = 𝑓(𝑥0 ) + + + + ⋯ . Converting this to forward
1! 2! 3!
difference form we have
ℎ2 𝑦″(𝑥) ℎ3 𝑦‴(𝑥)
𝑦(𝑥 + ℎ) = 𝑦(𝑥) + ℎ𝑦ʹ(𝑥) + + +⋯ (1)
2 6

where ℎ is a small interval called a “step size”


Taking the backward difference form we have
ℎ2 𝑦 ″ (𝑥) ℎ3 𝑦‴(𝑥)
𝑦(𝑥 − ℎ) = 𝑦(𝑥) − ℎ𝑦ʹ(𝑥) + − +⋯ (2)
2 6

If we ignore terms containing ℎ2 , ℎ3 , … equation (1) and (2) yield


1
𝑦ʹ(𝑥) = ℎ [𝑦(𝑥 + ℎ) − 𝑦(𝑥)] (3)
1
𝑦ʹ(𝑥) = ℎ [𝑦(𝑥) − 𝑦(𝑥 − ℎ)] (4)
1
Subtracting (1) and (2) gives 𝑦ʹ(𝑥) = 2ℎ [𝑦(𝑥 + ℎ) − 𝑦(𝑥 − ℎ)] (5)

Ignoring terms containing ℎ3 and higher by adding (10) and (2) we get
1
𝑦 ″ (𝑥) = ℎ2 [𝑦(𝑥 + ℎ) − 2𝑦(𝑥) + 𝑦(𝑥 − ℎ)] (6)

The right-hand sides of equations (3), (4), (5) and (6) are called difference equations
The general form of a difference equation is given by
𝑦 ″ + 𝑃(𝑥)𝑦ʹ + 𝑄(𝑥)𝑦 = 𝑓(𝑥) (7)
where 𝑦(𝑎) = 𝛼 , 𝑦(𝑏) = 𝛽 and 𝑎 < 𝑥1 < 𝑥2 , … < 𝑎𝑛 ; 𝑥𝑖 = 𝑎 + 𝑖ℎ are interior
𝑏−𝑎
points of [𝑎 ; 𝑏] ; 𝑦𝑖 = 𝑦(𝑥𝑖 ) ; 𝑃𝑖 = 𝑃(𝑥𝑖 ) ; 𝑄𝑖 = 𝑄(𝑥𝑖 ) ; 𝑓𝑖 = 𝑓(𝑥𝑖 ) 𝑎𝑛𝑑 ℎ = 𝑛

If 𝑦″ and 𝑦ʹ in equation (7) are replaced by central differences then we have


𝑦𝑖+1 −2𝑦𝑖 +𝑦𝑖−1 𝑃𝑖 𝑦𝑖+1 −𝑦𝑖−1
+ + 𝑄𝑖 𝑦𝑖 = 𝑓𝑖
ℎ2 2ℎ

After simplifying we get the finite difference equation


ℎ ℎ
(1 + 2 𝑃𝑖 ) 𝑦𝑖+1 + (−2 + ℎ2 𝑄𝑖 )𝑦𝑖 + (1 − 2 𝑃𝑖 ) 𝑦𝑖−1 = ℎ2 𝑓𝑖 (8)

Example 2.7
Use the finite difference equation to approximate the solution of the differential
equation at interior mesh points and write down the particular solution.
𝑦 ″ − 4𝑦 = 0 , 𝑦(0) = 0 ; 𝑦(1) = 5 𝑓𝑜𝑟 𝑛 = 4
23

Solution
𝑏−𝑎 1−0 1
𝑃(𝑥) = 0 , 𝑄(𝑥) = −4 , 𝑓(𝑥) = 0 , ℎ = = =4
𝑛 4

1 1
𝑥0 = 𝑎 = 0 , 𝑦0 = 0 . 𝑥𝑖 = 𝑎 + 𝑖ℎ ⇒ 𝑖𝑛𝑡𝑒𝑟𝑖𝑜𝑟 𝑚𝑒𝑠ℎ 𝑝𝑜𝑖𝑛𝑡𝑠 𝑎𝑟𝑒 𝑥1 = 0 + 1 (4) = 4 ,
1 3
𝑥2 = 2 , 𝑥3 = 4 , 𝑥4 = 1 = 𝑏 . The big interval is [𝑎; 𝑏] = [0; 1]

Substituting ℎ = 0,25 , 𝑃(𝑥) = 0 , 𝑄(𝑥) = −4 𝑎𝑛𝑑 𝑓(𝑥) 𝑖𝑛𝑡𝑜


ℎ ℎ
(1 + 𝑃𝑖 ) 𝑦𝑖+1 + (−2 + ℎ2 𝑄𝑖 )𝑦𝑖 + (1 − 𝑃𝑖 ) 𝑦𝑖−1 = ℎ2 𝑓𝑖
2 2
The differential equation is now of the form
𝑦𝑖+1 − 2,25𝑦𝑖 + 𝑦𝑖−1 = 0
If 𝑖 = 1: 𝑦2 − 2,25𝑦1 + 𝑦0 = 0
If 𝑖 = 2: 𝑦3 − 2,25𝑦2 + 𝑦1 =0
If 𝑖 = 3: 𝑦4 − 2,25𝑦3 + 𝑦2 =0
We now consider the conditions at 𝑎 𝑎𝑛𝑑 𝑏 𝑜𝑓 𝑡ℎ𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙 𝑖. 𝑒 𝑦0 = 0 , 𝑦4 = 5
The system becomes
−2,25𝑦1 + 𝑦2 =0 (1)
𝑦1 − 2,25𝑦2 + 𝑦3 = 0 (2)
𝑦2 − 2,25𝑦3 = −5 (3)
𝑦2 +5
From (3) 𝑦3 = , substituting 𝑦3 into (2) and using (1) to eliminate one variable
2,25
results into the solution at interior mesh points as
𝑦1 = 0,7256 , 𝑦2 = 1.6327 𝑎𝑛𝑑 𝑦3 = 2,9479
Recall that the complementary function of the differential equation with auxiliary
equation
𝑚2 − 4 = 0 can be stated as 𝑦𝐶𝐹 = 𝐴𝑒 2𝑥 + 𝐵𝑒 −2𝑥 or alternatively
𝑦𝐶𝐹 = 𝐶1 𝑐𝑜𝑠ℎ2𝑥 + 𝐶2 𝑠𝑖𝑛ℎ2𝑥
Let us consider 𝑦𝐶𝐹 = 𝐶1 𝑐𝑜𝑠ℎ2𝑥 + 𝐶2 𝑠𝑖𝑛ℎ2𝑥
Employing the condition 𝑦(0) = 0 ⇒ 𝐶1 𝑐𝑜𝑠ℎ0 + 𝐶2 𝑠𝑖𝑛ℎ0 = 0 ∴ 𝐶1 = 0
5
The condition 𝑦(1) = 5 ⇒ 𝐶2 𝑠𝑖𝑛ℎ2(1) = 5 ∴ 𝐶2 = 𝑠𝑖𝑛ℎ2 ≈ 1,3786

Hence 𝑦𝐶𝐹 = 1,3786 𝑠𝑖𝑛ℎ2𝑥


24

Example 2.8
Use the finite difference equation to solve
𝑦 ″ + 9𝑦 = 0 , 𝑦(1) = 1 ; 𝑦(2) = 2 𝑓𝑜𝑟 𝑛 = 4
Solution
ℎ ℎ
The difference equation is (1 + 2 𝑃𝑖 ) 𝑦𝑖+1 + (−2 + ℎ2 𝑄𝑖 )𝑦𝑖 + (1 − 2 𝑃𝑖 ) 𝑦𝑖−1 = ℎ2 𝑓𝑖

From 𝑚2 + 9 = 0 , 𝑦𝐶𝐹 = 𝐶1 𝑐𝑜𝑠3𝑥 + 𝐶2 𝑠𝑖𝑛3𝑥


𝑏−𝑎 1
Further 𝑃(𝑥) = 0 , 𝑄(𝑥) = 9 , 𝑓(𝑥) = 0 , ℎ = =4
𝑛
5 6 7
Interior mesh points are 𝑥1 = 4 𝑥2 = 4 , 𝑥3 = 4 , 𝑎 = 1 𝑎𝑛𝑑 𝑏 = 2

The differential equation is converted and becomes


𝑦𝑖+1 − 1,4375𝑦𝑖 + 𝑦𝑖−1 = 0
If 𝑖 = 1: 𝑦2 − 1,4375𝑦1 + 𝑦0 = 0
If 𝑖 = 2: 𝑦3 − 1,4375𝑦2 + 𝑦1 = 0
If 𝑖 = 3: 𝑦4 − 1,4735𝑦3 + 𝑦2 = 0
For 𝑦0 = 1 , 𝑦4 = 2
−1,4375𝑦1 + 𝑦2 = −1 (1)
𝑦1 − 1,4375𝑦2 + 𝑦3 = 0 (2)
𝑦2 − 1,4375𝑦3 = −2 (3)
∴ 𝑦1 = 0,9376 , 𝑦2 = 0,3478 𝑎𝑛𝑑 𝑦3 = −1,6333
Now for 𝑦(1) = 1 ∶ 1 = 𝐶1 𝑐𝑜𝑠3 + 𝐶2 𝑠𝑖𝑛3
1 ≈ −0,99𝐶1 + 0,1411𝐶2 (4)
For 𝑦(2) = 2 we have 2 = 𝐶1 𝑐𝑜𝑠6 + 𝐶2 𝑠𝑖𝑛6
2 ≈ 0,9602𝐶1 − 0,2794𝐶2 (5)
Applying elimination between (4) and (5) we get 𝐶1 = −3,9994 , 𝐶2 = 20,9738
Hence 𝑦 = −3,994𝑐𝑜𝑠3𝑥 − 20,9738𝑠𝑖𝑛3𝑥

Activity 2.2
1. Use the finite difference method to determine the solution of the differential
equations at interior mesh points
(a) 𝑦 ″ + 9𝑦 = 0 , 𝑦(0) = 4 , 𝑦(2) = 1 , 𝑛 = 4
25

(b) 𝑦 ″ − 𝑦 = 0 , 𝑦(0) = 0 , 𝑦(1) = 0 , 𝑛=4


(c) 𝑦 ″ + 3𝑦 ʹ + 2𝑦 = 0 , 𝑦(1) = 1 , 𝑦(2) = 6 , 𝑛=2
(d) 𝑦 ″ + 5𝑦 ʹ + 4𝑦 = 0 , 𝑦(0) = 0 , 𝑦(1) = 0 , 𝑛=4
26

Unit 3

3.Ordinary Differential Equations (ODE’s)

Introduction
The modelling of physical problems may lead to mathematical formulations that give
rise to first order and second order differential equations among many other forms.
Based on the type of differential equation and the order thereof varying methods may
be employed to determine the solution.
A general solution to a differential equation is a function 𝑦(𝑥) that satisfies the given
differential equation. Given a differential equation that is subjected to some initial
condition(s) then the resulting response/solution 𝑦(𝑥) is called a particular solution
or unique solution.

By the end of this unit, you should be able to:

1. solve exact, homogeneous and Bernouli equations

2. apply differential equations to solve growth, decay and mixing problems

3. use the method of undetermined coefficients to solve second order

differential equations

4. apply second order differential equations to solve mechanical vibrations

Examples
𝑑𝑦
1. −3 = 𝑒 −3𝑥
𝑑𝑥

=1.𝑥𝑦 use Newton-Raphson method to determine minimizers /maximizers of


𝑑𝑦
2. 𝑑𝑥
functions
𝑑2 𝑦 𝑑𝑦
3. − 5 𝑑𝑥 + 4𝑦 = 0 , 𝑦(0) = 0 , 𝑦 ′ (0) = 1
𝑑𝑥 2

The first differential equation may be solved by direct integration while the second
one may be solved using the separation of variables method. The third differential
equation is a second order differential equation with initial conditions, this differential
equation can be solved by using D-operator methods to reach the unique solution.
27

In this section this section we shall learn how to obtain solutions of exact differential
equations, homogenous differential equations and Bernoulli equations.

3.1 Exact Differential Equations


Definition:
Let 𝑀(𝑥; 𝑦) 𝑎𝑛𝑑 𝑁(𝑥; 𝑦) be functions having continuous partial derivatives.
The equation 𝑀(𝑥; 𝑦)𝑑𝑥 + 𝑁(𝑥; 𝑦)𝑑𝑦 = 0 is called an exact differential equation if
𝜕𝑀 𝜕𝑁
=
𝜕𝑦 𝜕𝑥

The general solution is determined by integrating


∫ 𝑀(𝑥; 𝑦)𝑑𝑥 = 𝐹1 (𝑥; 𝑦) + 𝐶1 (𝑦)
∫ 𝑁(𝑥; 𝑦)𝑑𝑦 = 𝐹2 (𝑥; 𝑦) + 𝐶2 (𝑥)
The solution is then written as 𝐶 = 𝐹(𝑥; 𝑦)

Example 3.1
The determine the solution of (𝑥 + 𝑦 2 )𝑑𝑦 + (𝑦 − 𝑥 2 )𝑑𝑥 = 0
Solution
𝝏𝑴 𝜕𝑁
=1 , =1
𝝏𝒙 𝜕𝑦

𝜕𝑀 𝜕𝑁
Since = the DE is exact.
𝜕𝑥 𝜕𝑦

1
Now ∫(𝑥 + 𝑦 2 )𝑑𝑦 = 𝑥𝑦 + 3 𝑦 3 + 𝐶1 (𝑥)
1
∫(𝑦 − 𝑥 2 )𝑑𝑥 = 𝑥𝑦 − 3 𝑥 3 + 𝐶2 (𝑦)
1 1
∴ 𝐶 = 𝑥𝑦 + 3 𝑦 3 − 3 𝑥 3

Example 3.2
The determine the solution of (𝑐𝑜𝑠𝑦 + 𝑦𝑐𝑜𝑠𝑥)𝑑𝑥 + (𝑠𝑖𝑛𝑥 − 𝑥𝑠𝑖𝑛𝑦)𝑑𝑦 = 0
Solution
(𝑐𝑜𝑠𝑦 + 𝑦𝑐𝑜𝑠𝑥)𝑑𝑥 + (𝑠𝑖𝑛𝑥 − 𝑥𝑠𝑖𝑛𝑦)𝑑𝑦 = 0
𝑀 𝑁
𝜕 𝜕
(𝑐𝑜𝑠𝑦 + 𝑦𝑐𝑜𝑠𝑥) = −𝑠𝑖𝑛𝑦 + 𝑐𝑜𝑠 𝑥 , (𝑠𝑖𝑛𝑥 − 𝑥𝑠𝑖𝑛𝑦) = 𝑐𝑜𝑠 𝑥 − 𝑠𝑖𝑛𝑦
𝜕𝑦 𝜕𝑥
28

𝜕𝑀 𝜕𝑁
= = 𝑐𝑜𝑠𝑥 − 𝑠𝑖𝑛𝑦 ∴ 𝑡ℎ𝑒 𝐷𝐸 𝑖𝑠 𝑒𝑥𝑎𝑐𝑡
𝜕𝑦 𝜕𝑥

∫(𝑐𝑜𝑠𝑦 + 𝑦𝑠𝑖𝑛𝑥)𝑑𝑥 = 𝑥𝑐𝑜𝑠𝑦 − 𝑦𝑐𝑜𝑠𝑥 + 𝐶1 (𝑦)


∫(𝑠𝑖𝑛𝑥 − 𝑥𝑠𝑖𝑛𝑦)𝑑𝑦 = 𝑦𝑠𝑖𝑛𝑥 − 𝑥𝑐𝑜𝑠𝑦 + 𝐶2 (𝑥)
∴ 𝐶 = 𝑦𝑠𝑖𝑛𝑥 − 𝑦𝑐𝑜𝑠𝑥

Activity 3.1
1. Solve the following differential equations
(𝑎) (𝑥 + 𝑦)𝑑𝑥 + (𝑥 + 4𝑦)𝑑𝑦 = 0
𝑦
(𝑏) 𝑑𝑥 + [ln(𝑥 − 1) + 2𝑦]𝑑𝑦 = 0 , 𝑦(2) = 4
𝑥−1

(𝑐) (2𝑥𝑡𝑎𝑛𝑦 + 5)𝑑𝑥 + (𝑥 2 𝑠𝑒𝑐 2 𝑦)𝑑𝑦 = 0 , 𝑦(0) = 0


𝑑𝑥
(𝑑) [ln (𝑠𝑖𝑛𝑦) − 3𝑥 2 ] + 𝑥𝑐𝑜𝑡𝑦 + 4𝑦 = 0
𝑑𝑦

(𝑒) (2𝑥𝑦 − 𝑠𝑒𝑐 2 𝑥)𝑑𝑥 + (𝑥 2 + 2𝑦)𝑑𝑦 = 0


(𝑓) 𝑒 𝑥 (𝑦 − 𝑥)𝑑𝑥 + (1 + 𝑒 𝑥 )𝑑𝑦 = 0

3.2 Homogeneous differential equations


Definition:
A homogeneous differential equation is an equation of the form
𝑀(𝑥; 𝑦)𝑑𝑥 + 𝑁(𝑥; 𝑦)𝑑𝑦 = 0
that satisfies the condition 𝑀(𝑡𝑥; 𝑡𝑦) = 𝑡 𝑛 𝑓(𝑥; 𝑦) 𝑎𝑛𝑑 𝑁(𝑡𝑥; 𝑡𝑦) = 𝑡 𝑛 𝑔(𝑥; 𝑦)
meaning 𝑀(𝑥; 𝑦) 𝑎𝑛𝑑 𝑁(𝑥; 𝑦) are homogeneous functions of the same degree 𝑛.
The substitution 𝑦 = 𝑣𝑥 is used to reduce the equation to be of a separable form
and the separation of variables is used to determine the solution.
First let us demonstrate the process of testing for homogeneity of the functions
𝑀(𝑥; 𝑦) 𝑎𝑛𝑑 𝑁(𝑥; 𝑦)
Suppose we are given the differential equation (𝑥 2 + 𝑦 2 )𝑑𝑦 + (2𝑥𝑦)𝑑𝑥 = 0, testing
we let
𝑀(𝑡𝑥; 𝑡𝑦) = [(𝑡𝑥)2 + (𝑡𝑦)2 ] = [𝑡 2 (𝑥 2 + 𝑦 2 )] = 𝑡 2 𝑓(𝑥; 𝑦)
𝑁(𝑡𝑥; 𝑡𝑦) = [2(𝑡𝑥)(𝑡𝑦)] = [𝑡 2 (2𝑥𝑦))] = 𝑡 2 𝑔(𝑥; 𝑦)
This shows that 𝑀(𝑥, 𝑦) 𝑎𝑛𝑑 𝑁(𝑥; 𝑦) are of degree 𝑛 = 2
29

Example 3.3
Determine the solution of (𝑥 2 + 𝑦 2 )𝑑𝑦 + (4𝑥𝑦)𝑑𝑥 = 0
Solution
The differential equation is homogeneous of degree 𝑛 = 2 in functions
𝑀(𝑥, 𝑦) 𝑎𝑛𝑑 𝑁(𝑥; 𝑦)
The test is as in demonstration above.
𝑑𝑦 −4𝑥𝑦
Rewriting the differential equation as =𝑥 2 +𝑦 2 .
𝑑𝑥

𝑑𝑦 𝑑𝑣
Let 𝑦 = 𝑣𝑥 be the substitution then we obtain =𝑣+𝑥 .
𝑑𝑥 𝑑𝑥

𝑑𝑦 −4𝑥𝑦 −4(𝑥 2 𝑣)
=𝑥 2 +𝑦 2 = 𝑥 2 +(𝑥 2 𝑣2 )
𝑑𝑥

𝑑𝑣 −4𝑣
Now 𝑣 + 𝑥 𝑑𝑥 = 1+𝑣2
𝑑𝑣 −4𝑣
𝑥 𝑑𝑥 = 1+𝑣2 − 𝑣

𝑑𝑣 −5𝑣−𝑣 3
𝑥 𝑑𝑥 = 1+𝑣 2

1+𝑣 2 1
𝑑𝑣 = 𝑥 𝑑𝑥
−𝑣(5+𝑣 2 )

𝑣 2 −1 1
∫ 𝑣(5+𝑣2) 𝑑𝑣 = ∫ 𝑥 𝑑𝑥 (1)

Using partial fraction decomposition for the left-hand side of (1) we get the constants
1 6
𝐴 = − 5 , 𝐵 = 5 𝑎𝑛𝑑 𝐶 = 0
1 𝑑𝑣 6 𝑣 1
It follows that −5∫ + 5 ∫ 5+𝑣2 𝑑𝑣 = ∫ 𝑥 𝑑𝑥
𝑣
3
−𝑙𝑛𝑣 + 5 ln(5 + 𝑣 2 ) = 𝑙𝑛𝑥 + 𝐶

𝑦 3 𝑦 2
∴ −𝑙𝑛 (𝑥 ) + 5 ln (5 + (𝑥 ) ) = 𝑙𝑛𝑥 + 𝐶

Example 3.4
𝑑𝑦
Determine the solution of 𝑥 𝑑𝑥 = 𝑦 + √𝑥 2 + 𝑦 2 , 𝑦(1) = 2

Solution
𝑑𝑦
𝑥 𝑑𝑥 = 𝑦 + √𝑥 2 + 𝑦 2

𝑑𝑦 𝑦+√𝑥 2 +𝑦 2
Rewriting the equation, we have =
𝑑𝑥 𝑥
30

𝑑𝑣 𝑣𝑥+√𝑥2 +(𝑥𝑣)2
Letting 𝑦 = 𝑣𝑥 and differentiating, 𝑣 + 𝑥 𝑑𝑥 = 𝑥

𝑣𝑥+𝑥√1+𝑣 2
= 𝑥
𝑑𝑣
𝑥 𝑑𝑥 = 𝑣 + √1 + 𝑣 2 − 𝑣
𝑑𝑣
𝑥 𝑑𝑥 = √1 + 𝑣 2
𝑑𝑣 𝑑𝑥
∫ √1+𝑣2 = ∫ 𝑥

𝑠𝑖𝑛ℎ−1 𝑣 = 𝑙𝑛𝑥 + 𝐶
𝑦
𝑠𝑖𝑛ℎ−1 (𝑥 ) = 𝑙𝑛𝑥 + 𝐶
2
𝑦(1) = 2 ⇒ 𝑠𝑖𝑛ℎ−1 (1) = 𝑙𝑛1 + 𝐶

⇒ 𝐶 = 1,4436
𝑦
∴ 𝑠𝑖𝑛ℎ−1 (𝑥 ) = 𝑙𝑛𝑥 + 1,4436

3.3 Bernoulli equations


A non-linear differential equation that can be reduced by a suitable substitution to the
𝑑𝑦
linear form + 𝑃(𝑥)𝑦 = 𝑄(𝑥) is called a Bernoulli equation.
𝑑𝑥

The general form of a Bernoulli differential equation is given by


𝑑𝑦
+ 𝑃(𝑥)𝑦 = 𝑄(𝑥)𝑦 𝑛
𝑑𝑥

The substitution 𝑧 = 𝑦1−𝑛 reduces the differential equation to the linear form which
can be solved by using the integration factor 𝐼𝐹 = 𝑅 = 𝑒 ∫ 𝑃(𝑥)𝑑𝑥 to reach the solution
𝑅𝑦 = ∫ 𝑅𝑄𝑑𝑥
Example 3.5
𝑑𝑦
Solve the following differential equation + 3𝑥 2 𝑦 = 𝑥 2 𝑦 3
𝑑𝑥

Solution
𝑑𝑦
+ 3𝑥 2 𝑦 = 𝑥 2 𝑦 3
𝑑𝑥
𝑑𝑦
Rewriting the equation 𝑦 −3 𝑑𝑥 + 3𝑥 2 𝑦 −2 = 𝑥 2
𝑑𝑧 𝑑𝑦
Let 𝑧 = 𝑦 −2 , = −2𝑦 −3 𝑑𝑥
𝑑𝑥
1 𝑑𝑧 𝑑𝑦
− 2 𝑑𝑥 = 𝑦 −3 𝑑𝑥
31

𝑑𝑦
The differential equation 𝑦 −3 𝑑𝑥 + 3𝑥 2 𝑦 −2 = 𝑥 2
1 𝑑𝑧
is transformed to be − 2 𝑑𝑥 + (3𝑥 2 )𝑧 = 𝑥 2
𝑑𝑧
+ (−6𝑥 2 )𝑧 = −2𝑥 2 (standard linear form)
𝑑𝑥
2 𝑑𝑥 3
𝐼𝐹 = 𝑅 = 𝑒 −6 ∫ 𝑥 = 𝑒 −2𝑥
𝑅𝑧 = ∫ 𝑅𝑄𝑑𝑥
3 3
𝑧𝑒 −2𝑥 = ∫ −2𝑥 2 𝑒 −2𝑥 𝑑𝑥
3 1 −2𝑥 3
𝑧𝑒 −2𝑥 = 𝑒 +𝐶
3
3 1 −2𝑥 3
∴ 𝑦 −2 𝑒 −2𝑥 = 𝑒 +𝐶
3
1 3
𝑦 −2 = + 𝑒 2𝑥 𝐶
3

Writing 𝑦 explicitly in terms of 𝑥


1
1 1 −
2𝑥 3 2
𝑦=± 1
= ± (3 + 𝑒 𝐶)
3
√ +𝑒 𝑥 𝐶
3

Activity 3.2
1. Solve the following differential equations
𝑑𝑦
(𝑎) (𝑥 2 + 𝑥𝑦) + 𝑦 2 − 𝑥𝑦 = 0
𝑑𝑥
1
𝑦
(𝑏) 𝑦ʹ + = 5(𝑥 − 2)𝑦 2
𝑥−2

𝑑𝑦 𝜋
(𝑐) 𝑠𝑒𝑐 2 𝑦 + 𝑠𝑒𝑐𝑥𝑡𝑎𝑛𝑦 = 𝑐𝑜𝑠𝑥 , 𝑦 ( ) = 0
𝑑𝑥 2
𝑑𝑦
(𝑑) (2𝑥𝑦 − 𝑥) = 2𝑥 + 𝑦 , 𝑦(2) = 3
𝑑𝑥
𝑑𝑦
(𝑒) 𝑦 − (2𝑦 2 ) = 𝑒 𝑥
𝑑𝑥

𝑑𝑟 𝑟 2 +2𝑟𝜃
(𝑓) =
𝑑𝜃 𝜃2
32

3.4 Applications of ODE (Mathematical modeling)


The technique of representing “real world” problems in mathematical terms is called
mathematical modeling. Mathematical assumptions and relevant variable
relationships postulated constitute the idealization of the model.

Broad outline of modelling


Formulate problem → develop model → test model.
In this section we concentrate on examples that involve first order differential
equations. Here we consider models that result from interpreting the derivative as a
rate of change of one variable to another.

3.4.1 The exponential growth and decay model


If 𝑦 is a differentiable function of 𝑡 such that 𝑦 > 0 and 𝑦ʹ = 𝑘𝑦 for some
constant 𝑘, then 𝑦 = 𝐶𝑒 𝑘𝑡 where 𝐶 is the initial value of 𝑦 and 𝑘 the
proportionality constant. Exponential growth occurs when 𝑘 > 0 and exponential
decay when 𝑘 < 0 .

Example 3.5
𝑑𝑃
The rate of change of a population of insects ( 𝑑𝑡 ) is directly proportional to the
number of insects (𝑃) present at any given time. If initially the population is ten and
after two days the population reaches fourty, determine the expected population size
after four days.
Solution
𝑑𝑃 𝑑𝑃
∝𝑃⇒ = 𝑘𝑃 (formulation of DE)
𝑑𝑡 𝑑𝑡
𝒅𝑷
∫ = ∫ 𝑘𝑑𝑡 (after separation of variables)
𝑷

𝑙𝑛𝑃 = 𝑘𝑡 + 𝐴 (1)
𝑒 𝑙𝑛𝑃 = 𝑒 (𝑘𝑡+𝐴)

= 𝒆𝑨 . 𝒆𝒌𝒕
∴ 𝑃 = 𝐶𝑒 𝑘𝑡 (from property 𝑒 𝑙𝑛𝑥 = 𝑥)

Now introducing conditions


The word 𝑖𝑛𝑖𝑡𝑖𝑎𝑙𝑙𝑦 ⇒ 𝑡 = 0 𝑎𝑛𝑑 𝑃 = 10 ∴ 𝐶 = 10
𝑎𝑓𝑡𝑒𝑟 𝑡𝑤𝑜 𝑑𝑎𝑦𝑠 ⇒ 𝑡 = 2 , 𝑃 = 40
33

40 = 10𝑒 2𝑘
1
𝑙𝑛4 = 2𝑘 ⇒ 𝑘 = 2 𝑙𝑛4 ≈ 0,693 (+𝑣𝑒 𝑘 ⇒ 𝑔𝑟𝑜𝑤𝑡ℎ)

𝑃 = 10𝑒 0,693𝑡 𝑜𝑟 𝑙𝑛𝑃 = 0,693𝑡 + 𝑙𝑛10 if equation (1) is used

Now when 𝑡 = 4 𝑑𝑎𝑦𝑠 ⇒ 𝑃 =?


𝑃 = 10𝑒 0,693(4) ≈ 1,59,97 ⇒ the expected population ≅ 160 𝑖𝑛𝑠𝑒𝑐𝑡𝑠

Example 3.6
𝑑𝐹
The rate of change of fertilizer in the soil ( 𝑑𝑡 ) is directly proportional to the amount
of fertilizer present at any instant 𝑡. If initially 10 grams of fertilizer is applied to the
soil and if it takes a day for the fertilizer to reach 5 grams, determine how long it will
take for the fertilizer to be 1 gram.
Solution
𝑑𝐹 𝑑𝐹
∝𝐹⇒ = 𝑘𝐹 (formulation of DE)
𝑑𝑡 𝑑𝑡
𝑑𝐹
∫ = ∫ 𝑘𝑑𝑡 (after separation of variables)
𝐹

𝑙𝑛𝐹 = 𝑘𝑡 + 𝐶
𝑒 𝑙𝑛𝐹 = 𝑒 (𝑘𝑡+𝐴)
= 𝑒 𝐴 . 𝑒 𝑘𝑡
∴ 𝐹 = 𝐶𝑒 𝑘𝑡 (from property: 𝑒 𝑙𝑛𝑥 = 𝑥)
Now introducing conditions
𝑖𝑛𝑖𝑡𝑖𝑎𝑙𝑙𝑦 ⇒ 𝑡 = 0 𝑎𝑛𝑑 𝐹 = 10
Using 𝑙𝑛𝐹 = 𝑘𝑡 + 𝐶
∴ 𝐶 = 𝑙𝑛10
After one day ⇒ 𝑡 = 1 , 𝐹 = 5
ln 𝐹 = 𝑘𝑡 + 𝑙𝑛10
1
𝑙𝑛5 = 𝑘 + 𝑙𝑛10 ⇒ 𝑘 = 𝑙𝑛 2 ≈ −0,693 (−𝑣𝑒 𝑘 ⇒ 𝑑𝑒𝑐𝑎𝑦)

𝑙𝑛𝐹 = −0,693𝑡 + 𝑙𝑛10


Now when 𝑡 =? 𝑑𝑎𝑦𝑠 ⇒ 𝐹 = 1
𝑙𝑛1 = −0,693𝑡 + 2,303
34

2,303
⇒ 𝑡 = 0,693 = 3,323

⇒ the expected time for the fertilizer to be 1 gram is just over 3 days

3.4.2 Compartmental modelling (Mixing problems)


Introduction
The one compartment system consists of a function 𝑥(𝑡) that represents the amount
of substance in the compartment at time 𝑡, 𝑎𝑛 𝑖𝑛𝑝𝑢𝑡 𝑟𝑎𝑡𝑒 𝑎𝑛𝑑 𝑎𝑛 𝑜𝑢𝑡𝑝𝑢𝑡 𝑟𝑎𝑡𝑒. The
model can be stated as follows:
• Information often given is input rate and concentration
• Multiplying the flow rate (𝑣𝑜𝑙𝑢𝑚𝑒/𝑡𝑖𝑚𝑒) by the concentration
(𝑎𝑚𝑜𝑢𝑛𝑡 𝑜𝑓 𝑠𝑢𝑏𝑠𝑡𝑎𝑛𝑐𝑒/𝑣𝑜𝑙𝑢𝑚𝑒) yields the input rate (𝑎𝑚𝑜𝑢𝑛𝑡/𝑡𝑖𝑚𝑒)
• Given exit rate of mixture, getting concentration of substance in mixture
𝑎 𝑐𝑜𝑚𝑚𝑜𝑛 𝑎𝑠𝑠𝑢𝑚𝑝𝑡𝑖𝑜𝑛 𝑖𝑠 𝑡ℎ𝑎𝑡 𝑐𝑜𝑛𝑐𝑒𝑛𝑡𝑟𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑘𝑒𝑝𝑡 𝑢𝑛𝑖𝑓𝑜𝑟𝑚 𝑖𝑛
[ ]
𝑚𝑖𝑥𝑡𝑢𝑟𝑒 𝑑𝑢𝑟𝑖𝑛𝑔 𝑠𝑡𝑖𝑟𝑟𝑖𝑛𝑔
• Computing concentration of substance in mixture in container at time 𝑡, divide
amount 𝑥(𝑡) by volume of the mixture in the container at time 𝑡. Multiplying
this concentration by exit rate of mixture gives the desired output rate of
substance.
𝑑𝑥
The model can be stated as follows: = 𝑖𝑛𝑝𝑢𝑡 𝑟𝑎𝑡𝑒 − 𝑜𝑢𝑡𝑝𝑢𝑡 𝑟𝑎𝑡𝑒
𝑑𝑡

Example 3.7
A tank contains 100𝑙 of a salt solution with 20𝑘𝑔 of salt dissolved in it. Fresh water
flows into the tank at a rate of 2,5 𝑙/𝑠𝑒𝑐𝑜𝑛𝑑 and the solution is kept uniform during
stirring and flows out at the same rate. Determine the amount of salt left in the
solution after 1 𝑚𝑖𝑛𝑢𝑡𝑒.
Solution
Let the salt remaining after 𝑡 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 be 𝑥 𝑘𝑔. The rate of change is
𝑑𝑥 −2,5𝑥
= (𝑘 = −1 𝑏𝑒𝑐𝑎𝑢𝑠𝑒 𝑠𝑎𝑙𝑡 𝑓𝑙𝑜𝑤𝑠 𝑜𝑢𝑡)
𝑑𝑡 100
𝑑𝑥 1
∫ = − 40 ∫ 𝑑𝑡
𝑥
1
𝑙𝑛𝑥 = − 40 𝑡 + 𝐶

Given 𝑡 = 0 , 𝑥 = 20 ∴ 𝐶 = ln 20
1
𝑙𝑛𝑥 = − 40 𝑡 + 𝐶

𝑡 = 1 𝑚𝑖𝑛𝑢𝑡𝑒 ⇒ 𝑡 = 60 𝑠𝑒𝑐𝑜𝑛𝑑𝑠
35

3
−60 𝑥
𝑙𝑛𝑥 = + 𝑙𝑛20 and 𝑙𝑛 20 = 𝑒 −2
40
3
∴ 𝑥 = 20. 𝑒 −2 ≈ 4,46 𝑘𝑔

Example 3.8
A large tank with 2000 𝑙𝑖𝑡𝑟𝑒𝑠 of beer contains 4% alcohol (by volume). Beer with 6%
alcohol level is pumped into the tank at a rate of 20 𝑙𝑖𝑡𝑟𝑒𝑠/𝑚𝑖𝑛𝑢𝑡𝑒 and the mixture is
pumped out at the same rate. What is the percentage of alcohol after an hour?
2000𝑙

20𝑙/𝑚𝑖𝑛

Solution 20𝑙/𝑚𝑖𝑛

𝑑𝑦
Let 𝑦(𝑡) be the number of 𝑙𝑖𝑡𝑟𝑒𝑠 of alcohol at any given time 𝑡. is the rate of
𝑑𝑡
𝑑𝑦
change of the number of 𝑙𝑖𝑡𝑟𝑒𝑠 of alcohol, = 𝑟𝑎𝑡𝑒 𝑖𝑛 − 𝑟𝑎𝑡𝑒 𝑜𝑢𝑡.
𝑑𝑡
6 20𝑙
‘Rate in’: the rate at which alcohol enters the tank × 𝑚𝑖𝑛 = 1,2𝑙/𝑚𝑖𝑛.
100

‘Rate out’: the rate at which alcohol leaves the tank. The tank’s capacity is
𝑦(𝑡)
2000 𝑙𝑖𝑡𝑟𝑒𝑠, so the amount of alcohol at any time 𝑡 is . Since the rate at which
2000
the alcohol drains from the tank is 20𝑙𝑖𝑡𝑟𝑒𝑠/𝑚𝑖𝑛𝑢𝑡𝑒, we have
𝑦(𝑡) 20𝑙 𝑦(𝑡)
Rate out = 2000 × 𝑚𝑖𝑛 = 𝑙/𝑚𝑖𝑛
100

𝑑𝑦 𝑦(𝑡) 120−𝑦
∴ = 1,2 − 100 =
𝑑𝑡 100

Separating the variables and integrating we have


𝑑𝑦 1
∫ 120−𝑦 = 100 ∫ 𝑑𝑡
𝑡
− ln(120 − 𝑦) = 100 + 𝐶
1
At 𝑡 = 0 , 𝑦 = 80𝑙 ⇒ 𝐶 = 𝑙𝑛 ≈ −3,6889
40
𝑡
⇒ ln(120 − 𝑦) = − 100 + 3,6889
𝑡 𝑡
120 − 𝑦 = 𝑒 3,6889 × 𝑒 −100 = 40𝑒 −100
𝑡
∴ 𝑦 = 120 − 40𝑒 −100
60
After an ℎ𝑜𝑢𝑟 ⇒ 𝑡 = 60𝑚𝑖𝑛 , 𝑦(60) = 120 − 40𝑒 −100
= 98,048𝑙
36

There are about 98 𝑙𝑖𝑡𝑟𝑒𝑠 of alcohol in a tank with a capacity of 2000𝑙.


98
Hence the percentage of alcohol in the tank after one hour is × 100 = 4,9%
2000

Activity 3.3
1. A substance decomposes at a rate proportional to the amount present at any
time 𝑡. If half of the original amount decomposes in 1600 years, determine the
amount lost in100 years as well as the percentage loss.
2.The rate of change in the number of fruit flies is proportional to the population
present at any given time 𝑡. If there were 100 flies after the second day and
there were 300 flies after the fourth day, how many flies were there in the
original population.
3. The change in the number of a flock of sheep on a farm is proportional to
650 − 𝑃(𝑡) where 𝑡 is time in years and 𝑃 is the flock present. If initially the
flock had 300 sheep and after two years the flock was 500, determine the size
of the flock after three years.
4. A brine solution of salt flows at a constant rate of 8𝑙/𝑚𝑖𝑛𝑢𝑡𝑒 into a tank that
Initially has 100𝑙 of the solution in which 5 𝑘𝑔 of salt is dissolved. The
solution inside the tank is kept uniform when well stirred and flows out at the
same rate. If the concentration of the salt in the brine entering the tank is
0,5 𝑘𝑔/𝑙, determine the mass of the salt in the tank after 𝑡 𝑚𝑖𝑛𝑢𝑡𝑒𝑠. When will
the concentration of the salt in the tank reach 0,2𝑘𝑔/𝑙.
5. Consider a tank containing 100𝑙 of water into which a brine solution of salt
begins to flow in at a constant rate of 6𝑙/𝑚𝑖𝑛𝑢𝑡𝑒. The solution in the tank is
kept uniform during stirring and flows out at a constant rate of 6𝑙/𝑚𝑖𝑛𝑢𝑡𝑒.
If the concentration of salt in the brine entering the tank is 1 𝑘𝑔/𝑙, determine
when the concentration of the salt in the tank will reach 0,5 𝑘𝑔/𝑙.
37

3.5 Second order Differential Equations


Introduction
In this section we look at solving second order differential equations using the
method of undetermined coefficients. For this method we start by assuming/guessing
a particular solution of the form 𝑦𝑃𝐼 = 𝑓(𝑥) where 𝑓(𝑥) is a polynomial of degree
𝑛 = 0, 1, 2, 3, … or may be a 𝑠𝑖𝑛𝑒, 𝑐𝑜𝑠𝑖𝑛𝑒 𝑜𝑟 𝑒𝑥𝑝𝑜𝑛𝑒𝑛𝑡𝑖𝑎𝑙 function and/or a
combination of these functions’ sums, differences and products. The
assumed/guessed function is taken as having unknown (undetermined) coefficients.
To find the undetermined coefficients we substitute 𝑦𝑃𝐼 into the differential equation.
Recall that the general form of a second order differential equation is given by
𝑑2 𝑦 𝑑𝑦
𝑎 𝑑𝑥 2 + 𝑏 𝑑𝑥 + 𝑐𝑦 = 𝑓(𝑥)

where 𝑎, 𝑏 𝑎𝑛𝑑 𝑐 are constants and 𝑓(𝑥) = 0 𝑜𝑟 𝑓(𝑥) ≠ 0.

Example 3.8
𝑑2 𝑦 𝑑𝑦
Determine the solution of + 2 𝑑𝑥 + 𝑦 = 3𝑥
𝑑𝑥 2

Solution
From previous studies we know that the characteristic equation,
𝑚2 + 2𝑚 + 1 = 0
(𝑚 + 1)(𝑚 + 1) = 0
The factors will give us the complementary function
𝑦𝐶𝐹 = 𝐶1 𝑒 −𝑥 + 𝐶2 𝑥𝑒 −𝑥
𝑓(𝑥) = 3𝑥 is a polynomial of degree 1, assume the particular integral to be
𝑦𝑃𝐼 = 𝐴𝑥 + 𝐵 and 𝑦ʹ = 𝐴 𝑎𝑛𝑑 𝑦 ″ = 0
𝑑2 𝑦 𝑑𝑦
Substituting 𝑦ʹ 𝑎𝑛𝑑 𝑦 ″ into the equation + 2 𝑑𝑥 + 𝑦 = 3𝑥 𝑜𝑟 𝑦 ″ + 2𝑦ʹ + 𝑦 = 3𝑥
𝑑𝑥 2

0 + 2(𝐴) + (𝐴𝑥 + 𝐵) = 3𝑥
Equating coefficients of 𝑥1 and 𝑥 0 we get
𝐴=3
2𝐴 + 𝐵 = 0 ⇒ 𝐵 = −6
𝑦𝑃𝐼 = 3𝑥 − 6
Hence 𝑦 = 𝐶1 𝑒 −𝑥 + 𝐶2 𝑥𝑒 −𝑥 + 3𝑥 − 6
38

Example 3.9
Determine the solution of 𝑦 ″ − 4𝑦 ʹ − 12𝑦 = 3𝑒 2𝑥
Solution
𝑚2 − 4𝑚 − 12 = 0 , (𝑚 + 2)(𝑚 − 6) = 0
∴ 𝑦𝐶𝐹 = 𝐶1 𝑒 −2𝑥 + 𝐶2 𝑒 6𝑥
Assume 𝑦𝑃𝐼 = 𝐴𝑒 2𝑥 𝑡ℎ𝑒𝑛 𝑦ʹ𝑃𝐼 = 2𝐴𝑒 2𝑥 , 𝑦″𝑃𝐼 = 4𝐴𝑒 2𝑥
4𝐴𝑒 2𝑥 − 4(2𝐴𝑒 2𝑥 ) − 12(𝐴𝑒 2𝑥 ) = 3𝑒 2𝑥
3
4𝐴 − 8𝐴 − 12𝐴 = 3 ⇒ −16𝐴 = 3 ∴ 𝐴 = − 16
3
𝑦𝑃𝐼 = − 16 𝑒 2𝑥
3
Hence 𝑦 = 𝐶1 𝑒 −2𝑥 + 𝐶2 𝑒 6𝑥 − 16 𝑒 2𝑥

Example 3.10
Solve the differential equation 𝑦 ″ − 𝑦 ʹ + 𝑦 = 2𝑠𝑖𝑛3𝑥
Solution
1±√1−4 1 √3
𝑚2 − 𝑚 + 1 = 0 , 𝑚= =2± 𝑗
2 2

The complementary function/solution in this case is given by


1
√3 √3
𝑦𝐶𝐹 = 𝑒 2𝑥 (𝐶1 𝑐𝑜𝑠 𝑥 + 𝐶2 𝑠𝑖𝑛 𝑥)
2 2

Guess 𝑦𝑃𝐼 = 𝐴𝑐𝑜𝑠3𝑥 + 𝐵𝑠𝑖𝑛3𝑥


𝑦ʹ𝑃𝐼 = −3𝐴𝑠𝑖𝑛3𝑥 + 3𝐵𝑐𝑜𝑠3𝑥
𝑦″𝑃𝐼 = −9𝐴𝑐𝑜𝑠3𝑥 − 9𝐵𝑠𝑖𝑛3𝑥
Substituting 𝑦ʹ𝑃𝐼 and 𝑦″𝑃𝐼 into the differential equation we get
(−9𝐴𝑐𝑜𝑠3𝑥 − 9𝐵𝑠𝑖𝑛3𝑥) − (−3𝐴𝑠𝑖𝑛3𝑥 + 3𝐵𝑐𝑜𝑠3𝑥 ) + ( 𝐴𝑐𝑜𝑠3𝑥 + 𝐵𝑠𝑖𝑛3𝑥) = 2𝑠𝑖𝑛3𝑥
−8𝐴𝑐𝑜𝑠3𝑥 − 8𝐵𝑠𝑖𝑛3𝑥 + 3𝐴𝑠𝑖𝑛3𝑥 − 3𝐵𝑐𝑜𝑠3𝑥 = 2𝑠𝑖𝑛3𝑥
𝑠𝑖𝑛3𝑥(−8𝐵 + 3𝐴) = 2𝑠𝑖𝑛3𝑥
−8𝐵 + 3𝐴 = 2 (1)
𝑐𝑜𝑠3𝑥(−8𝐴 − 3𝐵) = 0
−3𝐵 − 8𝐴 = 0 (2)
39

2+8𝐵
From equation (1) 𝐴 = 3

Substituting 𝐴 into (2) we get


2+8𝐵
−3𝐵 − 8 ( )=0
3

−9𝐵 − 8(2 + 8𝐵) = 0


16
−73𝐵 = 16 ∴ 𝐵 = − 73
16 6
Introducing 𝐵 == − 73 into equation (1) gives us 𝐴 = 73
1
√3 √3 6 16
∴ 𝑦 = 𝑒 2𝑥 (𝐶1 𝑐𝑜𝑠 𝑥 + 𝐶2 𝑠𝑖𝑛 𝑥) + 73 𝑐𝑜𝑠3𝑥 − 73 𝑠𝑖𝑛3𝑥
2 2

Example 3.11
Use the method of undetermined coefficients to solve the differential equation
𝑦 ″ − 3𝑦 ʹ − 18𝑦 = 2𝑒 3𝑥 + 𝑠𝑖𝑛𝑥
Solution
𝑚2 − 3𝑚 − 18 = 0 , (𝑚 − 6)(𝑚 + 3) = 0
The complementary function/solution is 𝑦𝐶𝐹 = 𝐶1 𝑒 6𝑥 + 𝐶2 𝑒 −3𝑥
Guess 𝑦𝑃𝐼 = 𝐶𝑒 3𝑥 + (𝐷𝑠𝑖𝑛𝑥 + 𝐸𝑐𝑜𝑠𝑥)
𝑦ʹ𝑃𝐼 = 3𝐶𝑒 3𝑥 + 𝐷𝑐𝑜𝑠𝑥 − 𝐸𝑠𝑖𝑛𝑥
𝑦″𝑃𝐼 = 9𝐶𝑒 3𝑥 − 𝐷𝑠𝑖𝑛𝑥 − 𝐸𝑐𝑜𝑠𝑥
(9𝐶𝑒 3𝑥 − 𝐷𝑠𝑖𝑛𝑥 − 𝐸𝑐𝑜𝑠𝑥 ) − 3(3𝐶𝑒 3𝑥 + 𝐷𝑐𝑜𝑠𝑥 − 𝐸𝑠𝑖𝑛𝑥) − 18(𝐶𝑒 3𝑥 + 𝐷𝑠𝑖𝑛𝑥 + 𝐸𝑐𝑜𝑠𝑥)
= 2𝑒 3𝑥 + 𝑠𝑖𝑛𝑥
−18(𝐷𝑠𝑖𝑛𝑥 + 𝐸𝑐𝑜𝑠𝑥) − 18𝐶𝑒 3𝑥 = 2𝑒 3𝑥 + 𝑠𝑖𝑛𝑥
1
−18𝐶𝑒 3𝑥 = 2𝑒 3𝑥 ⇒ 𝐶 = − 9

−19𝐷𝑠𝑖𝑛𝑥 + 3𝐸𝑠𝑖𝑛𝑥 = 𝑠𝑖𝑛𝑥


−19𝐷 + 3𝐸 = 1 (1)
𝑐𝑜𝑠𝑥(−3𝐷 − 19𝐸) = 0
−3𝐷 − 19𝐸 = 0 (2)
−9𝐷 − 19(19𝐷 + 1) = 0
19
−370𝐷 − 19 = 0 ⇒ 𝐷 = − 370
40

3
⇒ 𝐸 = 355
1 19 3
𝑦𝑃𝐼 = − 9 𝑒 3𝑥 − 364 𝑠𝑖𝑛𝑥 − 19 𝑐𝑜𝑠𝑥
1 19 3
∴ 𝑦 = 𝐶1 𝑒 6𝑥 + 𝐶2 𝑒 −3𝑥 − (9 𝑒 3𝑥 − 370 𝑠𝑖𝑛𝑥 + 370 𝑐𝑜𝑠𝑥)

Activity 3.4
1. Determine the solution of each of the differential equations using the method of
undetermined coefficients
(a) 𝑦 ″ + 𝑦 ʹ − 6𝑦 = 2𝑥
(b) 𝑦 ″ − 𝑦 ʹ − 6𝑦 = 𝑥 2 − 2𝑥
(c) 𝑦 ″ + 2𝑦 ʹ = 𝑒 −2𝑥
(d) 𝑦 ″ − 4𝑦 ʹ − 5𝑦 = 𝑐𝑜𝑠2𝑥
(e) 𝑦 ″ + 4𝑦 = 24𝑒 −2𝑥 , 𝑦(0) = 0 , 𝑦ʹ(0) = −1

(f) 𝑦 ″ + 𝑦 ʹ = 𝑒 𝑥 𝑐𝑜𝑠𝑥
(g) 𝑦 ″ + 𝑦 ʹ = 6𝑥𝑒 2𝑥 , 𝑦(0) = 0 , 𝑦ʹ(0) = 1

3.6 Applications of second order differential Equations


Mechanical vibrations
Vibrations or oscillations occur in many branches of engineering. Here we consider a
mass that is attached to a spring and oscillations take place as the mass is
suspended by a spring. What is studied in this section can be adapted to many other
situations with just a change of notation. For example, vibrations of a solid structure
that occur in a machine and fluid-induced vibrations. In the study we consider
amplitudes, frequencies and phase shifts of such vibrations.

3.6.1 Simple harmonic motion /free undamped motion


The general form of differential equations of this type is given by
𝑑2 𝑥
𝑚 𝑑𝑡 2 + 𝑘𝑥 = 0 (1)

Dividing equation (1) by 𝑚 throughout we get

𝑑2 𝑥 𝑘 𝑑2 𝑥 𝑘
+𝑚𝑥 = 0 𝑜𝑟 + 𝜔2 𝑥 = 0, where 𝜔 = √𝑚
𝑑𝑡 2 𝑑𝑡 2
41

The general auxiliary equation is given by 𝑚2 + 𝜔2 = 0 which has complex roots


𝑚 = ±𝜔𝑗 and gives the general solution
𝑥(𝑡) = 𝐶1 𝑐𝑜𝑠𝜔𝑡 + 𝐶2 𝑠𝑖𝑛𝜔𝑡
For convenience and other uses needed later the solution can be written as
𝑥(𝑡) = 𝐴𝑠𝑖𝑛(𝜔𝑡 + 𝜑)
where 𝐶1 = 𝐴𝑠𝑖𝑛𝜑 𝑎𝑛𝑑 𝐶2 = 𝐴𝑐𝑜𝑠𝜑
i.e 𝐴𝑠𝑖𝑛(𝜔𝑡 + 𝜑) = 𝐴𝑐𝑜𝑠𝜔𝑡𝑠𝑖𝑛𝜑 + 𝐴𝑠𝑖𝑛𝜔𝑡𝑐𝑜𝑠𝜑
= 𝐶1 𝑐𝑜𝑠𝜔𝑡 + 𝐶2 𝑠𝑖𝑛𝜔𝑡
To get the amplitude we use the equation

𝐴 = √(𝐶1 )2 + (𝐶2 )2
𝐶
To determine the phase angle 𝜑 we use the relationship 𝑡𝑎𝑛𝜑 = 𝐶1
2

2𝜋 𝜔
The period and the natural frequency of the system is given by 𝑃 = 𝑎𝑛𝑑 𝑓 = 2𝜋
𝜔
respectively.

𝑘
The angular frequency is given by 𝜔 = √𝑚 , 𝑚 𝑎𝑛𝑑 𝑘 being the mass and spring
constant respectively.

Example 3.12
Consider an object with mass 𝑚 = 1𝑘𝑔 attached to a spring and being pulled down
10 units below its equilibrium position, where 𝑘 = 16𝑁/𝑚 and holding it until 𝑡 = 0
and then releasing it from rest. The system is then modelled by
𝑑2 𝑥
+ 16𝑥 = 0 , 𝑥(0) = 10 , 𝑥 ′ (0) = 0
𝑑𝑡 2

Determine the displacement equation, amplitude, period and frequency of the


motion.
Solution
𝑚 + 16 = 0 ⇒ 𝑚 = ±4𝑗
𝑥(𝑡) = 𝐶1 𝑐𝑜𝑠4𝑡 + 𝐶2 𝑠𝑖𝑛4𝑡
𝑥(0) = 10 ⇒ 10 = 𝐶1 𝑐𝑜𝑠0 + 𝐶2 𝑠𝑖𝑛0 ∴ 𝐶1 = 10
𝑥 ′ (𝑡) = −4𝐶1 𝑠𝑖𝑛4𝑡 + 4𝐶2 𝑐𝑜𝑠4𝑡
𝑥 ′ (0) = 0 ⇒ 0 = −4𝐶1 𝑠𝑖𝑛0 + 4𝐶2 𝑐𝑜𝑠0 𝐶2 = 0
∴ 𝑥(𝑡) = 10𝑐𝑜𝑠4𝑡
42

2𝜋 2
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 = 10 , 𝑃 = ≈ 1,571 , 𝑓 = 2𝜋 ≈ 0,318𝐻𝑧
4

3.6.2 Free damped motion


In this section we look at the effect of damping force on free vibration modelled by
the equation
𝑑2 𝑥 𝑑𝑥
𝑎 𝑑𝑡 2 + 𝑏 𝑑𝑡 + 𝑘𝑥 = 0 , 𝑎, 𝑏 𝑎𝑛𝑑 𝑘 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑠

The auxiliary equation associated with this differential equation


𝑎𝑚2 + 𝑏𝑚 + 𝑘 = 0
−𝑏±√𝑏 2 −4𝑎𝑐
The roots of this equation are given by 𝑚 = which depend on 𝑏 2 − 4𝑎𝑐
2𝑎

If 𝑏 2 − 4𝑎𝑐 < 0 the complex roots 𝑚 = 𝛼 ± 𝜔𝑗 exist which result into


𝑥(𝑡) = 𝑒 𝛼𝑡 (𝐶1 𝑐𝑜𝑠𝜔𝑡 + 𝐶2 𝑠𝑖𝑛𝜔𝑡)
The alternative form of the solution is given by
𝑥(𝑡) = 𝐴𝑒 𝛼𝑡 𝑠𝑖𝑛(𝜔𝑡 + 𝜑)
𝐶
The amplitude is then given by 𝐴 = √(𝐶1 )2 + (𝐶2 )2 , 𝑡𝑎𝑛𝜑 = 𝐶1
2

𝑏
𝑏
The product 𝐴 = 𝐴𝑒 𝛼𝑡 = 𝐴𝑒 (−2𝑚)𝑡 , 𝛼 = − is called the damping force
2𝑚

Example 3.13
Assume that the motion of a spring mass system with damping is governed by the
differential equation
𝑑2 𝑥 𝑑𝑥
+ 4 𝑑𝑡 + 5𝑥 = 0
𝑑𝑡 2

with initial velocity 𝑥 ′ (0) = 0,5𝑚/𝑠 and initial displacement 𝑥(0) = 0,25𝑚.
Determine the displacement equation of the system, frequency and angular
frequency.
Solution
𝑚2 + 4𝑚 + 5 = 0
−4±√42 −4(1)5
𝑚= = −2 ± 𝑗
2

𝑥𝑐𝑓 = 𝑒 2𝑡 (𝐶1 𝑐𝑜𝑠𝑡 + 𝐶2 𝑠𝑖𝑛2𝑡)

𝑥(0) = 0,25 ⇒ 0,25 = 𝐶1


𝑥 ′ (𝑡) = −2𝑒 −2𝑡 (𝐶1 𝑐𝑜𝑠𝑡 + 𝐶2 𝑠𝑖𝑛𝑡) + 𝑒 −2𝑡 (−𝐶1 𝑠𝑖𝑛𝑡 + 𝐶2 𝑐𝑜𝑠𝑡)
43

𝑥 ′ (0) = 0,5 ⇒ 0,5 = −2(𝐶1 ) + 𝐶2


0,5 = −2(0,25) + 𝐶2 ⇒ 𝐶2 = 1
∴ 𝑥(𝑡) = 𝑒 −2𝑡 (0,25𝑐𝑜𝑠𝑡 + 𝑠𝑖𝑛𝑡)
𝑤 1
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 2𝜋 = 2𝜋 ≈ 0,159 𝐻𝑧

5
𝐴𝑛𝑔𝑢𝑙𝑎𝑟 𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = √1 = 2,236 𝑟𝑎𝑑/𝑠

3.6.3 Forced damped motion


We now look at situations where the motion of the spring is affected by an external
force in addition to the restoring force and damping force. The application of
Newton’s second law of motion to differential equations gives
𝑑2 𝑥
𝑚 𝑑𝑡 2 = damping force + restoring force + external force
𝑑𝑥
= −𝛽 𝑑𝑡 − 𝑘𝑥 + 𝐹(𝑡)

Rearranging gives
𝑑2 𝑥 𝑑𝑥
𝑚 𝑑𝑡 2 + 𝛽 𝑑𝑡 + 𝑘𝑥 = 𝐹(𝑡)

or 𝑚𝑥 ″ + 𝛽𝑥 ′ + 𝑘𝑥 = 𝐹(𝑡)
In this case we have a non-homogeneous differential equation with general solution
𝑥𝐺 = 𝑥𝐶𝐹 + 𝑥𝑃𝐼
where 𝑥𝐶𝐹 (complementary solution) is the solution to the free damped case and
𝑥𝑃𝐼 (particular solution) will be found using the method of undetermined
coefficients
It is essential to note that in free, damped case the complementary solution will
approach zero as 𝑡 becomes large. Due to this behaviour the complementary
solution is often called the transient state.
Due to the behaviour of the complementary solution, the displacement will start to
look increasingly more like the particular solution as 𝑡 increases and as a result the
particular solution is often called the steady state solution
44

Example 3.14
An object moves according to the equation
𝑑2 𝑥 𝑑𝑥
+ 2 𝑑𝑡 + 2𝑥 = 2𝑠𝑖𝑛2𝑡
𝑑𝑡 2

Use the method of undetermined coefficients to determine


(a) The general solution 𝑥(𝑡) of the differential equation.
(b) The amplitude, frequency and the phase angle of the steady state solution
(c) Sketch one cycle of the steady state solution using the sine wave equation
𝑦 = 𝐴𝑠𝑖𝑛(𝜔𝑡 + 𝛼).
Solution
𝑑2 𝑥 𝑑𝑥
(a) Given 𝑑𝑡 2
+ 2 𝑑𝑡 + 2𝑥 = 2𝑠𝑖𝑛2𝑡

−2±√4−20
𝑚= ⇒ 𝑚 = −1 ± 2𝑗
2

𝑥𝑐𝑓 = 𝑒 −𝑡 (𝐶1 𝑐𝑜𝑠2𝑡 + 𝐶2 𝑐𝑜𝑠2𝑡)

Assume 𝑥𝑃𝐼 = (𝐴𝑐𝑜𝑠2𝑡 + 𝐵𝑠𝑖𝑛2𝑡)


𝑥ʹ𝑃𝐼 = −2𝐴𝑠𝑖𝑛2𝑡 + 2𝐵𝑐𝑜𝑠2𝑡
𝑥″𝑃𝐼 = −4𝐴𝑐𝑜𝑠2𝑡 − 4𝐵𝑠𝑖𝑛2𝑡
Substituting terms into the DE we get
−4𝐴𝑐𝑜𝑠2𝑡 − 4𝐵𝑠𝑖𝑛2𝑡 + 2(−2𝐴𝑠𝑖𝑛2𝑡 + 2𝐵𝑐𝑜𝑠2𝑡) + 2(𝐴𝑐𝑜𝑠2𝑡 + 𝐵𝑠𝑖𝑛2𝑡) = 2𝑠𝑖𝑛2𝑡
Equating like terms: −2𝐵𝑠𝑖𝑛2𝑡 − 4𝐴𝑠𝑖𝑛2𝑡 = 2𝑠𝑖𝑛2𝑡
6𝐵𝑐𝑜𝑠2𝑡 − 2𝐴𝑐𝑜𝑠2𝑡 = 0
Simplifying we get 𝐵 + 2𝐴 = −1 (1)
3𝐵 − 𝐴 = 0 (2)
Eliminating: 𝐵 + 2𝐴 = −1
+ (6𝐵 − 2𝐴 = 0)
1
7𝐵 = −1 ⇒ 𝐵 = − 7
1 3
From (2) 𝐴 = 3𝐵 ⇒ 𝐴 = 3 (− 7) = − 7
1
∴ 𝑥𝐺 (𝑡) = 𝑒 −𝑡 (𝐶1 𝑐𝑜𝑠2𝑡 + 𝐶2 𝑐𝑜𝑠2𝑡) − 7 (3𝑐𝑜𝑠2𝑡 + 𝑠𝑖𝑛2𝑡)
1
(b) 𝑥𝑆𝑆 (𝑡) = − 7 (3𝑐𝑜𝑠2𝑡 + 𝑠𝑖𝑛2𝑡) ,
45

3 2 1 2
𝐴 = √(− 7) + (− 7) ≈ 0,4518

𝜔 1
𝑓 = 2𝜋 = 𝜋 ≈ 0,3183
𝐶
Phase angle 𝛼 = 𝑡𝑎𝑛−1 (𝐶1) = 𝑡𝑎𝑛−1 (3) ≈ 1,2491
2

𝐶1 < 0 and 𝐶2 < 0 and 𝑠𝑖𝑛𝛼 < 0 𝑎𝑛𝑑 𝑐𝑜𝑠𝛼 < 0 ⇒ 𝛼 is in the third quadrant
So 𝛼 = 𝜋 + 1,2491 = 4,3907
(𝑐) 𝑥 = 0,4518sin (2𝑡 + 4,3907)
𝑡1 = 2,1954 , 𝑡2 = −0,6246, 𝑡3 = 0,9462
𝑥(𝑡)

−2,1954 −0,6246 0,9462 𝑡

−0,4518 −0,4295

Example 3.15
A 5𝑘𝑔 object attached to a spring and stretches the spring 0,7𝑚 by itself. A damper
that exerts a force of 50𝑁 when the velocity is 2𝑚/𝑠 is added to the spring. A force
of the form 𝐹(𝑡) = 10𝑐𝑜𝑠𝜔𝑡 is attached to the object and the system is in resonance.
If the object is initially displaced 0,5𝑚 downward from its equilibrium position and
given an upward velocity of 1𝑚/𝑠, determine the displacement of the object at any
given time 𝑡.
Solution
We start by setting up an IVP for the system
𝑟𝑒𝑠𝑡𝑜𝑟𝑖𝑛𝑔 𝑓𝑜𝑟𝑐𝑒
𝑚 = 5 and 𝑘 = = 𝑤𝑒𝑖𝑔ℎ𝑡
𝑥
49
𝑤𝑒𝑖𝑔ℎ𝑡 = 5 × 9,8 = 49 , 𝑘 = 0,7 = 70
𝑑𝑥
We are given the damping force −𝛽 𝑑𝑡 ⇒50 = 2𝛽 ∴ 𝛽 = 25

𝑘 70
We know that 𝜔 = √𝑚 = √ 5 = √14 ≈ 3,74

∴ 5𝑥 ″ + 25𝑥 ′ + 70𝑥 = 10𝑐𝑜𝑠√14𝑡 , 𝑥(0) = 0,5 , 𝑥 ′ (0) = −1


The characteristic equation is 𝑚2 + 5𝑚 + 14 = 0
46

−5±√25−4(14) 5 √−31
𝑚= = −2 ±
2 2

= −2,5 ± 2,78𝑗
∴ 𝑥𝐶𝐹 = 𝑒 −2,5𝑡 (𝐶1 𝑐𝑜𝑠2,78𝑡 + 𝐶2 𝑠𝑖𝑛2,78𝑡)
Determining the particular solution using the method of undetermined coefficients
We guess the particular solution

𝑥𝑃𝐼 = 𝐴𝑐𝑜𝑠√14𝑡 + 𝐵𝑠𝑖𝑛√14𝑡 (1)



𝑥𝑃𝐼 = −√14𝐴𝑠𝑖𝑛√14𝑡 + √14𝐵𝑐𝑜𝑠√14𝑡 (2)

𝑥𝑃𝐼 = −14𝐴𝑐𝑜𝑠√14𝑡 − 14𝐵𝑠𝑖𝑛√14𝑡 (3)
Substituting (1), (2) and (3) into the differential equation we have

5(−14𝐴𝑐𝑜𝑠√14𝑡 − 14𝐵𝑠𝑖𝑛√14𝑡) + 25(−√14𝐴𝑠𝑖𝑛√14𝑡 + √14𝐵𝑐𝑜𝑠√14𝑡) +


70(𝐴𝑐𝑜𝑠√14𝑡 + 𝐵𝑠𝑖𝑛√14𝑡) = 10𝑐𝑜𝑠√14𝑡 (4)

Collecting like terms on both sides of equation (4)

coefficients of 𝑠𝑖𝑛√14𝑡:

−14𝐵 − 5√14𝐴 + 14𝐵 = 0 ⇒ −5√14𝐴 = 0


∴𝐴=0

coefficients of 𝑐𝑜𝑠√14𝑡:

−14𝐴 + 5√14𝐵 + 14𝐴 = 2 ⇒ 5√14𝐵 = 2


2
∴ 𝐵 = 5√14 ≈ 0,11

Therefore 𝑥𝑃𝐼 = 0,11𝑠𝑖𝑛√14𝑡

Hence 𝑥𝐺 = 𝑒 −2,5𝑡 (𝐶1 𝑐𝑜𝑠2,78𝑡 + 𝐶2 𝑠𝑖𝑛2,78𝑡) + 0,11𝑠𝑖𝑛√14𝑡


𝑥(0) = 0,5 ⇒ 𝐶1 = 0,5
𝑥𝐺′ = −2,5𝑒 −2,5𝑡 (𝐶1 𝑐𝑜𝑠2,78𝑡 + 𝐶2 𝑠𝑖𝑛2,78𝑡) + 𝑒 −2,5𝑡 (−2,78𝐶1 𝑠𝑖𝑛2,78𝑡 +
2,78𝐶2 𝑐𝑜𝑠2,78𝑡) + 0,11√14𝑐𝑜𝑠2,78𝑡

𝑥 ′ (0) = −1 ⇒ −1 = −2,5𝐶1 + 2,78𝐶2 + 0,11√14


−0,84
= −1,25 + 0,41 + 2,78𝐶2 ⇒ 𝐶2 = ≈ −0,30
2,78

∴ 𝑥𝐺 (𝑡) = 𝑒 −2,5𝑡 (0,5𝑐𝑜𝑠2,78𝑡 − 0,3𝑠𝑖𝑛2,78𝑡) + 0,11𝑠𝑖𝑛3,74𝑡


47

Activity 3.5
1.A body with mass 20𝑘𝑔 attached to a spring with spring constant 20𝑁/𝑚 is pulled
down 10𝑚 below its equilibrium position, if held until 𝑡 = 0, and then released from
rest and assumes an upward velocity of 10𝑚/𝑠.
Formulate a differential equation model describing the system and determine
displacement equation of the body.
2.The motion of an object is described by the differential equation
𝑑2 𝑥 𝑑𝑥
+ 4 𝑑𝑡 + 5𝑥 = 0 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑥(0) = 0,9 𝑎𝑛𝑑 𝑥 ′ (0) = 0,6
𝑑𝑡 2

Determine the displacement equation of the object and the frequency

𝑑2 𝑥 𝑑𝑥
3.Solve the following differential equation +4 + 5𝑥 = 0 ,
𝑑𝑡 2 𝑑𝑡

subject to 𝑥(0) = 1 𝑎𝑛𝑑 𝑥 ′ (0) = 0

4.The motion of an object is described by the differential equation


𝑑2 𝑥 𝑑𝑥
+ 2 𝑑𝑡 + 2𝑥 = 0 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑥(0) = 1 𝑎𝑛𝑑 𝑥 ′ (0) = 2
𝑑𝑡 2

Determine the displacement equation and then express the solution as a product
of a damping factor and sine factor.
5.The motion of an object is described by the differential equation
𝑑2 𝑥 𝑑𝑥
+ 10 𝑑𝑡 + 25𝑥 = 𝑐𝑜𝑠𝑡 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑥(0) = 1 𝑎𝑛𝑑 𝑥 ′ (0) = 0
𝑑𝑡 2

Use the method of undetermined coefficients to determine the displacement


equation and then sketch one cycle of the graph of the steady state solution.
6.An object with 10𝑘𝑔 mass is attached to spring hanging from a ceiling. This
causes the spring to stretch 2𝑚 on coming to rest at equilibrium. At time 𝑡 = 0,
an external force 𝑓(𝑡) = 20𝑐𝑜𝑠4𝑡 is applied to the system. The damping and
spring constants are 3𝑁/𝑚 and 49𝑁/𝑚 respectively. Formulate a differential
equation describing the system, use the method of undetermined coefficients to
determine the steady state solution for the system and sketch one cycle of the
sinusoidal sine wave 𝑦 = 𝐴𝑠𝑖𝑛(𝜔𝑡 + 𝛼).
48

Unit 4

4. Numerical Methods (Iterative approximations)

Introduction
There are differential equations that cannot be solved using any of the conventional
techniques learned under elementary methods. In this section we look at
approximating the solution of a differential equation using a set of points. The focus
is on the initial value problems (IVP’s) expressed as follows:
𝑑𝑦 𝑑2 𝑦
= 𝑓(𝑥; 𝑦) , 𝑦(𝑥0 ) = 𝑦0 and = 𝑓(𝑥 ; 𝑦 ; 𝑦 ′ ) , 𝑦(𝑥0 ) = 𝑦0 , 𝑦 ′ (𝑥0 ) = 𝑦0′
𝑑𝑥 𝑑𝑥 2

We study two techniques, namely, Euler’s method and Runge Kutta method.

By the end of this unit, you should be able to:

1. use Euler’s method to approximate solutions of first and second order

differential equations

2. apply Runge-Kutta method to approximate solutions of first and second

order differential equations.

3. use the Trapezoidal rule to evaluate definite integrals and determine

error bounds

4. use Simpson’s rule to approximate areas and to determine error


4.1. Numerical Differentiation
bounds

4.1 Euler’s method


One of the numerical techniques of approximating the solution to an IVP differential
equations is Euler’s method or method of tangent lines. The initial focus is to
approximate the solution of the initial-value-problem (IVP) of the form
𝑑𝑦
= 𝑓(𝑥; 𝑦), 𝑦(𝑥0 ) = 𝑦0 ; 𝑎 ≤ 𝑥 ≤ 𝑏
𝑑𝑥

The process is as follows:


The interval [𝑎; 𝑏] over which the function 𝑓(𝑥) is defined is divided into subintervals
of size ℎ. The increments on the 𝑥 − 𝑎𝑥𝑖𝑠 are given by 𝑥𝑖 = 𝑥0 + ℎ , 𝑖 = 0, 1, 2, …
49

If ℎ is a positive increment (step size) on the 𝑥-axis then we can find a point
(𝑥1 ; 𝑦1 ) = (𝑥0 + ℎ ; 𝑦1 ) on the line tangent to the unknown solution to the curve at
the assumed point (𝑥0 ; 𝑦0 ).
Taking a tangent line at the new generated point (𝑥1 ; 𝑦1 ) we get another point which
is closer to the true solution than the previous point. This process is repeated until
the required point is reached.
Geometrically, the approximate solution to the IVP differential equation is a polygon
with first side a tangent to the curve at 𝑥0 (which is the approximation of the solution
curve 𝑦(𝑥) at 𝑥0 ) as the diagram that follows illustrates.

𝑦 𝑦(𝑥) 𝑡𝑟𝑢𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛

𝑚 = 𝑓(𝑥0 ; 𝑦0 ) 𝑚 = 𝑓(𝑥1 ; 𝑦1 )

𝑚 = 𝑓(𝑥2 ; 𝑦1 )

(𝑥0 ; 𝑦0 ) (𝑥1 ; 𝑦1) (𝑥2 ; 𝑦2 )

𝑥0 𝑥1 𝑥2 𝑥

The slope of the tangent at 𝑥0 is given by 𝑚 = 𝑦ʹ(𝑥0 ) = 𝑓(𝑥0 ; 𝑦0 ), at 𝑥1 is given


by 𝑚 = 𝑦ʹ(𝑥1 ) = 𝑓(𝑥1 ; 𝑦1 ) and at 𝑦2 by 𝑚 = 𝑦ʹ(𝑥2 ) = 𝑓(𝑥2 ; 𝑦2 ) 𝑒𝑡𝑐.
To derive the Euler method of solving the 𝐼𝑉𝑃 differential equation we use Taylor’s
theorem. A brief discussion on Taylor’s Theorem follows.

4.1.1 Taylor’s Theorem


Suppose 𝑓 has (𝑛 + 1) continuous derivatives on an open interval containing 𝑎.
Then for each 𝑥 in the interval
𝑓″(𝑎) 𝑓 (𝑛) (𝑎)
𝑓(𝑥) = 𝑓(𝑎) + 𝑓ʹ(𝑎)(𝑥 − 𝑎) + (𝑥 − 𝑎)2 + ⋯ + (𝑥 − 𝑎)𝑛 + 𝑅𝑛+1 (𝑥)
2! 𝑛!
𝑓 (𝑛+1) (𝑎)
where the error term 𝑅𝑛+1 (𝑥) = (𝑥 − 𝑎)𝑘 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑐 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑎 𝑎𝑛𝑑 𝑥
(𝑛+1)!

Establishing the connection between Taylor’s theorem and Euler’s formula.


If we assume that 𝑦(𝑥) is the solution to the 𝐼𝑉𝑃 differential equation
𝑑𝑦
= 𝑓(𝑥; 𝑦), 𝑦(𝑥0 ) = 𝑦0
𝑑𝑥

and we use the Taylor Theorem to expand 𝑦 about 𝑥 = 𝑥𝑛 , we have


50

𝑦″(𝑥𝑛 ) 𝑦 (𝑛) (𝑥𝑛 )


𝑦(𝑥) = 𝑦(𝑥𝑛 ) + 𝑦ʹ(𝑥𝑛 )(𝑥 − 𝑥𝑛 ) + (𝑥 − 𝑥𝑛 )2 + ⋯ + (𝑥 − 𝑥𝑛 )𝑛
2! 𝑛!

If we evaluate 𝑦 at 𝑥𝑛+1 , that is at 𝑥 = 𝑥𝑛 + ℎ = 𝑥𝑛+1 , where ℎ is the uniform step


size of successive subdivision of [𝑥𝑖 ; 𝑥𝑖−1 ], then
𝑦″(𝑥𝑛 ) 𝑦 (𝑛) (𝑥𝑛 )
𝑦(𝑥𝑛+1 ) = 𝑦(𝑥𝑛 ) + ℎ𝑦ʹ(𝑥𝑛 ) + ℎ2 + ⋯ + ℎ𝑛 (1)
2! 𝑛!

Noting that 𝑦(𝑥𝑛+1 ) = 𝑦𝑛+1 , 𝑦(𝑥𝑛 ) = 𝑦𝑛 𝑒𝑡𝑐., the equation (1) can be rewritten as
(𝑛)
𝑦𝑛″ 𝑦𝑛
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑦𝑛ʹ + ℎ2 + ⋯ + ℎ𝑛
2! 𝑛!

Since 𝑦 ʹ (𝑥) = 𝑓(𝑥; 𝑦), the equation can be rewritten, for small subdivisions (ℎ → 0)
𝑦𝑛+1 ≈ 𝑦𝑛 + ℎ𝑦𝑛ʹ = 𝑦𝑛 + ℎ𝑓(𝑥; 𝑦)
The last result comes from the observation that as ℎ → 0, ℎ𝑛 (𝑛 = 2, 3, … ) becomes
(𝑛)
𝑦𝑛″ 𝑦𝑛
smaller, making ℎ2 + ⋯ + ℎ𝑛 Negligibly small. This gives rise to Euler’s
2! 𝑛!
formula. Euler’s formula
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 ; 𝑦𝑛 ), 𝒏 = 𝟎, 𝟏, 𝟐, …

Example 4.1
Use Euler’s method to approximate the solution of the initial-value-problem (𝐼𝑉𝑃)
𝑦 ʹ = 0,2𝑥𝑦 , 𝑦(1) = 1 ; 𝑥 = 1(0,1)1,2
Solution
From the given condition 𝑥 = 1(0,1)1,2
we note that [𝑎; 𝑏] = [1; 1,2] ; ℎ = 0,1 ; 𝑥0 = 1 ; 𝑦0 = 1
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 ; 𝑦𝑛 )
Using assumed value first (𝑥0 ; 𝑦0 ) = (1; 1)
𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 ; 𝑦0 )
= 1 + 0,1[0,2(𝑥0 . 𝑦0 )]
= 1 + 0,1[0,2(1.1)]
≈ 1,0200
𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 ; 𝑦1 )
= 1,02 + 0,1[0,2(𝑥1 . 𝑦1 )] , 𝑥1 = 𝑥0 + ℎ = 1 + 0,1 = 1,1
𝑥1 = 1,1 is not yet equal to the upper limit 𝑏 = 1,2 ∴ this iteration step is not the last.
= 1,02 + 0,1{0,2[(1,1). (1,02)]}
51

≈ 1,0224
𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 ; 𝑦1 )
= 1,02 + 0,1[0,2(𝑥1 . 𝑦1 )] , 𝑥2 = 𝑥1 + ℎ = 1,1 + 0,1 = 1,2
𝑥2 = 1,2 is equal to the upper limit 𝑏 = 1,2 ∴ this iteration step is the last.
= 1,0224 + 0,1{0,2[(1,2). (1,0224)]}
≈ 1,0469
𝐻𝑒𝑛𝑐𝑒 𝑦 ≅ 1,0469

Example 4.2
Use Euler’s method to approximate the solution of the following initial-value-problem
𝑦 ʹ = 0,2𝑥𝑦 , 𝑦(1) = 1 ; 𝑥 = 1(0,5)2,0
Solution
From the given condition 𝑥 = 1(0,5)2,0
we note that [𝑎; 𝑏] = [1; 2,0], ℎ = 0,5 ; 𝑥0 = 1 ; 𝑦0 = 1
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 ; 𝑦𝑛 )
Firstly, using assumed value (𝑥0 ; 𝑦0 ) = (1; 1)
𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 ; 𝑦0 )
= 1 + 0,5[0,2(𝑥0 . 𝑦0 )]
= 1 + 0,5[0,2(1.1)]
≈ 1,1000
𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 ; 𝑦1 )
= 1,1 + 0,5[0,2(𝑥1 . 𝑦1 )] , 𝑥1 = 𝑥0 + ℎ = 1 + 0,5 = 1,5
= 1,1 + 0,5{0,2[(1,2). (1,1)]}
≈ 1,2320
𝑦3 = 𝑦2 + ℎ𝑓(𝑥2 ; 𝑦2 )
= 1,2320 + 0,5[0,2(𝑥2 . 𝑦2 )] , 𝑥2 = 𝑥1 + ℎ = 1,5 + 0,5 = 2,0
𝑥2 = 2,0 is equal to the upper limit 𝑏 = 2,0 ∴ this iteration step is the last.
= 1,2320 + 0,5{0,2[(2,0). (1,2320)]}
≈ 1,4784
∴ 𝑦 ≅ 1,4784
52

Observation 1: In the two examples above we realize that enlarging the interval and
increasing the step size results into more iteration steps, that is, it takes longer to
arrive at the required solution point.

Class activity:
Using the above examples determine other observations that can be drawn in terms
of step size and interval. Relate these observations to error estimates

Example 4.3
Determine the solution of the differential equation ( 𝐼𝑉𝑃) in example 4.2 over the
interval 1 ≤ 𝑥 ≤ 1,4 and establish the error bound given by
ℎ2
𝑀 where 𝑀 = max |𝑦 ′′ (𝑥)|
2 𝑥𝑛 <𝑥<𝑥𝑛+1

Solution
Given 𝑦 ʹ = 0,2𝑥𝑦 , 𝑦(1) = 1 ; 𝑥 = 1(0,1)1,4
Starting with assumed value (𝑥0 ; 𝑦0 ) = (1; 1)
𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 ; 𝑦0 )
= 1 + 0,1[0,2(𝑥0 . 𝑦0 )]
= 1 + 0,1[0,2(1.1)]
≈ 1,0200
𝑦2 = 1,02 + 0,1[0,2(𝑥1 . 𝑦1 )]
= 1,02 + 0,1{0,2[(1,2). (1,02)]}
≈ 1,0445
𝑦3 = 1 + 0,1[0,2(𝑥2 . 𝑦2 )]
= 1,0445 + 0,1{0,2[(1,3). (1,0445)]}
≈ 1,0717
𝑦4 = 1 + 0,1[0,2(𝑥3 . 𝑦3 )]
= 1,0717 + 0,1{0,2[(1,4). (1,0717)]}
≈ 1,1017
∴ 𝑦 ≅ 1,1017
Self test: Compute the error bound for the iterations
53

Example 4.4
Solve the following differential equation using Euler’s method and establish the error
deviation between the third and the fourth iteration and compare this with the
deviation between the first and second iteration
𝑦ʹ + 2𝑦 = 2 − 𝑒 −4𝑥 , 𝑦(0) = 1 𝑓𝑜𝑟 𝑥 = 0(0,1)0,3
Solution
The differential equation can be written as
𝑦ʹ = 2 − 𝑒 −4𝑥 − 2𝑦 , 𝑦(0) = 1 𝑓𝑜𝑟 𝑥 = 0(0,1)0,3
𝑦𝑛+1 = 𝑦𝑛 + 0,1[2 − 𝑒 −4𝑥𝑛 − 2𝑦𝑛 ]

𝑦1 = 1 + 0,1[2 − 𝑒 −4(0) − 2(1)] = 0,9000

𝑦2 = 0,9 + 0,1[2 − 𝑒 −4(0,1) − 2(0,9)] = 0,8530

𝑦3 = 0,8530 + 0,1[2 − 𝑒 −4(0,2) − 2(0,8530)] = 0,8375

𝑦4 = 0,8375 + 0,1[2 − 𝑒 −4(0,3) − 2(0,8375)] = 0,8399

∴ 𝑦 ≅ 0,8399
Exercise: Establish error deviations between iterates

Activity 4.1
1. Use Euler’s method to determine the solution of the following differential equation
𝑦ʹ = 𝑥𝑦 − 𝑦 , 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑦(0) = 1 𝑓𝑜𝑟 𝑥 = 0(0,2)0,6
2. Use Euler’s method to approximate the solution of the following differential
equation.
(a) 𝑦ʹ = 𝑥 2 − 1 , 𝑦(0) = 2 , 𝑥 = 0(0,3)1,2
𝑡
(b) 𝑦ʹ − 𝑦 = 𝑒 2 𝑐𝑜𝑠5𝑡 , 𝑦(1) = 1 𝑓𝑜𝑟 𝑡 = 1(0,1)1,5

4.2 Euler’s method for second order differential equations


From Euler’s formula for first order differential equations we can establish
corresponding second order forms starting with
𝒉𝟐
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒚′𝒏 + 𝒚′′
𝒏 , 𝒏 = 𝟎, 𝟏 𝟐, …
𝟐!

which approximates 𝑦(𝑥𝑛+1 ) and we then determine


𝑦′𝒏+𝟏 = 𝑦𝑛′ + ℎ𝑦𝑛′′
54

Example 4.5
Use Euler’s method to approximate the solution to the differential equation
𝑦 ′′ = 𝑥𝑦 ′ − 2𝑦, 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑦(0) = 0 , 𝑦 ′ (0) = −3 over the interval
0 ≤ 𝑥 ≤ 0,2 , 𝑠𝑡𝑒𝑝 𝑠𝑖𝑧𝑒 ℎ = 0,1
Solution
Adopting formulae based on the differential equation
𝑦𝑛′′ = 𝑥𝑛 𝑦𝑛′ − 2𝑦𝑛 where ℎ = 0,1 , 𝑥0 = 0 , 𝑦0 = 0 , 𝑦0′ = −3
For 𝑛 = 0 ∶ 𝑦0′′ = 𝑥0 𝑦0′ − 2𝑦0
= 0(−3) − 2(0)
=0
ℎ2
𝑦1 = 𝑦0 + ℎ𝑦0′ + 𝑦0′′
2!

(0,1)2
= 0 + 0,1(−3) + (0)
2

= −0,3000
𝑦1′ = 𝑦0′ + ℎ𝑦0′′
= −3 + 0,1(0)
= −3,0000
For 𝑛 = 1 ∶ 𝑦1′′ = 𝑥1 𝑦1′ − 2𝑦1
= 0,1(−3) − 2(−0,3)
= 0,3000
ℎ2
𝑦2 = 𝑦1 + ℎ𝑦1′ + 𝑦1′′
2!

(0,1)2
= −0,3 + 0,1(−3) + (0,3)
2

≈ −0,5985
𝑦2′ = 𝑦1′ + ℎ𝑦1′′
= −3 + 0,1(0,3)
≈ −2,9700
For 𝑛 = 2 ∶ 𝑦2′′ = 𝑥2 𝑦2′ − 2𝑦2
= 0,2(−2,9700) − 2(−0,5985)
≈ 0,6030
55

ℎ2
𝑦3 = 𝑦2 + ℎ𝑦2′ + 𝑦2′′
2!

(0,1)2
= −0,5985 + 0,1(−2,9700) + (0,6030)
2

≈ −0,89255
𝑦3′ = 𝑦2′ + ℎ𝑦2′′
= −2,9700 + 0,1(0,6030)
≈ −2,9097

Example 4.6
Use Euler’s method to approximate the solution of the differential equation
𝑦 ′′ = 2𝑦 ′ − (𝑥 + 2)𝑦 , 𝑦(0) = 1 , 𝑦 ′ (0) = 2 , 𝑥 = 0(0,2)0,6
Solution
𝑦𝑛′′ = 2𝑦𝑛′ − (𝑥𝑛 + 2)𝑦𝑛 where ℎ = 0,2 , 𝑥0 = 0 , 𝑦0 = 1 , 𝑦0′ = 2
For 𝑛 = 0 ∶ 𝑦0′′ = 2𝑦0′ − (𝑥0 + 2)𝑦0
= 2(2) − (0 + 2)(1)
= 2,0000
ℎ2
𝑦1 = 𝑦0 + ℎ𝑦0′ + 𝑦0′′
2!

(0,2)2
= 1 + 0,2(2) + (2)
2

≈ 1,4400
𝑦1′ = 𝑦0′ + ℎ𝑦0′′
= 2 + 0,2(2)
≈ 2,4000
For 𝑛 = 1 ∶ 𝑦1′′ = 2𝑦1′ − (𝑥1 + 2)𝑦1
= 2(2,4) − (0,2 + 2)(1,44)
≈ 1,6320
ℎ2
𝑦2 = 𝑦1 + ℎ𝑦1′ + 𝑦1′′
2!

(0,2)2
= 1,44 + 0,2(2,4) + (1,6320)
2

≈ 1,95926
𝑦2′ = 𝑦1′ + ℎ𝑦1′′
56

= 2,4 + 0,2(1,6320)
≈ 2,7264
For 𝑛 = 2 ∶ 𝑦2′′ = 2𝑦2′ − (𝑥2 +2)𝑦2
= 2(2,7264) − (0,4 + 2)(1,9526)
≈ 0,7666
ℎ2
𝑦3 = 𝑦2 + ℎ𝑦2′ + 𝑦2′′
2!

(0,2)2
= 1,9526 + 0,2(2,7264) + (0,7666)
2

≈ 2,5132
𝑦3′ = 𝑦2′ + ℎ𝑦2′′
= 2,7264 + 0,2(0,7666)
≈ 2,8797
For 𝑛 = 3 ∶ 𝑦3′′ = 2𝑦3′ − (𝑥3 +2)𝑦3
= 2(2,8797) − (0,6 + 2)(2,5132)
≈ −0,7749
ℎ2
𝑦4 = 𝑦3 + ℎ𝑦3′ + 𝑦3′′
2!

(0,2)2
= 2,5132 + 0,2(2,8797) + (−0,7749)
2

≈ 3,0736
𝑦4′ = 𝑦3′ + ℎ𝑦3′′
= 2,8797 + 0,2(−0,7749)
≈ 2,7247

Activity 4.2
1. Use Euler’s method to approximate the solution of the following differential
equations.
(𝑎) 𝑦 ′′ = 𝑥𝑦 ′ − 3𝑦 , 𝑦(0) = 0 , 𝑦 ′ (0) = −2 𝑓𝑜𝑟 𝑥 = 0(0,1)0,3
(𝑏) 𝑦 ′′ − 3𝑦 ′ + 2𝑦 = 𝑥 , 𝑦(0) = 1 , 𝑦 ′ (0) = 2 , 𝑥 = 0(0,2)0,4
(𝑐) 𝑦 ′′ = 1 + 𝑥 − 𝑦 2 , 𝑦(0) = 2 , 𝑦 ′ (0) = 1 , 𝑥 = 0(0,2)0,4
57

4.3 Runge Kutta method


The Runge Kutta method for second order differential is a more accurate technique
than Euler’s and is also a generalization of Runge Kutta order 2 and 4 methods for
first order differential equations.
Solutions to initial value problems of the form
𝑦 ′′ = 𝑓(𝑥; 𝑦; 𝑦 ′ )
subject to the conditions 𝑦(𝑥0 ) = 𝑦0 and 𝑦 ′ (𝑥0 ) = 𝑦0′ are found in a given range by
obtaining a number of auxiliary quantities namely:
1
𝑘1 = 2 ℎ2 𝑓(𝑥𝑛 ; 𝑦𝑛 ; 𝑦𝑛′ )
1 ℎ ℎ 1 𝑘1
𝑘2 = 2 ℎ2 𝑓(𝑥𝑛 + 2 ; 𝑦𝑛 + 2 𝑦𝑛′ + 4 𝑘1 ; 𝑦𝑛′ + )

1 ℎ ℎ 1 𝑘2
𝑘3 = 2 ℎ2 𝑓(𝑥𝑛 + 2 ; 𝑦𝑛 + 2 𝑦𝑛′ + 4 𝑘1 ; 𝑦𝑛′ + )

1 ℎ 2𝑘3
𝑘4 = 2 ℎ2 𝑓(𝑥𝑛 + ℎ ; 𝑦𝑛 + 2 𝑦𝑛′ + 𝑘3 ; 𝑦𝑛′ + )

Using the results, we compute


1
𝐴 = 3 [𝑘1 + 𝑘2 + 𝑘3 ]
1
𝐵 = 3 [𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ]

We then determine
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑦𝑛′ + 𝐴
and
𝐵
𝑦′𝑛+1 = 𝑦′𝑛 + ℎ

Depending on the interval over which the approximation is to be carried out the steps
can then be repeated.

Example 4.7
Use Runge-Kutta method to approximate the solution of the following differential
equation
𝑦 ′′ = 𝑥 + 𝑦 + 𝑦 ′ , 𝑦(0) = 1 , 𝑦 ′ (0) = 0 , 𝑥 = 0(0,2)0,2
Solution
Adaptation of equations according to the differential equation
𝑦𝑛′′ = 𝑥𝑛 + 𝑦𝑛 + 𝑦𝑛′ , ℎ = 0,2 ; 𝑥0 = 0 ; 𝑦0 = 1 , 𝑦0′ = 0
58

1
For 𝑛 = 0 ∶ 𝑘1 = 2 ℎ2 𝑓(𝑥0 ; 𝑦0 ; 𝑦0′ )
1
= 2 ℎ2 (𝑥0 + 𝑦0 + 𝑦0′ )
1
= 2 (0,2)2 [0 + 1 + 0]

≈ 0,0200
1 ℎ 1 1
𝑘2 = 2 ℎ2 {(𝑥0 + 2) + (𝑦0 + ℎ𝑦0′ + 4 𝑘1 ) + (𝑦0′ + ℎ 𝑘1 )}
1
= 2 (0,2)2 {(0 + 0,1) + (1 + 0 + 0,005) + (0 + 0,1)}

≈ 0,0241
1 ℎ 1 1 1
𝑘3 = 2 ℎ2 {(𝑥0 + 2) + (𝑦0 + 2 ℎ𝑦0′ + 4 𝑘1 ) + (𝑦0′ + ℎ 𝑘2 )}
1
= 2 (0,2)2 {(0 + 0,1) + (1 + 0 + 0,005) + (0 + 0,1205)}

≈ 0,0245
1 2
𝑘4 = 2 ℎ2 {(𝑥0 + ℎ) + (𝑦0 + ℎ𝑦0′ + 𝑘3 ) + (𝑦0′ + ℎ 𝑘3 )}
1
= 2 (0,2)2 {(0 + 0,2) + (1 + 0 + 0,0245) + (0 + 0,2450)}

≈ 0,0294

1
𝐴 = 3 [𝑘1 + 𝑘2 + 𝑘3 ]
1
= 3 (0.0200 + 0,0241 + 0,0245)

≈ 0,0229
1
𝐵 = 3 [𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ]
1
= 3 [0,0200 + 2(0,0241) + 2(0,0245) + 0,0294]

≈ 0,0489
From 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑦𝑛′ + 𝐴 ⇒ 𝑦1 = 𝑦0 + ℎ𝑦0′ + 𝐴
= 1 + 0,2(0) + 0,0229
≈ 1,0229
𝐵 𝐵
From 𝑦′𝑛+1 = 𝑦′𝑛 + ℎ ⇒ 𝑦′1 = 𝑦′0 + ℎ
0,0489
= 0+ 0,2

≈ 0,2445
59

Activity 4.3
1. Determine the numerical solutions of the following differential equations using
Runge-Kutta method
𝑦′
(a) 𝑦 ′′ = + 𝑦 , 𝑦(1) = 0 , 𝑦 ′ (1) = 1 𝑜𝑣𝑒𝑟 1 ≤ 𝑥 ≤ 1,1 , ℎ = 0,1
𝑥

(b) 𝑦 ′′ = 𝑥𝑦 − 𝑦 ′ , 𝑦(0) = 0 , 𝑦 ′ (0) = 0 𝑓𝑜𝑟 𝑥 = 0(0,2)1


(c) 𝑥𝑦 ′′ = 𝑥 + 𝑦 , 𝑦(0) = 1 , 𝑦 ′ (0) = 2 , 𝑥 = 0(0,2)0,2

4.4 Integration (Approximating area double integrals)


Introduction
2 𝑒𝑥
There are some functions such as 𝑒 −𝑥 𝑎𝑛𝑑 which cannot be integrated
𝑥
analytically but we may come across experimental values represented by these
types of functions and we need to determine the value of the definite integral. The
3 2
process of approximating solutions of definite integrals such as ∫1 𝑒 −𝑥 𝑑𝑥 is known
as numerical integration. Of the many possible methods where a numerical estimate
of the value of the definite integral may be made, for our purposes we choose the
trapezoidal rule and Simpson’s rule.

4.4.1 The Trapezoidal rule


For the derivation of the trapezoidal rule consider the diagram that follows and let us
estimate the area below the curve 𝑦 = 𝑓(𝑥) between the lines 𝑎 = 𝑥0 𝑎𝑛𝑑 𝑏 = 𝑥𝑛
𝑏
which is known to have the value ∫𝑎 𝑓(𝑥)𝑑𝑥
𝑦

𝑦 = 𝑓(𝑥; 𝑦)

0 𝑎 = 𝑥0 𝑥1 𝑥2 𝑥𝑛−1 𝑥𝑛 = 𝑏 𝑥

We obtain an estimate of this area (integral) by taking any set of 𝑛 + 1 points


𝑎 = 𝑥0 < 𝑥1 < ⋯ < 𝑥𝑛 = 𝑏, and on each interval [𝑥𝑖−1 ; 𝑥𝑖 ], we approximate the true
area above it by the trapezium obtained by replacing the arc of the curve through the
points [𝑥𝑖−1 ; 𝑓(𝑥𝑖 ) , (𝑥𝑖 ; 𝑓(𝑥𝑖 ))] by the chord joining these two points(i.e. by using
linear interpolation). Then the area of the trapezium on the interval [𝑥𝑖−1 ; 𝑥𝑖 ] is
1
(𝑓(𝑥𝑖−1 ) + 𝑓(𝑥𝑖 )∆𝑥𝑖 where ∆𝑥𝑖 = 𝑥𝑖 − 𝑥𝑖−1 .
2
60

Summing up the 𝑛 contributions of this type leads to the general trapezoidal rule
𝑏 1 1
∫𝑎 𝑓(𝑥)𝑑𝑥 ≈ 2 [𝑓(𝑥0 ) + 𝑓(𝑥1 )]∆𝑥1 + 2 [𝑓(𝑥1 ) + 𝑓(𝑥2 )]∆𝑥2 + ⋯
1
+ 2 [𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]∆𝑥𝑛 (1)
𝑏−𝑎
If the interval [𝑎; 𝑏] is divided into 𝑛 equal parts of length ℎ = the equation
𝑛
becomes
𝑏 1
∫𝑎 𝑓(𝑥)𝑑𝑥 = ℎ{[2 𝑓(𝑥0 ) + 𝑓(𝑥1 )] + [𝑓(𝑥1 ) + 𝑓(𝑥2 )] + ⋯
1
+ [𝑓(𝑥𝑛−1 ) + 2 𝑓(𝑥𝑛 )]} + ℇ(ℎ)

The error term ℇ(ℎ) is dependent on the magnitude of ℎ.


In general, the error bound in the trapezoidal rule is given by
𝐾|(𝑏−𝑎)3 |
ℰ𝑡𝑟 ≤ 12𝑛2

where |𝑓″(𝑥)| ≤ 𝐾, 𝑓𝑜𝑟 𝑎 ≤ 𝑥 ≤ 𝑏

Example 4.8
21
Use the trapezoidal rule to approximate ∫1 𝑥 𝑑𝑥 , 𝑛 = 5 and state the error bounds

Solution
𝑏−𝑎 2−1 1
𝑛 = 5 ,𝑎 = 1 ,𝑏 = 2 ,∴ ℎ = = = 5 = 0,2
𝑛 5

1 1,2 1,4 1,6 1,8 2

21 1 1
∫1 𝑥 𝑑𝑥 = ℎ [2 𝑓(1) + 𝑓(1,2) + 𝑓(1,4) + 𝑓(1,6) + 𝑓(1,8) + 2 𝑓(2)]

= 0,2[0,5 + 0,8333 + 0,7143 + 0,6250 + 0,5556 + 0,25]


≈ 0,6956 (4D)
21
Analytically ∫1 𝑥 𝑑𝑥 = [𝑙𝑛𝑥]12 = 𝑙𝑛2 = 𝑙𝑛1 = 𝑙𝑛2 ≈ 0,6932 (4D)

Actual error ≈ 0,6956 − 0,6932 = 0,0024


2
For error bounds, we determine |𝑓 ″ (𝑥)| = |𝑥 3 | , 𝑓 ″ (1) = 2 = 𝐾1 , 𝑓 ″ (2) = 0,25 = 𝐾2

2(2−1)3 1
For 𝐾1 , ℇ𝑡𝑟 ≤ = 150 = 0.007
12(5)2

0,25(2−1)3 0,25
For 𝐾2 , ℇ𝑡𝑟 ≤ = = 0.0008
12(5)2 300

∴ 0,0008 ≤ ℇ𝑡𝑟 ≤ 0,007


61

4.4.2 Simpson’s rule


Introduction
To develop another numerical approximation of the definite integral the Simpson’s
rule we partition the interval [𝑎; 𝑏] = [𝑥0 ; 𝑥𝑛 ] into 𝑛 subintervals, each of width
𝑏−𝑎
∆𝑥 = ℎ = , 𝑛 𝑒𝑣𝑒𝑛. We then approximate the function over consecutive pairs of
𝑛
sub-intervals by a quadratic polynomial. That is, fitting a parabola to the three points
(𝑎 ; 𝑓(𝑎)), (𝑎 + ℎ ; 𝑓(𝑎 + ℎ)), (𝑎 + 2ℎ ; 𝑓(𝑎 + 2ℎ))

comprising the first two sub-intervals of [𝑎; 𝑏], and thereafter repeating the process
until the whole interval [𝑎; 𝑏] is covered. The value of the definite integral can now be
estimated by integrating the successive quadratic approximations. This process
leads to the following algorithm.

Theorem 4.1 Simpson’s Rule


Let 𝑓 be continuous on [𝑎; 𝑏] and let 𝑛 be an even integer, then
𝑏 𝑏−𝑎
∫𝑎 𝑓(𝑥)𝑑𝑥 = [𝑓(𝑥0 ) + 4𝑓(𝑥1 ) + 2𝑓(𝑥2 ) + 4𝑓(𝑥3 ) + ⋯ + 4𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]
3𝑛

Moreover, the error bound is given by


𝐾|(𝑏−𝑎)5 |
ℰ𝑠𝑝 ≤ 180𝑛4

where |𝑓 (4) | = 𝐾, 𝑓𝑜𝑟 𝑎 ≤ 𝑥 ≤ 𝑏

NB: Observe that the coefficients in Simpson’s rule follow the pattern
1 4 2 4 2 4…4 2 4 1

Example 4.9
𝜋
Use Simpson’s rule with four subintervals (𝑛 = 4) to approximate ∫0 𝑠𝑖𝑛𝑥 𝑑𝑥 and
determine the bounds.
Solution
𝑏−𝑎 𝜋−0 𝜋
𝑛 = 4 ,𝑎 = 0 ,𝑏 = 𝜋 ,∴ ℎ = = = = 0,7854
𝑛 4 4
𝜋 𝜋 3𝜋
0 𝜋
4 2 4
𝜋 𝜋 𝜋 𝜋 3𝜋
∫0 𝑠𝑖𝑛𝑥 𝑑𝑥 = 3(4) [𝑓(0) + 4𝑓 ( 4 ) + 2𝑓 ( 2 ) + 4𝑓 ( 4 ) + 𝑓(𝜋)]

= 0,2618[0 + 2,8284 + 2 + 2,8284 + 0]


≈ 2,0019
62

𝜋
Analytically ∫0 𝑠𝑖𝑛𝑥 𝑑𝑥 = [−𝑐𝑜𝑠𝑥]𝜋0 = 𝑙𝑛2 = −(𝑐𝑜𝑠𝜋 − 𝑐𝑜𝑠 0) = 2,0000 (4))

Actual error ≈ 2,0019 − 2,0000 = 0,0019

For error bounds, we determine 𝑓 (4) (𝑥) = 𝑠𝑖𝑛𝑥 , 𝑓 (4) (0) = 0 = 𝐾1 , 𝑓 (4) (𝜋) = 0 = 𝐾2
0(𝜋−0)5
For 𝐾1 𝑎𝑛𝑑 𝐾2 , ℰ𝑠𝑝 ≤ = 0 ⇒ lower bound is = 0. For the upper bound we
180(5)4
can consider taking 𝑥𝑖 < 𝜋.

Activity 4.4
1. Use the trapezoidal rule to approximate the definite integrals
𝜋
(a) ∫0 𝑠𝑖𝑛𝑥𝑑𝑥 , 𝑛 = 5
1 2
(b) ∫0 (𝑥+2)2
𝑑𝑥 , 𝑛=4
3 2
(c) ∫2 𝑑𝑥 , 𝑛 = 4
𝑥2
1
(d) ∫0 𝑐𝑜𝑠𝑥𝑑𝑥 , 𝑛 = 6

2. Use the Simpson’s rule to approximate the definite integral and determine the
corresponding error bounds.
𝜋
√2
(a) ∫0 𝑠𝑖𝑛𝑥 2 𝑑𝑥 , 𝑛 = 4
31
(b) ∫1 𝑥 𝑑𝑥 , 𝑛 = 4
1
(c) ∫0 √1 + 𝑥 2 𝑑𝑥 , 𝑛 = 4
𝜋
(d) ∫0 𝑐𝑜𝑠𝑥𝑑𝑥 , 𝑛 = 6

4.4.3 Double integrals


The numerical evaluation of double integrals is based upon formulae for the
evaluation of one-dimensional integrals. We shall restrict ourselves to double
integrals of the form
𝑑 𝑏
∫𝑐 ∫𝑎 𝑓(𝑥; 𝑦)𝑑𝑥𝑑𝑦 (1)

First we shall use the trapezoidal rule for one interval to get a formula for (1) and
then subdivide the interval [𝑎 ; 𝑏] into 𝑛 subintervals and [𝑐 ; 𝑑] into 𝑚
subintervals to get a more general computation formula for (1)
63

𝐹𝑖𝑔𝑢𝑟𝑒 (𝑎)
𝑦
𝑦1 ---------------

𝑦0 ---------------

𝑥0 𝑥1 𝑥

Suppose we want to integrate over a small rectangular region as shown in figure (a)
above. Using the trapezoidal rule considering 𝑦 as fixed we get
𝑥 1 ℎ
∫𝑥0 𝑓(𝑥; 𝑦)𝑑𝑥 = 2 [𝑓(𝑥0 ; 𝑦) + 𝑓(𝑥1 ; 𝑦)]

Now if we consider 𝑦 as a variable and integrating we get


1𝑦 1 𝑥 1 𝑦 ℎ
∫𝑦0 ∫𝑥0 𝑓(𝑥; 𝑦)𝑑𝑥𝑑𝑦 = ∫𝑦0 2 [𝑓(𝑥0 ; 𝑦) + 𝑓(𝑥1 ; 𝑦)]𝑑𝑦

Using the trapezoidal rule to approximate the integral on the right we get
𝑦
1 1 𝑥 ℎ𝑘
∫𝑦0 ∫𝑥0 𝑓(𝑥; 𝑦)𝑑𝑥𝑑𝑦 = [𝑓(𝑥0 ; 𝑦0 ) + 𝑓(𝑥1 ; 𝑦0 ) + 𝑓(𝑥0 ; 𝑦1 ) + 𝑓(𝑥1 ; 𝑦1 )]
4

Now, considering the more general form (1) divide [𝑎 ; 𝑏] into 𝑛 sub-intervals of
(𝑏−𝑎) (𝑑−𝑐)
length ℎ = and [𝑐 ; 𝑑] into subintervals of length 𝑘 = .
𝑛 𝑚

Proceeding as before considering 𝑦 as fixed and letting 𝑥𝑖 = 𝑎 + 𝑖ℎ 𝑎𝑛𝑑


𝑦𝑖 = 𝑐 + 𝑖𝑘 we get
𝑏 ℎ
∫𝑎 𝑓(𝑥; 𝑦)𝑑𝑥 = 2 [𝑓(𝑥0 ; 𝑦) + 𝑓(𝑥𝑛 ; 𝑦) + 2 ∑𝑛−1
𝑖=1 𝑓(𝑥𝑖 ; 𝑦)]

Integrating both sides we get


𝑑 𝑏 𝑑ℎ
∫𝑐 ∫𝑎 𝑓(𝑥; 𝑦)𝑑𝑥𝑑𝑦 = ∫𝑐 [𝑓(𝑥0 ; 𝑦) + 𝑓(𝑥𝑛 ; 𝑦) + 2 ∑𝑛−1
𝑖=1 𝑓(𝑥𝑖 ; 𝑦)]𝑑𝑦
2

Using the trapezoidal rule for 𝑚 sub-intervals to approximate the integral on the right
and letting 𝑓𝑖;𝑗 = 𝑓(𝑥𝑖 ; 𝑦𝑗 ) we get the generalized form
𝑑 𝑏
∫𝑐 ∫𝑎 𝑓(𝑥; 𝑦)𝑑𝑑𝑥 𝑑𝑦
𝑛−1 𝑚−1

𝑓0;0 + 𝑓0;𝑚 + 𝑓𝑛;0 + 𝑓𝑛;𝑚 + 2 [∑(𝑓𝑖;0 + 𝑓𝑖;𝑚 ) + ∑ (𝑓0;𝑗 + 𝑓𝑛;𝑗 )]


ℎ𝑘 𝑖=1 𝑗=1
=
4 𝑛−1 𝑚−1

+4 ∑ ∑ 𝑓𝑖;𝑗
{ 𝑖=1 𝑗=1 }
64

Example 4.10
2 2
Use numerical approximation to compute ∫1 ∫1 (𝑥 + 𝑦)𝑑𝑥𝑑𝑦 over a rectangular
region with sub-intervals 𝑛 = 𝑚 = 2

Solution 2

𝑏−𝑎 1 𝑑−𝑐 1
ℎ= =2 , 𝑘= =2 𝟑
𝑛 𝑚 𝟐

𝟑
𝑎=1 𝑏=2
𝟐

2 2 1 𝑓(𝑥0 ; 𝑦0 ) + 𝑓(𝑥0 ; 𝑦2 ) + 𝑓(𝑥2 ; 𝑦0 ) + 𝑓(𝑥2 ; 𝑦2 )


∫1 ∫1 (𝑥 + 𝑦)𝑑𝑥𝑑𝑦 = 16 { }
+2[𝑓(𝑥1 ; 𝑦0 ) + 𝑓(𝑥1 ; 𝑦2 ) + 𝑓(𝑥0 ; 𝑦1 ) + 𝑓(𝑥2 ; 𝑦1 )] + 4𝑓(𝑥1 ; 𝑦1 )
1 5 7 5 7
= 16 [(2 + 3 + 3 + 4) + 2 (2 + 2 + 2 + 2) + 4(3)]
48
= 16

≈3
2 2
Using the analytical method we find that the actual value ∫1 ∫1 (𝑥 + 𝑦)𝑑𝑥𝑑𝑦 = 3

From here we can proceed and determine the error deviation as well as the relative
percentage error deviation.

Activity 4.5
1. Use Numerical methods to approximate the following integrals
2 2
(𝑎) ∫1 ∫1 (𝑥 + 𝑦)𝑑𝑥𝑑𝑦 , 𝑛 = 𝑚 = 3
2 0
(𝑏) ∫0 ∫−2(𝑥 + 𝑦)𝑑𝑥𝑑𝑦 , 𝑛 = 𝑚 = 2
1 1
(𝑐) ∫0 ∫0 (𝑥𝑦 + 1)𝑑𝑥𝑑𝑦 , 𝑛 = 𝑚 = 2

2. Derive a formula to approximate


𝑦 2 𝑥 2
∫𝑦0 ∫𝑥0 𝑓(𝑥; 𝑦)𝑑𝑥𝑑𝑦

Using Simpson’s rule with 𝑥2 − 𝑥0 = 2ℎ , 𝑦2 − 𝑦0 = 2𝑘.


65

Unit 5

5.Partial Differentiation
Introduction
In engineering applications and other related fields there are physical systems that
depend on more than one variable for analysis. The analysis of systems of this
nature lead to the study of functions of several variables and their behavior under
certain conditions. We will introduce these functions and determine how they can be
used to find extreme values.

By the end of this unit, you should be able to:

1. evaluate first and second order partial derivatives

2. use partial derivatives to determine extrema of functions

3. use partial derivatives to determine directional derivatives

4. apply the technique of separation of variables to solve the heat

equation, wave equation and the Laplace equation

5. identify eigenvalues and eigenfunctions

6. determine Fourier series coefficients leading to orthogonal expansions


Illustration
A chemist may be interested in determining the effect of a catalyst in an experiment
by keeping one variable constant say temperature and be interested in how much
applied pressure is needed for the catalyst to reach a certain point of effectiveness.
The chemist may use the concept of rate of change of a function 𝑓 with respect to
one of its independent variables. This process is known as partial differentiation. As
part of an introduction the following can be stated:

Definition 5.1
If 𝑧 = 𝑓(𝑥; 𝑦), the first partial derivatives of 𝑓 with respect to 𝑥 and 𝑦 are functions
𝑓𝑥 and 𝑓𝑦 defined by
𝜕𝑓 𝑓(𝑥+∆𝑥 ; 𝑦)−𝑓(𝑥 ; 𝑦) 𝜕𝑓 𝑓(𝑥 ; 𝑦+∆𝑦)−𝑓(𝑥 ; 𝑦)
= 𝑓𝑥 (𝑥; 𝑦) = lim and = 𝑓𝑦 (𝑥; 𝑦) = lim
𝜕𝑥 ∆𝑥→0 ∆𝑥 𝜕𝑦 ∆𝑦→0 ∆𝑦

provided the limits exist.


66

5.1.1 Evaluation of partial derivatives

Example 5.1
Determine the partial derivatives 𝑓𝑥 and 𝑓𝑦 for the function

𝑧 = 𝑓(𝑥; 𝑦) = 3𝑥 − 𝑥 2 𝑦 2 − 3𝑦 + 2
Solution
𝜕𝑧
= 𝑓𝑥 (𝑥; 𝑦) = 3 − 2𝑥𝑦 2 − 0 = 3 − 2𝑥𝑦 2
𝜕𝑥

𝜕𝑧
= 𝑓𝑦 (𝑥; 𝑦) = 0 − 2𝑥 2 𝑦 = −2𝑥𝑦 2 − 3
𝜕𝑦

Example 5.2
𝜕𝑧 𝜕𝑧
Determine and if
𝜕𝑥 𝜕𝑦

(a) 𝑧 = 𝑓(𝑥; 𝑦) = 3𝑥𝑦 2 − ln (𝑥 2 + 𝑦 2 )


(b) 𝑧 = 𝑓(𝑥; 𝑦) = 2𝑒 2𝑥𝑦 + sinh (𝑥 2 𝑦 3 )
Solution
𝜕𝑧 2𝑥 𝜕𝑧 2𝑦
(a) = 3𝑦 2 − ; = 6𝑥𝑦 −
𝜕𝑥 𝑥 2 +𝑦 2 𝜕𝑦 𝑥 2 +𝑦 2

𝜕𝑧 𝜕𝑧
(b) = 4𝑦𝑒 2𝑥𝑦 + 2𝑥𝑦 3 𝑐𝑜𝑠ℎ (𝑥 2 𝑦 3 ) , = 4𝑥𝑒 2𝑥𝑦 + 3𝑥 2 𝑦 2 𝑐𝑜𝑠ℎ (𝑥 2 𝑦 3 )
𝜕𝑥 𝜕𝑦

5.1.2 Second order partial derivatives


Definition 5.2
If 𝑧 = 𝑓(𝑥; 𝑦) is a function of 𝑥 and 𝑦 and 𝑓𝑥 and 𝑓𝑦 are also functions of 𝑥 and
𝑦 then the second partial derivatives are given by
𝜕 𝜕𝑓 𝜕2𝑓 𝜕 𝜕𝑓 𝜕2𝑓
( ) = 𝜕𝑥 2 = 𝑓𝑥𝑥 , ( ) = 𝜕𝑦 2 = 𝑓𝑦𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦

𝜕 𝜕𝑓 𝜕2 𝑓 𝜕 𝜕𝑓 𝜕2 𝑓
and ( ) = 𝜕𝑥𝑦 = 𝑓𝑥𝑦 = 𝑓𝑦𝑥 = 𝜕𝑦 (𝜕𝑥 ) = 𝜕𝑦𝑥
𝜕𝑥 𝜕𝑦

Example 5.3
𝜕2𝑓 𝜕2𝑓 𝜕2𝑓 𝜕2𝑓 𝑥
Determine , , 𝑎𝑛𝑑 if 𝑧 = 𝑓(𝑥; 𝑦) = 𝑥 2 − 𝑦 2 + 𝑐𝑜𝑠 (𝑦)
𝜕𝑥 2 𝜕𝑦 2 𝜕𝑥𝑦 𝜕𝑦𝑥
67

Solution
𝜕𝑓 1 𝑥 𝜕2𝑓 1 𝑥 𝜕𝑓 𝑥 𝑥 𝜕2𝑓
= 2𝑥 − 𝑦 𝑠𝑖𝑛 (𝑦) ; = 2 − 𝑦 2 𝑐𝑜𝑠 (𝑦) ; = −2𝑦 + 𝑦 2 𝑠𝑖𝑛 (𝑦) ; =
𝜕𝑥 𝜕𝑥 2 𝜕𝑦 𝜕𝑦 2
2𝑥 𝑥 𝑥2 𝑥 𝜕2𝑓 𝑥 𝑥 1 𝑥 𝜕2 𝑓
−2 + [− 𝑦 3 𝑠𝑖𝑛 (𝑦) − 𝑦3 𝑐𝑜𝑠 (𝑦)] ; = (𝑦 3 𝑐𝑜𝑠 (𝑦) + 𝑦 2 𝑠𝑖𝑛 (𝑦)) = 𝜕𝑥𝑦
𝜕𝑦𝑥

Example 5.4
Determine 𝑓𝑦𝑥 at the point (1; 1) if f 𝑧 = 𝑓(𝑥; 𝑦) = ln (sec (𝑥𝑦)

Solution
𝑦𝑠𝑒𝑐(𝑥𝑦)tan (𝑥𝑦)
𝑓𝑥 = = 𝑦𝑡𝑎𝑛(𝑥𝑦) , 𝑓𝑦𝑥 = 𝑥𝑦𝑠𝑒𝑐 2 (𝑥𝑦) + 𝑡𝑎𝑛 (𝑥𝑦)
sec (𝑥𝑦)

2
∴ 𝑓𝑦𝑥 (1; 2) = 𝑐𝑜𝑠2 (2) + 𝑡𝑎 𝑛(2) ≈ −6,991

Activity 5.1
1. Evaluate 𝑓𝑥 and 𝑓𝑦 for the following

(a) 𝑧 = 𝑓(𝑥; 𝑦) = 𝑦 3 + 2𝑥𝑦 2 + 2


𝑥+𝑦
(b) 𝑧 = 𝑓(𝑥; 𝑦) = 𝑙𝑛 𝑥−𝑦

(c) 𝑧 = 𝑓(𝑥; 𝑦) = 𝑠𝑖𝑛5𝑥𝑐𝑜𝑠ℎ3𝑥


(d) 𝑧 = 𝑓(𝑥; 𝑦) = cos(𝑥𝑦) 𝑎𝑡 (1; 1)
(e) 𝑧 = 𝑓(𝑥; 𝑦) = 𝑒 𝑦 𝑠𝑖𝑛𝑥𝑦
𝑦
(f) 𝑧 = 𝑓(𝑥; 𝑦) = 𝑠𝑖𝑛ℎ−1 (𝑥 )

𝜕2𝑧 𝜕2 𝑧 𝜕2𝑧
2. Determine ; 𝑎𝑛𝑑 if
𝜕𝑥 2 𝜕𝑥 2 𝜕𝑥𝜕𝑦

(a) 𝑧 = ln(𝑥 − 𝑦)
(b) 𝑧 = 𝑥 2 − 𝑥𝑦 + 𝑦 2 − 5𝑥 + 𝑦
(c 𝑧 = 𝑒 −𝑥 𝑡𝑎𝑛ℎ𝑦
(d) 𝑧 = sech (𝑠𝑖𝑛2𝑥)
𝑦
(e) 𝑧 = 𝑡𝑎𝑛−1 (𝑥 )
68

5.2 Relative maximum and minimum (Extrema problems)


The modelling of real-life situations often requires the determination of maximum and
minimum quantities (input/output and profit/loss). These quantities may be as result
of effects brought about by manipulation of variables effects of relationships of
variables in in systems defined by such equations. One of the most familiar and
useful methods is the application of partial differentiation in determining those points
in some region R at which the function 𝑧 = 𝑓(𝑥; 𝑦) assumes its maximum and
minimum values. Collectively these values are known as extrema of the function and
they are of various types as the following indicates:

Definition 5.2
Let 𝑓 have continuous second order partial derivatives on an open region R
containing the point (𝑎; 𝑏) for which 𝑓𝑥 (𝑎; 𝑏) = 0 𝑎𝑛𝑑 𝑓𝑦 (𝑎; 𝑏) = 0.

To test for the relative extrema of 𝑓 , consider the quantity


2
𝑑 = 𝑓𝑥𝑥 (𝑎; 𝑏). 𝑓𝑦𝑦 (𝑎; 𝑏) − [𝑓𝑥𝑦 (𝑎; 𝑏)]

(a) If 𝑑 > 0 𝑎𝑛𝑑 𝑓𝑥𝑥 (𝑎; 𝑏) > 0, then 𝑓 has a relative minimum at (𝑎; 𝑏)
(b) If 𝑑 > 0 𝑎𝑛𝑑 𝑓𝑥𝑥 (𝑎; 𝑏) < 0, then 𝑓 has a relative maximum at (𝑎; 𝑏)
(c) If 𝑑 < 0 𝑎𝑛𝑑 𝑓𝑥𝑥 (𝑎; 𝑏) < 0, then [(𝑎; 𝑏); 𝑓(𝑎; 𝑏)] is a saddle point
(d) If 𝑑 = 0, the test is inconclusive

Example 5.5
Determine the relative extremum of the following function
𝑓(𝑥; 𝑦) = −𝑥 2 − 5𝑦 2 + 10𝑥 − 10𝑦 + 28
Solution
𝑓𝑥 = −2𝑥 + 10 , 𝑓𝑦 = −10𝑦 − 10

𝑓𝑥 = 0 ⇒ −2𝑥 + 10 = 0 , 𝑓𝑦 = 0 ⇒ −10𝑦 − 10 = 0

⇒𝑥 =5 , 𝑦 = −1
𝑓𝑥𝑥 = −2 , 𝑓𝑦𝑦 = −10 , 𝑓𝑥𝑦 = 0
2
𝑑 = (𝑓𝑥𝑥 (5; −1). 𝑓𝑦𝑦 (5; −1)) − [𝑓𝑥𝑦 (5; −1)]

= (−2 × −10) − 0
= 20 > 0
Since 𝑑 > 0 𝑎𝑛𝑑 𝑓𝑥𝑥 = −2 < 0, 𝑓(𝑥; 𝑦) has a relative maximum at (5; −1)
69

Example 5.6
Investigate the existence of relative extremum for the following function
𝑓(𝑥; 𝑦) = 𝑥 2 − 3𝑥𝑦 − 𝑦 2
Solution
𝑓𝑥 = 2𝑥 − 3𝑦 , 𝑓𝑦 = −3𝑥 − 2𝑦

𝑓𝑥 = 0 ⇒ 2𝑥 − 3𝑦 = 0 , 𝑓𝑦 = 0 ⇒ −3𝑥 − 2𝑦 = 0

⇒ 2𝑥 = 3𝑦
3𝑦
⇒𝑥 = 2
3𝑦
substituting 𝑥 = into −3𝑥 − 2𝑦 = 0
2

3𝑦
we have −3 ( 2 ) = 2𝑦 ⇒ 𝑦 = 0 ∴ 𝑥 = 0

𝑓𝑥𝑥 = 2 , 𝑓𝑦𝑦 = −3 , 𝑓𝑥𝑦 = 0


2
𝑑 = (𝑓𝑥𝑥 (0; 0). 𝑓𝑦𝑦 (0; 0)) − [𝑓𝑥𝑦 (0; 0)]

= (2 × −3) − 0
= −6 > 0
Since 𝑑 > 0 𝑎𝑛𝑑 𝑓𝑥𝑥 = −2 < 0, 𝑓(𝑥; 𝑦) has a relative maximum at (0; 0)

Example 5.7
Test for the existence of relative extremum for the following function
𝑓(𝑥; 𝑦) = 𝑥 3 + 𝑦 3
Solution
𝑓𝑥 = 3𝑥 2 , 𝑓𝑦 = 3𝑦 2

𝑓𝑥 = 0 ⇒ 3𝑥 2 = 0 , 𝑓𝑦 = 0 ⇒ 3𝑦 2 = 0

∴𝑥=0 , ∴𝑦=0
𝑓𝑥𝑥 = 6𝑥 , 𝑓𝑦𝑦 = 6𝑦 , 𝑓𝑦𝑥 = 0
2
𝑑 = (𝑓𝑥𝑥 (0; 0). 𝑓𝑦𝑦 (0; 0)) − [𝑓𝑥𝑦 (0; 0)]

= (0 × 0) − 0
=0
Since 𝑑 = 0 , the test is inconclusive
70

Activity 5.2
1. Determine the relative extremum of the following functions
(a) 𝑓(𝑥; 𝑦) = −𝑥 3 + 4𝑥𝑦 − 2𝑦 2 + 1
(b) 𝑓(𝑥; 𝑦) = 3𝑥 2 + 2𝑦 2 − 6𝑥 − 4𝑦 + 16
(c) 𝑓(𝑥; 𝑦) = −5𝑥 2 + 4𝑥𝑦 − 𝑦 2 + 16𝑥 + 10
(d) 𝑓(𝑥; 𝑦) = 80𝑥 + 80𝑦 − 𝑥 2 − 𝑦 2
2. Examine the function for relative extremum and saddle point
(a) 𝑓(𝑥; 𝑦) = 𝑥 2 − 𝑦 2 − 𝑥 − 𝑦
(b) 𝑓(𝑥; 𝑦) = 𝑥 2 − 3𝑥𝑦 − 𝑦 2

5.3 Directional derivatives


Recall that definition 5.1 states that
If 𝑓 is a function of two variables, the first partial derivatives of 𝑓 with respect to 𝑥
and 𝑦 are the functions 𝑓𝑥 and 𝑓𝑦 such that
𝑓(𝑥+ℎ; 𝑦)−𝑓(𝑥 ; 𝑦)
𝑓𝑥 (𝑥; 𝑦) = lim
ℎ→0 ℎ

and
𝑓(𝑥 ; 𝑦+ℎ)−𝑓(𝑥 ; 𝑦)
𝑓𝑦 (𝑥; 𝑦) = lim
ℎ→0 ℎ

Now suppose 𝑓(𝑥; 𝑦) is the temperature at the point 𝑃(𝑥; 𝑦) of a flat metal plate in
the 𝑥, 𝑦-plane, then 𝑓𝑥 (𝑥; 𝑦) and 𝑓𝑦 (𝑥; 𝑦) give us instantaneous rates of change of
the temperature with respect to the distance in the horizontal and vertical directions.
Observe the diagrams to have an idea of the propagations.
𝑦 𝑦 𝑄(𝑥 ; 𝑦 + ℎ)

𝑃(𝑥 ; 𝑦) 𝑄(𝑥 + ℎ ; 𝑦)

𝑃(𝑥 ; 𝑦)

𝑥 𝑥

horizontal direction vertical direction


71

The next definition generalizes 𝑓(𝑥; 𝑦) in any direction


Definition 5.3
Let 𝑤 = 𝑓(𝑥; 𝑦) and let 𝒖 = 𝑢1 𝒊 + 𝑢2 𝒋 be a unit vector. The directional derivative of
𝑓 at the point 𝑃(𝑥; 𝑦) in the direction of 𝒖 , denoted by 𝐷𝒖 𝑓(𝑥; 𝑦) is
𝑓(𝑥+𝑠𝑢1 ; 𝑦+𝑠𝑢2 )−𝑓(𝑥;𝑦)
𝐷𝒖 𝑓(𝑥; 𝑦) = lim
𝑠→0 𝑠

If 𝒂 is any vector that has the same direction as 𝒖 then 𝐷𝒂 𝑓(𝑥; 𝑦) is referred to as
the directional derivative of 𝑓 in the direction of vector 𝒂.

Theorem 5.1
If 𝑓 is a differentiable function of two variables and 𝒖 = 𝑢1 𝒊 + 𝑢2 𝒋 is a unit vector,
then
𝐷𝒖 𝑓(𝑥; 𝑦) = 𝑓𝑥 (𝑥; 𝑦)𝑢1 + 𝑓𝑦 (𝑥; 𝑦)𝑢2

Example 5.8
Let 𝑓(𝑥; 𝑦) = 𝑥 3 𝑦 2
(a) Determine the directional derivative of 𝑓 at the point 𝑃(−1; 2) in the direction of
the 𝒂 = 4𝒊 − 3𝒋
(b) Discuss the significance of part (a) if 𝑓(𝑥; 𝑦) is the temperature at (𝑥; 𝑦).
Solution
𝟏 𝟏 𝟒 𝟑
(a) 𝒖 = ‖𝒂‖ 𝒂 = 𝟓 (4𝒊 − 3𝒋) = 𝟓 𝒊 − 𝟓 𝒋

Since 𝑓𝑥 (𝑥; 𝑦) = 3𝑥 2 𝑦 2 𝑎𝑛𝑑 𝑓𝑦 (𝑥; 𝑦) = 2𝑥 3 𝑦

then 𝐷𝒖 𝑓(𝑥; 𝑦) = 𝑓𝑥 (𝑥; 𝑦)𝑢1 + 𝑓𝑦 (𝑥; 𝑦)𝑢2


4 3
𝐷𝒖 𝑓(𝑥; 𝑦) = 3𝑥 2 𝑦 2 (5) + 2𝑥 3 𝑦(− 5)
4 3
At 𝑃(−1; 2) , 𝐷𝒖 𝑓(−1; 2) = 3(−1)2 (2)2 (5) + 2(−1)3 . 2 (− 5) = 12

(b) If 𝑓(𝑥; 𝑦) is the temperature at (𝑥; 𝑦) then 𝐷𝒖 𝑓(−1; 2) = 12 means if the point
moves in the direction of 𝒖 , the temperature at P increases at a rare of 120 per unit
change in distance.
𝑓𝑥 (−1; 2) = 12 𝑎𝑛𝑑 𝑓𝑦 (−1; 2) = −4 are the rates of change in the horizontal and
vertical directions respectively.
72

Example 5.9
Let 𝑧 = 𝑓(𝑥; 𝑦) = 14 − 𝑥 2 − 𝑦 2 and let 𝑃 = 𝑃(1; 2). Determine the directional
derivative of 𝑓 𝑎𝑡 𝑃,
(a) towards the point 𝑄 = 𝑄(3; 4),
(b) in the direction of 𝒗 = 2𝒊 − 𝒋 and
(c) towards the origin.

Solution
The surface is plotted in the figure above where the point 𝑃 = 𝑃(1; 2) is indicated on
the 𝑥, 𝑦-plane and the point 𝑷(𝟏; 𝟐; 𝟗) lies on the surface of 𝑓. We find that
𝑓𝑥 (𝑥; 𝑦) = −2𝑥 , 𝑓𝑦 (𝑥; 𝑦) = −2𝑦 and 𝑓𝑥 (1; 2) = −2 , 𝑓𝑦 (𝑥; 𝑦) = −4

(a) Let 𝒖𝟏 be the unit vector that points from the point 𝑃(1; 2) towards 𝑄(3; 4).
⃗⃗⃗⃗⃗⃗ = 2𝒊 + 2𝒋. The unit vector in this direction is 𝒖𝟏 = 𝟏 (𝒊 + 𝒋).
The vector 𝑷𝑸
√𝟐
Thus the directional derivative of 𝑓 at 𝑃(1; 2) in the direction of 𝒖𝟏 is

1 1 6
𝐷𝒖𝟏 𝑓(1; 2) = −2( ) + (−4)( )) = − ≈ −4,2426
√2 √2 √5

(b) We seek a directional derivative in the direction of 𝒗 = 2𝒊 − 𝒋. The unit vector


𝟐
in this direction is 𝒖𝟐 = (𝒊 − 𝒋). So, the directional derivative of 𝑓 at
√𝟓
𝑃(1; 2) in the direction of 𝒖𝟐 is

2 −1
𝐷𝒖𝟐 𝑓(1; 2) = −2( ) + (−4)( )) = 0
√5 √5
𝟐
Starting on the surface of 𝑓 at the point (1; 2) in the direction of 𝒖𝟐 = (𝒊 − 𝒋)
√𝟓
results in no instantaneous change in 𝑧-values.
(c) At 𝑃 = 𝑃(1; 2), the direction towards the origin is given by the vector
73

𝟏
⃗⃗⃗⃗⃗⃗ = 𝒘 = −𝒊 − 2𝒋. The unit vector in this direction is 𝒖𝟑 =
𝑷𝑶 (−𝒊 − 𝟐𝒋)
√𝟓

Therefore the directional derivative of 𝑓 𝑎𝑡 𝑃 in this direction is


−1 −2 10
𝐷𝒖𝟑 𝑓(1; 2) = −2( ) + (−4)( )) = ≈ 4,4721
√2 √2 √5

Moving towards the origin means moving upwards(ascending) steeply at a slope


of ≈ 4,47
We may use theorem 5.1 to express a directional derivative as a dot product of two
vectors

𝐷𝒖 𝑓(𝑥; 𝑦) = [𝑓𝑥 (𝑥; 𝑦)𝒊 + 𝑓𝑦 (𝑥; 𝑦)𝒋].[𝑢1 𝒊 + 𝑢2 𝒋 ]

where [𝑓𝑥 (𝑥; 𝑦)𝒊 + 𝑓𝑦 (𝑥; 𝑦)𝒋] is denoted as 𝛁𝑓(𝑥; 𝑦)

Definition 5.4
Let 𝑓 be a function of two variables. The gradient of 𝑓 is the vector
𝛁𝑓(𝑥; 𝑦) = 𝑓𝑥 (𝑥; 𝑦)𝒊 + 𝑓𝑦 (𝑥; 𝑦)𝒋

The directional derivative gradient form is then


𝐷𝒖 𝑓(𝑥; 𝑦) = 𝛁𝑓(𝑥; 𝑦). 𝒖

Example 5.10
1
Determine the directional derivative of 𝑓(𝑥; 𝑦) = 4 − 𝑥 2 − 4 𝑦 2 at (1; 2) in the
𝜋 𝜋
direction of 𝒖 = (𝑐𝑜𝑠 3 ) 𝒊 + (𝑠𝑖𝑛 3 ) 𝒋

Solution
𝐷𝒖 𝑓(𝑥; 𝑦) = 𝛁𝑓(𝑥; 𝑦). 𝒖
= [𝑓𝑥 (𝑥; 𝑦)𝒊 + 𝑓𝑦 (𝑥; 𝑦)𝒋]. 𝒖
𝟏 𝜋 𝜋
= [−2𝑥𝒊 − 𝑦𝒋]. (𝑐𝑜𝑠 ) 𝒊 + (𝑠𝑖𝑛 ) 𝒋
𝟐 3 3
𝜋 𝑦 𝜋
= (−2𝑥)𝑐𝑜𝑠 3 + (− 2)𝑠𝑖𝑛 3

1 2 √3
Then 𝐷𝒖 𝑓(1; 2) = (−2 × 1) (2) + (− 2) ( 2 ) = −1,8660
74

Example 5.11
𝜋 𝜋
Let 𝑓(𝑥; ) = 𝑠𝑖𝑛𝑥𝑐𝑜𝑠𝑦 and let 𝑃 = 𝑃 ( 3 ; 3 ). Determine the direction of
maximal/minimal increase.
Solution
We have 𝑓𝑥 = 𝑐𝑜𝑠𝑥𝑐𝑜𝑠𝑦 , 𝑓𝑥 = −𝑠𝑖𝑛𝑥𝑠𝑖𝑛𝑦
𝜋 𝜋 1
𝛁𝑓 = (𝑐𝑜𝑠𝑥𝑐𝑜𝑠𝑦)𝒊 − (𝑠𝑖𝑛𝑥𝑠𝑖𝑛𝑦)𝒋 , and at 𝑃, 𝛁𝑓 ( 3 ; 3 ) = 4 (𝒊 − 3𝒋)
1
Thus the direction of maximal increase is (𝒊 − 3𝒋) and the instantaneous rate of
4
𝜋 𝜋 1 1 2 3 2 √10
increase is ‖𝛁𝑓 ( ; )‖ = ‖ (𝒊 − 3𝒋)‖ = √( ) + ( ) = ≈ 0,7906
3 3 4 4 4 4

Example 5.12
𝜋
Determine the gradient of the function ℎ(𝑥; 𝑦) = 𝑥𝑡𝑎𝑛𝑦 at the point 𝑄(2; 4 ) and then
𝜋
compute the maximum value of the directional derivative at this point 𝑄 (2; 4 ).

Solution
𝜵ℎ(𝑥; 𝑦) = ℎ𝑥 𝒊 + ℎ𝑦 𝒋 = 𝑡𝑎𝑛𝑦𝒊 + 𝑥𝑠𝑒𝑐 2 𝑦𝒋
𝜋 𝜋 𝜋
𝜵ℎ (2; ) = tan ( )𝒊 + 2𝑠𝑒𝑐 2 ( )𝒋
4 4 4

= 𝒊 + 4𝒋
𝜋
‖ 𝜵ℎ (2; 4 )‖ = ‖𝒊 + 4𝒋‖ = √(1)2 + (4)2 ≈ 4,1231

Activity 5.3
1. Determine the directional derivative of 𝑓(𝑥 ; 𝑦) at the indicated point 𝑃 in the
indicated direction
(𝑎) 𝑓(𝑥; 𝑦) = 𝑥 2 + 5𝑥𝑦 + 3𝑦 2 , 𝑃(3 ; −1) , 𝒂 = 2𝒊 + 𝒋
𝑦
(𝑏) 𝑓(𝑥; 𝑦) = 𝑡𝑎𝑛−1 , 𝑃(4 ; −4) , 𝒂 = 2𝒊 − 3𝒋
𝑥

(𝑐) 𝑓(𝑥; 𝑦) = 𝑥𝑒 3𝑦 , 𝑃(4 ; 0) , 𝒂 = −𝒊 + 3𝒋


𝜋
(𝑑) 𝑓(𝑥; 𝑦) = 𝑥𝑐𝑜𝑠 2 𝑦 , 𝑃 (2 ; ) , 𝒂 = 5𝒊 + 𝒋
4
75

𝜋 𝜋
2. Let 𝑇(𝑥 ; 𝑦) = sin(2𝑥 − 𝑦) , 𝑃 (− 3 ; 6 ) 𝑎𝑛𝑑 𝑄(0 ; 0)

(𝑎) Determine the directional derivative of 𝑇 at 𝑃 in the direction from 𝑃 𝑡𝑜 𝑄.


(𝑏) Determine a unit vector in the direction in which 𝑇 increases most rapidly at 𝑃.
(𝑐) Find the unit vector in the direction in which 𝑇 decreases most rapidly at 𝑃, and
determine the rate of change of 𝑇 in this direction.
3. The temperature in degrees Celsius on the surface of a metal plate is
𝑇(𝑥; 𝑦) = 20 − 4𝑥 2 − 𝑦 2
where 𝑥 𝑎𝑛𝑑 𝑦 are measured in centimeters. In what direction from (2; −3)
does the temperature increase most rapidly? What is the rate of increase?
4. Determine the gradient of the function and the maximum value of the directional
derivative at the given point.
𝑝(𝑥; 𝑦) = 𝑦𝑒 −𝑥 , 𝑃(0; 5)

5.4 Second order Partial Differential Equations (PDE’s)


The general form of a linear second order partial differential equation (PDE) in two
variables 𝑥 and 𝑦 is given by
𝜕2𝑢 𝜕2𝑢 𝜕2𝑢 𝜕𝑢 𝜕𝑢
𝐴 𝜕𝑥 2 + 𝐵 𝜕𝑥𝜕𝑦 + 𝐶 𝜕𝑦 2 + 𝐷 𝜕𝑥 + 𝐸 𝜕𝑦 + 𝐹𝑢 = 𝐺

where 𝐴 , 𝐵, 𝐶, 𝐷, 𝐸, 𝐹 𝑎𝑛𝑑 𝐺 are functions of 𝑥 and 𝑦. When 𝐺(𝑥; 𝑦) = 0, the


equation is said to be homogeneous, otherwise, it is nonhomogeneous.

Example 5.10
𝜕2𝑢 𝜕2𝑢
1. 𝜕𝑥 2 + 3 𝜕𝑦 2 − 2𝑢 = 0 is homogeneous

𝜕2𝑢 𝜕2𝑢
2. 𝜕𝑥 2 − 𝜕𝑦 2 = −3𝑥 2 is nonhomogeneous

A solution of a partial differential equation in two variables 𝑥 and 𝑦 is a function


𝑢(𝑥; 𝑦) that has all partial derivatives occurring in the equation and satisfies the
equation in some region of the 𝑥𝑦-plane.
The solution we seek is in the form of a product 𝑢(𝑥; 𝑦) = 𝑋(𝑥)𝑌(𝑦). The method
that will be used in this section to obtain the solution is the separation of variables.
The separation of variables method reduces the linear partial differential equation
into two ordinary differential equation.
76

𝜕𝑢 𝜕𝑢 𝜕2𝑢 𝜕2𝑢
Note that: = 𝑋′𝑌 , = 𝑋𝑌 ′ 𝑎𝑛𝑑 = 𝑋 ′′ 𝑌 , = 𝑋𝑌 ′′
𝜕𝑥 𝜕𝑦 𝜕𝑥 2 𝜕𝑦 2

Example 5.11
Find the product solution of the partial differential equation
𝜕2𝑢 𝜕𝑢
. 𝜕𝑥 2 = 4 𝜕𝑦

Solution
Since we need the product 𝑢(𝑥; 𝑦) = 𝑋(𝑥)𝑌(𝑦) the given equation becomes
𝑋′′𝑌 = 4𝑋𝑌 ′ (1)
Dividing both sides of the equating by 4𝑋𝑌 to separate the variables we get
𝑋 ′′ 𝑌′
=
4𝑋 𝑌

Both sides of equation (1) are independent of 𝑥 and 𝑦 so each side of the equation
must be a constant. For convenience we choose the constant as 𝜆2 𝑜𝑟 − 𝜆2 .
Case I: If 𝜆2 > 0 then
𝑋 ′′ 𝑌′
= = 𝜆2
4𝑋 𝑌

This leads to 𝑋 ′′ − 4𝜆2 𝑋 = 0 𝑎𝑛𝑑 𝑌 ′ − 4𝜆2 𝑌 = 0


The equations have the solution
2𝑦
𝑋 = 𝐶1 𝑐𝑜𝑠ℎ2𝜆𝑥 + 𝐶2 𝑠𝑖𝑛ℎ2𝜆𝑥 𝑎𝑛𝑑 𝑌 = 𝐶3 𝑒 𝜆
respectively.
Case II: If 𝜆2 < 0 then
𝑋 ′′ 𝑌′
= = −𝜆2
4𝑋 𝑌

This leads to 𝑋 ′′ + 4𝜆2 𝑋 = 0 𝑎𝑛𝑑 𝑌 ′ + 4𝜆2 𝑌 = 0


The equations have the solution
2𝑦
𝑋 = 𝐶4 𝑐𝑜𝑠ℎ2𝜆𝑥 + 𝐶5 𝑠𝑖𝑛ℎ2𝜆𝑥 𝑎𝑛𝑑 𝑌 = 𝐶6 𝑒 −𝜆
respectively.
Thus, a particular solution to the partial differential equation is
𝑢 = 𝑋𝑌
2𝑦
= (𝐶4 𝑐𝑜𝑠ℎ2𝜆𝑥 + 𝐶5 𝑠𝑖𝑛ℎ2𝜆𝑥)𝐶6 𝑒 −𝜆
2 2
= 𝐴2 𝑒 𝜆 𝑦 𝑐𝑜𝑠ℎ2𝜆𝑥 + 𝐵2 𝑒 𝜆 𝑦 𝑠𝑖𝑛ℎ2𝜆𝑥
where 𝐴2 = 𝐶4 𝐶6 𝑎𝑛𝑑 𝐵2 = 𝐶5 𝐶6
77

Case III: If 𝜆2 = 0 then


𝑋 ′′ 𝑌′
= =0
4𝑋 𝑌

This leads to 𝑋 ′′ = 0 𝑎𝑛𝑑 𝑌 ′ = 0


The equations have the solution
𝑋 = 𝐶7 𝑥 + 𝐶8 𝑎𝑛𝑑 𝑌 = 𝐶9
Thus 𝑢 = (𝐶7 𝑥 + 𝐶8 )𝐶9
= 𝐴3 𝑥 + 𝐵3
where 𝐴3 = 𝐶7 𝐶9 𝑎𝑛𝑑 𝐵3 = 𝐶8 𝐶9

5.5 Classification of second order partial differential equations


The linear second order partial differential equation
𝜕2𝑢 𝜕2𝑢 𝜕2 𝑢 𝜕𝑢 𝜕𝑢
𝐴 𝜕𝑥 2 + 𝐵 𝜕𝑥𝜕𝑦 + 𝐶 𝜕𝑦 2 + 𝐷 𝜕𝑥 + 𝐸 𝜕𝑦 + 𝐹𝑢 = 0

where 𝐴 , 𝐵, 𝐶, 𝐷, 𝐸 𝑎𝑛𝑑 𝐹 are real constants. Classification of the DE is as follows:


1. Hyperbolic if 𝐵 2 − 4𝐴𝐶 > 0
2. Parabolic if 𝐵 2 − 4𝐴𝐶 = 0
3. Elliptic if 𝐵 2 − 4𝐴𝐶 < 0

Example 5.12
Classify the following partial differential equations
𝜕2𝑢 𝜕𝑢 𝜕2𝑢 𝜕2𝑢 𝜕2𝑢 𝜕2𝑢
1. 3 𝜕𝑥 2 = 𝜕𝑦 2. = 𝜕𝑦 2 3. + 4 𝜕𝑦 2 = 0
𝜕𝑥 2 𝜕𝑥 2

Solution
𝜕2𝑢 𝜕𝑢
1. Writing 3 𝜕𝑥 2 − 𝜕𝑦 = 0, we identify 𝐴 = 3 , 𝐵 = 0 𝑎𝑛𝑑 𝐶 = 0

𝐵 2 − 4𝐴𝐶 = 0 ⇒ equation is parabolic


𝜕2𝑢 𝜕2𝑢
2. Writing − 𝜕𝑦 2 = 0, we identify 𝐴 = 1 , 𝐵 = 0 𝑎𝑛𝑑 𝐶 = −1
𝜕𝑥 2

𝐵 2 − 4𝐴𝐶 = −4(1)(−1) > 0 ⇒ equation is hyperbolic


3. Test your knowledge
78

Activity 5.4
1. Use the separation of variables to determine the product solution of the following
𝜕𝑢 𝜕𝑢
(a) = 𝜕𝑦
𝜕𝑥

𝜕𝑢 𝜕𝑢
(b) + 3 𝜕𝑦 = 0
𝜕𝑥

𝜕2𝑢 𝜕2𝑢
(𝑐) = 𝜕𝑦 2
𝜕𝑥 2

5.6 Applications of second Order Partial Derivatives


5.6.1 The Heat Equation
We start by principally looking at a thin rod or wire of length 𝐿. The ends of the rod or
wire are 𝑥 = 0 and 𝑥 = 𝐿. Assume that the temperature is constant at every point 𝑥
in the cross-section of the conductor.
The diagram below illustrates the concept of heat flow and the corresponding partial
differential equation model with accompanying conditions
𝑢(𝑥; 𝑡)

Insulated conductor

𝑥=0 𝑥=𝐿

The one-dimensional partial differential equation representing the system is

𝜕2𝑢 𝜕𝑢
𝑘 𝜕𝑥 2 = , 𝑘 > 0 ,0 < 𝑥 < 𝐿
𝜕𝑡

𝑢(0; 𝑡) = 0 , (𝐿; 𝑡) = 0, 𝑡 > 0


𝑢(𝑥, 0) = 𝑓(𝑥) , 0 < 𝑥 < 𝐿

The function 𝑢(𝑥; 𝑡) denotes the temperature at point 𝑥. The insulated ends are
represented by the boundary conditions (BC’s)
𝑢(0; 𝑡) = 0 , (𝐿; 𝑡) = 0, 𝑡 > 0
The initial condition (IC) is given by 𝑢(𝑥; 0) = 𝑓(𝑥). We assume that at time 𝑡 = 0 the
temperature is known, for example, to be some function 𝑓(𝑥). Using separation of
variables results into the solution of the equation of the form 𝑢(𝑥; 𝑡) = 𝑋(𝑥)𝑇(𝑡).
79

Example 5.13
Suppose a thin wire of length 𝐿 = 4 has initial temperature 𝑓(𝑥) = 𝑥 and the ends
are at temperature zero for all time 𝑡 = 0. If the system is modelled by the equation
𝜕2 𝑢 𝜕𝑢
2 𝜕𝑥 2 = , 𝑡 > 0 ,0 < 𝑥 < 4
𝜕𝑡

𝑢(0; 𝑡) = 0 , (4; 𝑡) = 0, 𝑡 > 0


𝑢(𝑥, 0) = 𝑥 , 0 < 𝑥 < 4
Determine the solution 𝑢(𝑥, 𝑡) of the equation at any given time 𝑡.
Solution:
𝑋″(𝑥) 𝑇ʹ(𝑡)
Using the separation of variables, we get = 2𝑇(𝑡)
𝑋(𝑥)

The equation is expected to hold for all 𝑥 and all 𝑡. We observe that the left-hand
side is independent of 𝑡 and the right-hand side is independent of 𝑥. As aresult each
side must be a constant. For convenience, we let the constant to be −𝜆2 . We call this
the separation constant. We choose −𝜆2 𝑏𝑒𝑐𝑎𝑢𝑠𝑒 𝜆2 = 0 or 𝜆2 > 0 will give us a
trivial solution. (Check)
We can now setup equations (1) and (2) as follows:
𝑋″
= −𝜆2 (1)
𝑋

𝑋 ″ = −𝜆2 𝑋
⇒ 𝑋 ″ + 𝜆2 𝑋 = 0
⇒ 𝑋̅(𝑚2 + 𝜆2 ) = 0
The characteristic equation is
𝑚2 + 𝜆2 = 0 ⇒ 𝑚 = ±√−𝜆2
⇒ 𝑚 = ±𝜆𝑗
∴ 𝑋𝐶𝐹 = 𝐴𝑐𝑜𝑠𝜆𝑥 + 𝐵𝑠𝑖𝑛𝜆𝑥
𝑇ʹ
= −2𝜆2 (2)
𝑇

𝑇 ʹ = −2𝜆2 𝑇
⇒ 𝑇 ʹ + 2𝜆2 𝑇 = 0
⇒ 𝑇̅(𝑚 + 2𝜆2 ) = 0
The characteristic equation is
𝑚 + 2𝜆2 = 0 ⇒ 𝑚 = −2𝜆2
2
∴ 𝑇𝐶𝐹 = 𝐶𝑒 −2𝜆
2𝑡
𝑢(𝑥; 𝑡) = (𝐴𝑐𝑜𝑠𝜆𝑥 + 𝐵𝑠𝑖𝑛𝜆𝑥)𝐶𝑒 −2𝜆
𝑢(0; 𝑡) = 0 ⇒ 𝐴 = 0
80

𝑢(4; 0) = 0 ⇒ (𝐵𝑠𝑖𝑛4𝜆) = 0 where 4𝜆 = 𝑛𝜋, 𝑛 = 1 , 2 , 3 , …


𝑛𝜋
∴ 𝜆𝑛 = , 𝑛 = 1 , 2 , 3, … (eigenvalues)
4
𝑛𝜋𝑥
𝑢(𝑥; 0) = 𝑓(𝑥) = 𝑥 = ∑∞
𝑛=1 𝐵𝑛 𝑠𝑖𝑛 (eigenfunctions)
4

The step above is associated with a Fourier sine series, hence


2 𝐿=4 𝑛𝜋𝑥 1 4𝑥 𝑛𝜋𝑥 16 𝑛𝜋𝑥 4
𝐵𝑛 = 𝑏𝑛 = 𝐿=4 ∫0 𝑥𝑠𝑖𝑛 𝑑𝑥 = 2 [− 𝑛𝜋 𝑐𝑜𝑠 + 𝑛2𝜋2 𝑠𝑖𝑛 ]
𝑥 4𝑥 4 0
8
= − 𝑛𝜋 [𝑐𝑜𝑠𝑛𝜋]
8 1 , 𝑛 𝑜𝑑𝑑
= − 𝑛𝜋 {
−1 , 𝑒𝑣𝑒𝑛
𝑛𝜋 2
8 𝑛𝜋𝑥 𝑛𝜋𝑥
) 𝑒 −2( 4 ) 𝑡
∴ 𝑢(𝑥; 𝑡) = − 𝜋 (∑∞
𝑛=1 𝑠𝑖𝑛 − ∑∞
𝑛=1 𝑠𝑖𝑛
4 4

Activity 5.5
1. Solve the following heat transfer equations
𝜕2𝑢 𝜕𝑢
(a) = ; 0<𝑥<𝜋 , 𝑡>0
𝜕𝑥 2 𝜕𝑡
subject to
𝑢(𝑥; 𝑡) = 0 , 𝑢(𝜋; 𝑡) = 0 , 𝑡 > 0
𝑢(𝑥; 0) = 100 , 0 < 𝑥 < 𝜋

𝜕2𝑢 𝜕𝑢
(b) = ; 0<𝑥<2 , 𝑡>0
𝜕𝑥 2 𝜕𝑡
subject to
𝑢(𝑥; 𝑡) = 0 , 𝑢(2; 𝑡) = 0 , 𝑡 > 0
𝑢(𝑥; 0) = 2 − 𝑥 , 0 < 𝑥 < 2

𝜕2𝑢 1 𝜕𝑢
(c) = 16 𝜕𝑡 ; 0 < 𝑥 < 2 , 𝑡 > 0
𝜕𝑥 2
subject to
𝑢(𝑥; 𝑡) = 0 , 𝑢(2; 𝑡) = 0 , 𝑡 > 0
𝑢(𝑥; 0) = 2 − 𝑥 , 0 < 𝑥 < 2
81

5.6.2 The wave equation


Consider a string of length 𝐿 as depicted in the figure below. The string is stretched
taut between two points 𝑥 = 0 and 𝑥 = 𝐿 on the x- axis.
𝑢 𝑢(𝑥; 𝑡)

0 𝐿=2 𝑥
𝑢(0; 𝑡) = 0 𝑥(𝐿; 𝑡) = 0
When the string is pulled up and starts to vibrate, the vertical displacement at any
point is represented by 𝑢(𝑥; 𝑡) and is modelled by the following differential equation
𝜕2𝑢 𝜕2 𝑢
𝛼 2 𝜕𝑥 2 = , 𝑡 > 0 , 0 < 𝑥 < 𝐿, 𝑡 > 0
𝜕𝑡 2

𝑢(0; 𝑡) = 0 , 𝑢(𝐿; 𝑡) = 0, 0 < 𝑥 < 𝐿, 𝑡 > 0


𝜕𝑢
𝑢(𝑥, 0) = 𝑓(𝑥) , =0 , 0<𝑥<𝐿
𝜕𝑡 𝑡=0

𝑖𝑛𝑖𝑡𝑖𝑎𝑙 𝑣𝑒𝑙𝑜𝑐𝑖𝑡𝑦

Example 5.9
Determine the vertical displacement 𝑢(𝑥; 𝑡) of a string of length 𝐿 = 5 attached at
the ends 𝑥 = 0 𝑎𝑛𝑑 𝑥 = 𝐿 = 5 and characterised by the differential equation
𝜕2 𝑢 𝜕2𝑢
9 𝜕𝑥 2 = , 𝑡 > 0 ,0 < 𝑥 < 5 ,𝑡 > 0
𝜕𝑡 2

𝑢(0; 𝑡) = 0 , 𝑢(5; 𝑡) = 0, 0 < 𝑥 < 5, 𝑡 > 0


𝜕𝑢
𝑢(𝑥, 0) = 4s (𝜋𝑥) , =0 , 0<𝑥<5
𝜕𝑡 𝑡=0

Solution:
Separating the variables, we have
𝑋 ″ (𝑥) 𝑇 ″ (𝑡)
= = −𝜆2
𝑋(𝑥) 9𝑇(𝑡)

⇒ 𝑋 ″ (𝑥) = −𝜆2 𝑋(𝑥) and 𝑇 ″ (𝑡) = −9𝜆2 𝑇(𝑡)


⇒ 𝑚2 = −𝜆2 ⇒ 𝑚 = ±𝜆𝑗
and 𝑠 2 = −9𝜆2 ⇒ 𝑠 = ±3𝜆𝑗
Complementary solutions are,
𝑋(𝑥) = 𝐴𝑐𝑜𝑠𝜆𝑥 + 𝐵𝑠𝑖𝑛𝜆𝑥
and 𝑇(𝑡) = 𝐶𝑐𝑜𝑠3𝜆𝑡 + 𝐷𝑠𝑖𝑛𝜆𝑡
∴ 𝑢(𝑥; 𝑡) = (𝐴𝑐𝑜𝑠𝜆𝑥 + 𝐵𝑠𝑖𝑛𝜆𝑥)(𝐶𝑐𝑜𝑠3𝜆𝑡 + 𝐷𝑠𝑖𝑛𝜆𝑡 )
82

Application of boundary conditions gives


𝑢(0; 𝑡) = 0 ⇒ 𝐴 = 0
𝑢(5; 𝑡) = 0 ⇒ 𝐵𝑠𝑖𝑛𝜆𝑥 = 0 ⇒ 𝑠𝑖𝑛𝜆𝑥 = 0
𝑛𝜋
∴ 𝜆𝑛 = , 𝑛 = 1 ,2 , 3 , …
5

⇒ 𝑢(𝑥; 𝑡) = (𝐵𝑛 𝑠𝑖𝑛𝜆𝑛 𝑥)(𝐶𝑛 𝑐𝑜𝑠3𝜆𝑛 𝑡 + 𝐷𝑛 𝑠𝑖𝑛3𝜆𝑛 𝑡) , 𝑛 = 1 , 2 , 3 , …


= (𝐸𝑛 𝑐𝑜𝑠3𝜆𝑛 𝑡 + 𝐹𝑛 𝑠𝑖𝑛𝜆𝑛 𝑡)𝑠𝑖𝑛𝜆𝑛 𝑥
where 𝐸𝑛 = 𝐵𝑛 𝐶𝑛 and 𝐹𝑛 = 𝐵𝑛 𝐷𝑛
Applying the initial condition
𝑛𝜋𝑥
𝑢(𝑥; 0) = 4 cos(𝜋𝑥) = ∑∞
𝑛=1 𝐸𝑛 𝑠𝑖𝑛 5
2 5 𝑛𝜋𝑥
⇒𝐸𝑛 = 5 ∫0 4 cos(𝜋𝑥) . 𝑠𝑖𝑛 ( ) 𝑑𝑥
5

Using trigonometric identities to integrate we have


4 5 𝜋(5−𝑛) 4 5 𝜋(5+𝑛)
𝐸𝑛 = 5 ∫0 𝑠𝑖𝑛 𝑥𝑑𝑥 + 5 ∫0 𝑠𝑖𝑛 𝑥𝑑𝑥
5 5

4 −5 𝜋(5−𝑛) 5 4 −5 𝜋(5+𝑛) 5
= 5 [𝜋(5−𝑛) 𝑐𝑜𝑠 ( )] + 5 [𝜋(5+𝑛) 𝑐𝑜𝑠 ( )]
5 0 5 0
4 −5 5 4 −5 5
= 5 [𝜋(5−𝑛) cos(5 − 𝑛) + 𝜋(5−𝑛)] + 5 [𝜋(5+𝑛) cos(5 + 𝑛) + 𝜋(5+𝑛)]

0 , 𝑓𝑜𝑟 𝑛 𝑜𝑑𝑑
∴ 𝐸𝑛 = { 8 8
+ 𝜋(5+𝑛) , 𝑓𝑜𝑟 𝑛 𝑒𝑣𝑒𝑛
𝜋(5−𝑛)

𝑢𝑡 (𝑥; 𝑡) = (−3𝜆𝑛 𝐸𝑛 𝑠𝑖𝑛3𝜆𝑛 𝑡 + 𝐹𝑛 𝜆𝑛 𝑐𝑜𝑠𝜆𝑛 𝑡)𝑠𝑖𝑛𝜆𝑛 𝑥


𝐹𝑛 = ∑ 𝑐𝑜𝑠𝜆𝑛 𝑡. 𝑠𝑖𝑛𝜆𝑛 𝑥
2 5 𝑛𝜋𝑥
𝑢𝑡 (𝑥; 0) = 0 ⇒ 𝐹𝑛 = 5 ∫0 (0)(1). 𝑠𝑖𝑛 ( ) 𝑑𝑥 = 0
5
80 1 𝑛𝜋𝑥
Hence 𝑢(𝑥; 𝑡) = { 𝜋 ∑∞
𝑛=2,4,… (25−𝑛2 ) [𝑐𝑜𝑠3𝜆𝑛 𝑥]}𝑠𝑖𝑛 5

Activity 5.6

1. Determine the displacement 𝑢(𝑥; 𝑡) of systems modelled by the following


differential equations
𝜕2𝑢 𝜕2𝑢
(a) = ; 0<𝑥<𝜋 , 𝑡>0
𝜕𝑥 2 𝜕𝑡 2

subject to
𝑢(𝑥; 𝑡) = 0 , 𝑢(𝜋; 𝑡) = 0 , 𝑡 > 0
𝜕𝑢
𝑢(𝑥; 0) = 0 , = 𝑠𝑖𝑛𝑥
𝜕𝑡 𝑡=0
83

𝜕2𝑢 𝜕2 𝑢
(b) = ; 0<𝑥<1 , 𝑡>0
𝜕𝑥 2 𝜕𝑡 2

subject to
𝑢(𝑥; 𝑡) = 0 , 𝑢(1; 𝑡) = 0 , 𝑡 > 0
𝜕𝑢
𝑢(𝑥; 0) = 𝑠𝑖𝑛𝑥 , =0
𝜕𝑡 𝑡=0

5.6.3 The Laplace equation


Laplace’s equation is a second order partial differential equation. This equation is
named after Pierre-Simon Laplace, who was the first to study its properties.
The general form of the equation is
𝜕2𝑢 𝜕2𝑢
∇2 𝑢 = + 𝜕𝑦 2 = 0
𝜕𝑥 2

Example 5.14
Suppose we want to determine the steady-state temperature 𝑢(𝑥; 𝑦) in a rectangular
plate with insulated boundaries as in the figure shown below. When no heat escapes
from the lateral faces of the plate.
𝑦

𝑢 = 𝑓(𝑥)

(𝑎; 𝑏)

𝐼𝑛𝑠𝑢𝑙𝑎𝑡𝑒𝑑 𝑖𝑛𝑠𝑢𝑙𝑎𝑡𝑒𝑑

𝑢=0 𝑥

The equation describing the system is


𝜕2 𝑢 𝜕2𝑢
+ =0 , 0<𝑥<𝑎 , 0<𝑦<𝑏
𝜕𝑥 2 𝜕𝑦 2

Subject to
𝑢𝑥 (0; 𝑦) = 0 , 𝑢𝑥 (𝑎; 𝑦) = 0 , 0 < 𝑦 < 𝑏
𝑢𝑥 (𝑥; 0) = 0 , 𝑢𝑥 (𝑥; 𝑏) = 0 , 0 < 𝑥 < 𝑎
84

Solution
Separation of variables leads to
𝑋 ″ (𝑥)
= −𝜆2
𝑋(𝑥)

𝑋 ′′ + 𝜆2 𝑋 = 0 (1)
𝑌 ″ (𝑥)
− = −𝜆2
𝑌(𝑥)

𝑌 ′ − 𝜆2 𝑌 = 0 (2)
From equation (1) 𝑚2 = −𝜆2 ⇒ 𝑚 = ±𝜆𝑗
∴ 𝑋𝐶𝐹 = 𝐶1 𝑐𝑜𝑠𝜆𝑥 + 𝐶2 𝑠𝑖𝑛𝜆𝑥 (3)
Since 0 < 𝑦 < 𝑏 is a finite interval from equation (2) we can write the solution as
𝑌𝐶𝐹 = 𝐶3 𝑐𝑜𝑠ℎ𝜆𝑦 + 𝐶4 𝑠𝑖𝑛ℎ𝜆𝑦 (4)
The first three boundary conditions translate into 𝑋 ′ (0) = 0, 𝑋 ′ (𝑎) = 0, 𝑌(0) = 0.
Differentiating 𝑋 and setting 𝑥 = 0 ⇒ 𝐶2 = 0 ⇒ 𝑋 = 𝐶1 𝑐𝑜𝑠𝜆𝑥.
Differentiating 𝑋 = 𝐶1 𝑐𝑜𝑠𝜆𝑥 gives 𝑋 ′ = −𝐶1 𝜆𝑠𝑖𝑛𝜆𝑥.
Setting 𝑥 = 𝑎 in 𝑋 ′ = −𝐶1 𝜆𝑠𝑖𝑛𝜆𝑥 ⇒ −𝐶1 𝜆𝑠𝑖𝑛𝜆𝑎 = 0. This last condition is satisfied
𝑛𝜋
when 𝜆 = 0 𝑜𝑟 𝑤ℎ𝑒𝑛 𝜆𝑎 = 𝑛𝜋 𝑜𝑟 𝜆 = 𝑎 , 𝑛 = 1, 2, …

Note that 𝜆 = 0 in (1) ⇒ 𝑋 ′′ = 0 and the general solution of this equation is given by
𝑋 = 𝐶1 + 𝐶2 𝑥 and not by equation (3) hence 𝜆 = 0 is an eigenvalue.
Corresponding to 𝜆 = 0 𝑤𝑖𝑡ℎ 𝑛 = 0 we get the eigenfunctions
𝑛𝜋𝑥
𝑋 = 𝐶1 , 𝑛 = 0 𝑎𝑛𝑑 𝑋 = 𝐶1 𝑐𝑜𝑠 , 𝑛 = 1, 2, …
𝑎

Condition 𝑌(0) = 0 dictates that 𝐶3 = 0 in equation when 𝜆 > 0. However if 𝜆 = 0


equation (2) leads to 𝑌 ′′ = 0 and gives rise to the solution 𝑌 = 𝐶4 𝑦.
Resulting product solutions satisfying the three conditions are
𝑛𝜋𝑦 𝑛𝜋𝑥
𝐴0 𝑦, 𝑛 = 0 𝑎𝑛𝑑 𝐴𝑛 𝑠𝑖𝑛ℎ . 𝑐𝑜𝑠
𝑎 𝑎

The superposition principle yields


𝑛𝜋𝑦 𝑛𝜋𝑥
𝑢(𝑥; 𝑦) = 𝐴0 𝑦 + ∑∞
𝑛=1 𝐴𝑛 𝑠𝑖𝑛ℎ . 𝑐𝑜𝑠 (5)
𝑎 𝑎

Substituting 𝑦 = 𝑏 into equations (5) we get


𝑛𝜋𝑏 𝑛𝜋𝑥
𝑢(𝑥; 𝑏) = 𝑓(𝑥) = 𝐴0 𝑏 + ∑∞
𝑛=1(𝐴𝑛 𝑠𝑖𝑛ℎ ) 𝑐𝑜𝑠
𝑎 𝑎

The above expression is a half-range even series expansion.


85

𝑎0 𝑛𝜋𝑏
If we let 𝐴0 𝑏 = and 𝐴𝑛 𝑠𝑖𝑛ℎ ( ) = 𝑎𝑛 , 𝑛 = 1, 2, … it follows that
2 𝑎
2 𝑎
2𝐴0 𝑏 = 𝑎 ∫0 𝑓(𝑥)𝑑𝑥
𝟐 𝒂
𝑨𝟎 = 𝒂𝒃 ∫𝟎 𝒇(𝒙)𝒅𝒙 (6)
𝑛𝜋𝑏 2 𝑎 𝑛𝜋𝑥
𝐴𝑛 𝑠𝑖𝑛ℎ = 𝑎 ∫0 𝑓(𝑥)𝑐𝑜𝑠 𝑑𝑥
𝑎 𝑎
𝟐 𝒂 𝒏𝝅𝒙
𝑨𝒏 = 𝒏𝝅𝒃 ∫𝟎 𝒇(𝒙)𝒄𝒐𝒔 𝒅𝒙 (7)
𝑨𝒏 𝒔𝒊𝒏𝒉 𝒂
𝒂
The solution of the differential equation is then given by the series in equation (5)
where 𝐴0 𝑎𝑛𝑑 𝐴𝑛 are as in equation (6) and (7).

Example 5.15
Determine the solution of the following Laplace equation
𝜕2𝑢 𝜕2 𝑢
+ 𝜕𝑦 2 = 0
𝜕𝑥 2

𝑢(0; 𝑦) = 0 , 𝑢(5; 𝑦) = 0 , 0 ≤ 𝑦 ≤ 5
𝑢(𝑥; 5) = 0 , 0 ≤ 𝑥 ≤ 5
𝑢(𝑥; 0) = 𝑓(𝑥) = 5 , 0 ≤ 𝑥 ≤ 5
Solution:
After separating the variables we get
𝑋 ″ (𝑥)
= −𝜆2 (1)
𝑋(𝑥)

𝑌 ″ (𝑥)
− = −𝜆2 (2)
𝑌(𝑥)

From (1) 𝑚2 = −𝜆2 ⇒ 𝑚 = ±𝜆𝑗 ∴ 𝑋𝐶𝐹 = 𝐴𝑐𝑜𝑠𝜆𝑥 + 𝐵𝑠𝑖𝑛𝜆𝑥

From (2) 𝑚2 = 𝜆2 ⇒ 𝑚 = ±𝜆 ∴ 𝑌𝐶𝐹 = 𝐶𝑒 𝜆𝑦 + 𝐷𝑒 −𝜆𝑦

𝑢(𝑥; 𝑦) = (𝐴𝑐𝑜𝑠𝜆𝑥 + 𝐵𝑠𝑖𝑛𝜆𝑥)(𝐶𝑒 𝜆𝑦 + 𝐷𝑒 −𝜆𝑦 )

𝑢(0; 𝑦) = 0 ⇒ 𝐴 = 0 , 𝑢(5; 𝑦) = 0 ⇒ (𝐵𝑠𝑖𝑛5𝜆)(𝐶𝑒 𝜆𝑦 + 𝐷𝑒 −𝜆𝑦 ) = 0


𝑛𝜋
⇒ 𝐵𝑠𝑖𝑛5𝜆 = 0 ⇒ 𝜆𝑛 = ,𝑛 = 1 ,2 ,3 ,…
5
𝑛𝜋 𝑛𝜋
𝑛𝜋𝑥
Part of the solution is 𝑢(𝑥; 𝑦) = ∑∞
𝑛=1 𝐵𝑛 𝑠𝑖𝑛 (𝐶𝑒 5 𝑦 + 𝐷𝑒 − 5 𝑦 ) (3)
5
𝑛𝜋 𝑛𝜋
𝑛𝜋𝑥
Applying 𝑢(𝑥; 5) = 0 ⇒ 𝑢(𝑥; 𝑦) = ∑∞ ∞
𝑛=1 𝐵𝑛 = ∑𝑛=1 𝐵𝑛 𝑠𝑖𝑛 (𝐶𝑒 5 5 + 𝐷𝑒 − 5 5 ) = 0
5
𝑛𝜋𝑥
= ∑∞
𝑛=1 𝐵𝑛 𝑠𝑖𝑛 . (𝐸 + 𝐹)𝑒 −𝑛𝜋 = 0
5
86

𝑛𝜋𝑥
From (3) and using 𝑢(𝑥; 0) = 𝑓(𝑥) we get 𝑢(𝑥; 0) = 5 = ∑∞
𝑛=1 𝐵𝑛 𝑠𝑖𝑛 5
2 5 𝑛𝜋
𝐵𝑛 = 𝑏𝑛 = 5 ∫0 5𝑠𝑖𝑛 𝑥𝑑𝑥
5
10 𝑛𝜋𝑥 5
= −[𝑛𝜋 𝑐𝑜𝑠 ]
5 0
10
= − 𝑛𝜋 (𝑐𝑜𝑠𝑛𝜋 − 1)

10 −2 , 𝑛 𝑜𝑑𝑑
= − 𝑛𝜋 {
0 , 𝑛 𝑒𝑣𝑒𝑛
𝑛𝜋 𝑛𝜋
20 1 𝑛𝜋𝑥
∴ 𝑢(𝑥; 𝑦) = (∑∞
𝑛=2 ,4,… 𝑛 𝑠𝑖𝑛 )(𝑒 ( 5 )𝑦 + 𝑒 −( 5 )𝑦 )
𝜋 5
40 1 𝑛𝜋𝑥 𝑛𝜋
= (∑∞
𝑛=2 ,4,… 𝑛 𝑠𝑖𝑛 )𝑐𝑜𝑠 𝑦
𝜋 5 5

5.6.4 Laplace equation in polar coordinates


The relationship between polar coordinates in the plane and rectangular coordinates
are given by
𝑦
𝑥 = 𝑟𝑐𝑜𝑠𝜃 , 𝑦 = 𝑟𝑠𝑖𝑛𝜃 and 𝑟 2 = 𝑥 2 + 𝑦 2 , 𝑡𝑎𝑛𝜃 = 𝑥

These equations make it possible to convert the two-dimensional Laplacian of the


𝜕2𝑢 𝜕2𝑢
function 𝑢, ∇2 𝑢 = 𝜕𝑥 2 + 𝜕𝑦 2 into polar coordinates. The details of using the chain
rule to show that the conversion holds is left as an exercise.
In this section we look at solving the Laplace equation on a disk of radius 𝑐 and a
prescribed temperature on the boundary.
The general form of the Laplace equation in terms of polar coordinates is given by
𝜕2𝑢 1 𝜕𝑢 1 𝜕2𝑢
∇2 𝑢 = + 𝑟 𝜕𝑟 + 𝑟 2 𝜕𝜃2 = 0
𝜕𝑟 2

Example 5.17
Suppose we want to determine the steady state temperature 𝑢(𝑥; 𝑦) is the
semi-circular plate governed by the following partial differential equation.
𝜕2𝑢 1 𝜕𝑢 1 𝜕2𝑢
+ 𝑟 𝜕𝑟 + 𝑟 2 𝜕𝜃2 = 0 , 0 < 𝜃 < 𝜋 , 0 < 𝑟 < 𝑐
𝜕𝑟 2

subject to 𝑢(0; 𝜃) = 𝑢0 , 0 < 𝜃 < 𝜋


𝑢(𝑟; 0) = 0 , 𝑢(𝑟; 𝜋) = 0 , 0 < 𝑟 < 𝑐
87

Illustration of the model


𝑦

𝑢 = 𝑢0

𝑐
𝜃=𝜋

𝑢=0 𝑢=0

at 𝜃 = 𝜋 at 𝜃 = 𝜋

Solution
Define 𝑢 = 𝑅(𝑟); 𝜑(𝜃), then the separation of variables gives
𝑟 2 𝑅 ′′ +𝑟𝑅 ′ 𝜑 ′′
=− = −𝜆2
𝑅 𝜑

𝑟 2 𝑅 ′′ + 𝑟𝑅 ′ + 𝜆2 𝑅 = 0 (1)
𝜑 ′′ + 𝜆2 𝜑 = 0 (2)
Applying boundary conditions 𝜑(0) = 0 𝑎𝑛𝑑 𝜑(𝜋) = 0 to the solution
𝜑 = 𝐶1 𝑐𝑜𝑠𝜆𝜃 + 𝐶2 𝑠𝑖𝑛𝜆𝜃 of equation (2) gives 𝐶1 = 0 𝑎𝑛𝑑 𝜆 = 𝑛 , 𝑛 = 1, 2, …
Hence 𝜑 = 𝐶2 𝑠𝑖𝑛𝑛𝜃. Note that in this case 𝑛 = 0 does not produce an eigenvalue.
For 𝜆 = 𝑛 the solution of equation (1) is
𝑅 = 𝐶3 𝑟 𝑛 + 𝐶4 𝑟 −𝑛
The idea that 𝑢(𝑟; 𝜃) is bounded at 𝑟 = 0 leads to 𝐶4 = 0. Therefore
𝑢𝑛 = 𝑅(𝑟)𝜑(𝜃) = 𝐴𝑛 𝑟 𝑛 𝑠𝑖𝑛𝑛𝜃 and 𝑢(𝑟; 𝜃) = ∑∞ 𝑛
𝑛=1 𝐴𝑛 𝑟 𝑠𝑖𝑛𝑛𝜃

The remaining condition 𝑟 = 𝑐 gives the sine/odd series


𝑢0 = ∑∞ 𝑛
𝑛=1 𝐴𝑛 𝑐 𝑠𝑖𝑛𝑛𝜃
2 𝜋
As a result 𝐴𝑛 𝑐 𝑛 = 𝜋 ∫0 𝑢0 𝑠𝑖𝑛𝑛𝜃𝑑𝜃
𝟐 𝝅
𝑨𝒏 = 𝝅𝒄𝒏 ∫𝟎 𝒖𝟎 𝒔𝒊𝒏𝒏𝜽𝒅𝜽
2𝑢 1−(−1)𝑛
= 𝜋𝑐 𝑛0 . 𝑛

Therefore, the solution of the partial differential equation is given by


𝟐𝒖𝟎 𝟏−(−𝟏)𝒏 𝒓 𝒏
𝒖(𝒓; 𝜽) = ∑∞
𝒏−𝟏 (𝒄) 𝒔𝒊𝒏𝒏𝜽
𝝅 𝒏
88

Activity 5.7

1. Determine the steady state temperature 𝑢(𝑥; 𝑦) of rectangular plates


described by the following differential equations

𝜕2𝑢 𝜕2𝑢
(a) = 𝜕𝑦 2 ; 0 < 𝑥 < 1 , 0 < 𝑦 < 1
𝜕𝑥 2

subject to
𝑢(𝑥; 𝑦) = 0 , 𝑢(1; 𝑡) = 0 , 0 < 𝑥 < 1 , 0 < 𝑦 < 1
𝑢(𝑥; 0) = 0 , 𝑢(𝑥; 1) = 0

𝜕2𝑢 𝜕2𝑢
(b) = 𝜕𝑦 2 ; 0 < 𝑥 < 1 , 0 < 𝑦 < 1
𝜕𝑥 2

subject to
𝑢(0; 𝑦) = 0 , 𝑢(1; 𝑦) = 1 − 𝑦 , 0 < 𝑦 < 1
𝑢𝑦 (𝑥; 0) = 1 , 𝑢𝑦 (𝑥; 1) = 0 , 0 < 𝑥 < 1

𝜕2𝑢 𝜕2𝑢
(c) + 𝜕𝑦 2 = 0 ; 0 ≤ 𝑥 ≤ 5 , 0 ≤ 𝑦 ≤ 10
𝜕𝑥 2

subject to
𝑢(0; 𝑦) = 𝑢(5; 𝑦) = 0 ; 0 ≤ 𝑦 ≤ 10
𝜕𝑢
(𝑥; 0) = 0 ; 0 ≤ 𝑥 ≤ 5
𝜕𝑦
𝑢(𝑥; 0) = 5𝑠𝑖𝑛2𝜋𝑥 ; 0 ≤ 𝑥 ≤ 5

(d) Determine the steady state temperature 𝑢(𝑟; 𝜃) in a semicircular plate of


radius 𝑟 = 1 if
𝑢(1; 𝜃) = 𝑢0 , 0 < 𝜃 < 𝜋
𝑢(𝑟; 0) = 0 , 𝑢(𝑟; 𝜋) = 𝑢0 , 0 < 𝑟 < 1.
𝑢0 a constant.

(e) Determine the steady state temperature 𝑢(𝑟; 𝜃) in a semicircular plate of


radius 𝑟 = 2 if
𝜋
𝑢0 , 0 < 𝜃 < 2
𝑢(2; 𝜃) = { 𝜋
0 , 2<𝜃<𝜋

𝑢0 a constant, and the edges 𝜃 = 0 𝑎𝑛𝑑 𝜃 = 𝜋 are insulated.


89

Unit 6

6. Laplace Transforms
Introduction
In this Unit we discuss commonly used properties of Laplace transforms and use these
properties to evaluate Laplace transforms of given functions.
We revisit the use of Laplace transforms to solve ordinary differential equations.
We then discuss how to determine the transfer function of a system and use the
characteristic equation to check its stability.
We proceed by determining the impulse response of a system and check its stability.

By the end of this unit, you should be able to:

1. use properties (multiplication by 𝑡 𝑛 , division by 𝑡 and Laplace of integrals)

to evaluate Laplace transforms of given functions.

2. use Laplace transforms to solve differential equations

3. use transfer function poles to determine stability of a system

4. determine the impulse response of a system and to investigate its stability.

The concept of Laplace transforms was introduced in Mathematics III and some
properties were discussed and used to evaluate transforms of a variety of given
functions. Laplace transforms techniques were also used to solve differential
equations. The techniques learnt remain relevant we however extend the theory
further, specifically we bring into focus the concept of stability and the impulse
response of systems. Central to this unit are the following definitions and properties:

Definition 6.1
Given an integrable function 𝑓(𝑡) on [0; ∞) the Laplace transform of 𝑓(𝑡) is given by

ℒ{𝑓(𝑡)} = ∫0 𝑒 −𝑝𝑡 𝑓(𝑡)𝑑𝑡 = 𝐹(𝑝) where 𝑝 may be a real or complex parameter.

If the integral converges, it is said to be the Laplace transform of 𝑓(𝑡).The pair


{𝑓(𝑡); 𝐹(𝑝)} is referred to as the Laplace transform pair.
90

The integral is improper and is evaluated as follows:


∞ 𝑀
∫ 𝑒 −𝑝𝑡 𝑓(𝑡)𝑑𝑡 = 𝑙𝑖𝑚 ∫ 𝑒 −𝑝𝑡 𝑓(𝑡)𝑑𝑡 = 𝑙𝑖𝑚 [𝐹(𝑡)]𝑀
0 = 𝐹(𝑝)
0 𝑀→∞ 0 𝑀→∞

For this integral to exist, and if it does, whether it converges, we need to state sufficient
conditions on 𝑓(𝑡) for the existence of 𝐿{𝑓(𝑡)} by introducing the definition of a
function of exponential order and a causal function.

Definition 6.2
A function 𝑓(𝑡) is of exponential order as 𝑡 → ∞ if there exists a real number 𝜎 and
positive constants 𝑀 and 𝑇 such that
|𝑓(𝑡)| < 𝑀𝑒 𝜎𝑡 for all 𝑡 > 𝑇
2
An example of a function which is not of exponential order is 𝑓(𝑡) = 𝑒 𝑡 , since the
function grows faster than 𝑀𝑒 𝜎𝑡 no matter how large 𝑀 and 𝜎 might be.

Definition 6.3
A function is causal if 𝑓(𝑡) = 0 for 𝑡 < 0. Throughout this unit 𝑓(𝑡) will be assumed
as being causal. Most of the formulae appearing in the Laplace transform table were
derived using definition 6.1.

6.1 Properties of Laplace transforms


6.1 (a) The linearity property
For constants 𝛼 and 𝛽,

ℒ{𝛼𝑓(𝑡) + 𝛽𝑔(𝑡)} = ∫0 𝑒 −𝑝𝑡 [𝛼𝑓(𝑡) + 𝛽𝑔(𝑡)]𝑑𝑡
∞ ∞
= ∫0 𝑒 −𝑝𝑡 𝛼𝑓(𝑡) 𝑑𝑡 + ∫0 𝑒 −𝑝𝑡 𝛽𝑔(𝑡)𝑑𝑡
∞ ∞
= 𝛼 ∫0 𝑒 −𝑝𝑡 𝑓(𝑡) 𝑑𝑡 + 𝛽 ∫0 𝑒 −𝑝𝑡 𝑔(𝑡) 𝑑𝑡
= 𝛼ℒ{𝑓(𝑡)} + 𝛽ℒ{𝑔(𝑡)}
= 𝛼𝐹(𝑝) + 𝛽𝐺(𝑝)

Example 6.1
Determine ℒ{−3𝑒 −2𝑡 + 5𝑠𝑖𝑛ℎ3𝑡}
Solution:
ℒ{−3𝑒 −2𝑡 + 5𝑠𝑖𝑛ℎ3𝑡} = −3ℒ{𝑒 −2𝑡 } + 5ℒ{𝑠𝑖𝑛ℎ3𝑡}
1 3
= −3 (𝑝+2) + 5 (𝑝2 −9)
91

6.1 (b) The first translation property


If ℒ{𝑓(𝑡)} = 𝐹(𝑝) and 𝑏 is any real number, then ℒ{𝑒 −𝑏𝑡 𝑓(𝑡)} = 𝐹(𝑝 − 𝑏)

Example 6.2

Determine ℒ{{𝑒 5𝑡 𝑐𝑜𝑠ℎ2𝑡}}

Solution:
𝑝
ℒ{{𝑒 5𝑡 𝑐𝑜𝑠ℎ2𝑡}} = ( 2 )
𝑝 − 4 𝑝→𝑝−5
𝑝−5
= ((𝑝−5)2−4)

𝑝−5
= 𝑝2−10𝑝+21

6.1 (c) The second translation property


𝑓(𝑡 − 𝑘) ; 𝑡 ≥ 𝑘
If ℒ{𝑓(𝑡)} = 𝐹(𝑝) and 𝑘 is a constant where 𝑓(𝑡 − 𝑘) H(t-k)= { ,
0 ; 𝑡 <𝑘
then
ℒ{𝑓(𝑡 − 𝑘)𝐻(𝑡 − 𝑘)} = 𝑒 −𝑘𝑝 𝐹(𝑝)

6.1 (d) The change of scale property


If ℒ{𝑓(𝑡)} = 𝐹(𝑝) and 𝑎 ≠ 0 is a constant, then
1 𝑝
ℒ{𝑓(𝑎𝑡)} = 𝑎 𝐹 (𝑎)

Example 6.3
Determine ℒ{𝑠𝑖𝑛3𝑡} using the change of scale property.
Solution:
1 3 1 9 3
ℒ{𝑠𝑖𝑛3𝑡} = . ( 2 )= ( 2 )= 2
3 𝑝 3 𝑝 +9 𝑝 +9
( 3) + 9

6.1 (e) Laplace transforms of derivatives

If ℒ{𝑓(𝑡)} = 𝐹(𝑝) and 𝑓(𝑡) ; 𝑓 ′ (𝑡) ; 𝑓 ″(𝑡) ; … ; 𝑓 (𝑛−1) (𝑡) are continuous on [0 ; ∞)
and are of exponential order and if 𝑓 (𝑛) (𝑡) is piecewise continuous on [0 ; ∞), then
ℒ{𝑓 (𝑛) (𝑡)} = 𝑝𝑛 𝐹(𝑝) − 𝑝𝑛−1 𝑓(0) − 𝑝𝑛−2 𝑓′(0) − ⋯ − 𝑝𝑓 (𝑛−2) (0) − 𝑓 (𝑛−1 )(0)
92

6.1 (f) Laplace transforms of integrals


In some applications the behaviour of a system may be represented by an integro-
differential equation. Recall that under applications of Laplace transforms to electrical
𝑑2 𝑄 𝑑𝑄 𝑄
circuits we came across a circuit differential equation of the form 𝐿 𝑑𝑡 2 + 𝑅 𝑑𝑡 + 𝐶 = 𝐸.

This differential equation can be written in integro-differential form as


𝑑𝑖 1 𝑡
𝐿 𝑑𝑡 + 𝑖𝑅 + 𝐶 ∫0 𝑖(𝜏)𝑑𝜏 = 𝐸

This form necessitates the need to obtain Laplace transforms of integrals such as
𝑡
∫0 𝑓(𝜏)𝑑𝜏.
𝑡 𝑑𝑔
If we write 𝑔(𝑡) = ∫0 𝑓(𝜏)𝑑𝜏, then we have = 𝑓(𝑡) , 𝑔(0) = 0
𝑑𝑡

𝑑𝑔
Taking Laplace transforms ℒ { 𝑑𝑡 } = ℒ{𝑓(𝑡)} which leads to 𝑝𝐺(𝑝) = 𝐹(𝑝)

Generally, this leads to the following assertion


𝑡 𝐹(𝑝)
If ℒ{𝑓(𝑡)} = 𝐹(𝑝) , then ℒ {∫0 𝑓(𝑢)𝑑𝑢} = 𝑝

Example 6.4
Determine ℒ{𝑠𝑖𝑛4𝑡} using the Laplace transform of integrals formula
Solution:
4
ℒ{𝑠𝑖𝑛4𝑡} = 𝑝2 +16 ,
𝑡 4
Thus ℒ {∫0 𝑠𝑖𝑛4𝑢𝑑𝑢 } = 𝑝(𝑝2+16)

6.1 (g) Multiplication by 𝒕𝒏 property


If ℒ{𝑓(𝑡)} = 𝐹(𝑝) and 𝑛 = 1; 2 ; 3 ; … , then
𝑑𝑛
ℒ{𝑡 𝑓(𝑡)} = (−1)𝑛
𝑛 [𝐹(𝑝)]
𝑑𝑝𝑛

Example 6.5
Determine ℒ{𝑡𝑐𝑜𝑠ℎ2𝑡}
Solution:
𝑝 𝑑 𝑝
Since ℒ{𝑐𝑜𝑠ℎ2𝑡} = , it follows that ℒ{𝑡𝑐𝑜𝑠ℎ2𝑡} = − 𝑑𝑝 (𝑝2−4)
𝑝2 −4
𝑝2 +4
= (𝑝2−4)2
93

Example 6.6

Evaluate ∫0 𝑡𝑒 3𝑡 𝑐𝑜𝑠ℎ2𝑡𝑑𝑡

Solution:
𝑝2 +4
From example 6.5 we have ℒ{𝑡𝑐𝑜𝑠ℎ2𝑡} = (𝑝2−4)2,
∞ 𝑝2 +4 13
Therefore ∫0 𝑡𝑒 3𝑡 𝑐𝑜𝑠ℎ2𝑡𝑑𝑡 = [(𝑝2−4)2 ] = 25
𝑝=−3

6.1 (h) Division by t property


𝑓(𝑡) ∞ 𝑓(𝑡)
If ℒ{𝑓(𝑡)} = 𝐹(𝑝) , then ℒ { } = ∫𝑝 𝐹(𝑢)𝑑𝑢 provided 𝑙𝑖𝑚 exists.
𝑡 𝑡→0 𝑡

Example 6.77
𝑆𝑖𝑛3𝑡
Evaluate ℒ { }
𝑡

Solution:
𝑠𝑖𝑛3𝑡
Testing for existence of the limit we proceed as follows: 𝑙𝑖𝑚 = 𝑙𝑖𝑚 3𝑐𝑜𝑠3𝑡 = 3
𝑡→0 𝑡 𝑡→0

Since the limit exists, we now have 𝑦


𝑆𝑖𝑛3𝑡 ∞ 3
ℒ{ } = ∫𝑝 𝑢2 +9 𝑑𝑢 𝜋
𝑦 = 𝑡𝑎𝑛−1 𝑡
𝑡 2

−1 𝑢
= 𝑡𝑎𝑛 ] 𝑡
3 𝑝
𝑝
= 𝑡𝑎𝑛−1 ∞ − 𝑡𝑎𝑛−1 3 −
𝜋
2
𝜋 𝑝
=2− 𝑡𝑎𝑛−1 3 Behaviour of 𝑦 = 𝑡𝑎𝑛−1 t as 𝑡 → ∞

Example 6.8
∞ 𝑒 𝑡 (1−𝑐𝑜𝑠3𝑡)
Evaluate ∫0 𝑑𝑡
𝑡
1 𝑝
ℒ{1 − 𝑐𝑜𝑠3𝑡} = 𝑝 − 𝑝2+9
1−𝑐𝑜𝑠3𝑡
lim = lim 3𝑠𝑖𝑛3𝑡 = 0 𝑦
𝑡→0 𝑡 𝑡→0

1−𝑐𝑜𝑠3𝑡 ∞ 1 𝑢
So ℒ { } = ∫𝑝 ( − 2 ) 𝑑𝑢 𝑦 = 𝑙𝑛𝑡
𝑡 𝑢 𝑢 +9
1
= [𝑙𝑛(𝑢) − 2 ln(𝑢2 + 9)]∞
𝑝 𝑡
1
= 0 − (𝑙𝑛𝑝 − 2 ln (𝑝2 + 9)) Behaviour of 𝑦 = 𝑙𝑛𝑡 as 𝑡 → ∞

√𝑝2 +9
= 𝑙𝑛 𝑝
94

∞ 𝑒 𝑡 (1−𝑐𝑜𝑠3𝑡) √𝑝2 +9
∴ ∫0 𝑑𝑡 = ⦗𝑙𝑛 ⦘𝑝=−1 = 𝑙𝑛√10 ≈ 1,1513
𝑡 𝑝

Example 6.9
𝑡 𝑒 𝑢 𝑠𝑖𝑛ℎ3𝑢
Determine ℒ {∫0 𝑑𝑢}
𝑢

Solution:
3
ℒ{𝑒 𝑡 𝑠𝑖𝑛ℎ3𝑡} =
(𝑝 − 1)2 − 9
𝑒 𝑡 𝑠𝑖𝑛ℎ3𝑡
Since 𝑙𝑖𝑚 = 𝑙𝑖𝑚(3𝑒 𝑡 𝑐𝑜𝑠ℎ3𝑡 + 𝑒 𝑡 𝑠𝑖𝑛ℎ3𝑡) = 3
𝑡→0 𝑡 𝑡→0
𝑒 𝑡 𝑠𝑖𝑛ℎ3𝑡 ∞ 3
It follows that ℒ{ } = ∫𝑝 (𝑢−1)2 −9
𝑑𝑢
𝑡
1 ∞ 1 1
= ∫𝑝
( − ) 𝑑𝑢
2 𝑢−4 𝑢+2
1
= 2 [𝑙𝑛(𝑢 − 4) − 𝑙𝑛(𝑢 + 2)]∞
𝑝
1 𝑢−4 ∞
= 2 𝑙𝑛 [𝑢+2]
𝑝
1 𝑝+2
= 2 𝑙𝑛 (𝑝−4)
𝑡 𝑒 𝑢 𝑠𝑖𝑛ℎ3𝑢 1 𝑝+2
∴ ℒ {∫0 𝑑𝑢} = 2𝑝 𝑙𝑛 (𝑝−4)
𝑢

Activity 6.1
1. Determine the Laplace transforms of the following:
(a) 𝑓(𝑡) = 𝑡 2 𝑒 −2𝑡
(b) 𝑓(𝑡) = (𝑠𝑖𝑛2𝑡 − 𝑐𝑜𝑠2𝑡)2
(c) 𝑓(𝑡) = 2𝑒 3𝑡 𝑐𝑜𝑠3𝑡
(d) 𝑓(𝑡) = 4𝑠𝑖𝑛ℎ2 𝑡
𝑐𝑜𝑠ℎ𝑡
(e) 𝑓(𝑡) = 𝑡

2. Evaluate

(a) ∫0 𝑡𝑒 −𝑡 𝑐𝑜𝑠2𝑡 𝑑𝑡

(b) ∫0 𝑢𝑒 −2𝑢 𝑠𝑖𝑛ℎ (𝑢)𝑑𝑢
∞ 𝑒 3𝑡 𝑠𝑖𝑛ℎ2𝑡
(c) ∫0 𝑑𝑡
𝑡
∞ 𝑒 3𝑡 𝑠𝑖𝑛2𝑡
(d) ∫0 𝑑𝑡
𝑡
𝑡 𝑒 𝑢 𝑐𝑜𝑠ℎ2𝑢
(e) ℒ {− ∫0 𝑑𝑢}
𝑢
𝑡 𝑒 𝑢 𝑐𝑜𝑠3𝑢
(f) ℒ {∫0 𝑢 𝑑𝑢}
𝑡 𝑐𝑜𝑠ℎ𝑢−𝑐𝑜𝑠ℎ2𝑢
(g) ℒ {∫0 𝑑𝑢}
𝑢
95

6.2 Inverse Laplace Transforms


The process of finding the Laplace transform of a function say 𝐹(𝑝) of a function 𝑓(𝑡)
can be turned around, namely, given 𝐹(𝑝), find the corresponding function 𝑓(𝑡). We
say 𝑓(𝑡) is the inverse Laplace transform of 𝐹(𝑝) and we write 𝑓(𝑡) = ℒ −1 {𝐹(𝑝)}.
For the convolution property (𝑓 ∗ 𝑔)(𝑡) = ℒ −1 {𝐹(𝑝)𝐺(𝑝)}.
The concepts and techniques that have been dealt with before will now be used in
conjunction with the table of Laplace transforms to evaluate integrals and solve given
differential equations as well as those that arise from electrical circuits and mechanical
vibrations.
We now illustrate the usage of the table of Laplace transform through the following
examples:

Example 6.10
2
Determine ℒ −1 {𝑝2+16}

Solution:
𝑎
From the table we use the formula ℒ{𝑠𝑖𝑛𝑎𝑡} = 𝑝2+𝑎2 ⟹ 𝑎2 = 16 ∴ 𝑎 = 4
2 1 2.𝟐
So ℒ −1 {𝑝2+16} = 𝟐 ℒ −1 {𝑝2+16}
1
= 𝑠𝑖𝑛2𝑡
2

Example 6.11
1
Determine ℒ −1 {𝑝(𝑝2−1}

Solution:
1
Resolving into partial fractions first we have
𝑝(𝑝2 −1)
1 1 𝐴 𝐵 𝐶
𝑝(𝑝2 −1)
= 𝑝(𝑝−1)(𝑝+1) = 𝑝 + 𝑝−1 + 𝑝+1
1 = 𝐴(𝑝 − 1)(𝑝 + 1) + 𝐵𝑝(𝑝 + 1) + 𝐶𝑝(𝑝 − 1)
𝑝 = 0: 1 = −𝐴 ⟹ 𝐴 = −1
1
𝑝 = 1: 1 = 2𝐵 ⟹ 𝐵 =
2
1
𝑝 = −1: 1 = 2𝐶 ⟹ 𝐶 = 2
Taking inverse transforms:
1 −1 1 1
ℒ −1 {𝑝(𝑝2−1} = ℒ −1 { 𝑝 } + ℒ −1 {2(𝑝−1)} + ℒ −1 {2(𝑝+1)}
1 1
= −1 + 2 𝑒 𝑡 + 2 𝑒 −𝑡
96

Activity 6.2
1. Determine the inverse Laplace transforms of the following:
1
(a) 𝑝2 (𝑝2 +25)
𝑝+4
(b) 𝑝2 (𝑝2 +1)
1
(c) 𝑝(𝑝2 +1)(𝑝−1)
1
(d) (𝑝+2)3
2
(e) (𝑝2 +2)2

2. Determine:
2𝑃 2
(a) ℒ −1 {𝑃2−𝑝−6}
𝑝4
(b) ℒ −1 {𝑝4−1}

6.3 Solutions of Differential Equations


Laplace transform techniques are useful in solving linear differential equations with
𝑑2 𝑦 𝑑𝑦
constant coefficients, 𝑒. 𝑔: 𝑎 𝑑𝑡 2 + 𝑏 𝑑𝑡 + 𝑐𝑦 = 𝑓(𝑡) where 𝑎 , 𝑏 and 𝑐 are constants
and 𝑦 ′ (0) = 𝐴 and 𝑦(0) = 𝐵 are initial conditions.
The process is: Find Laplace transforms both sides, substitute initial conditions,
simplify to obtain 𝐿{𝑦} and then find the inverse Laplace transform.

Example 6.12
Solve 𝑦 ″ + 5𝑦 ′ + 6𝑦 = 2𝑒 −𝑡 subject to 𝑦(0) = 1 and 𝑦 ′ (0) = 0
Solution:
2
𝑝2 𝑦̃ − 𝑝𝑦(0) − 𝑦 ′ (0) + 5[𝑝 − 𝑦(0)] + 6𝑦̃ =
𝑝+1
2
𝑦̃ [𝑝2 + 5𝑝 + 6] = +𝑝+5
𝑝+1
7 + 6𝑝 + 𝑝2 𝐴 𝐵 𝐶
𝑦̃ = = + +
(𝑝 + 1)(𝑝 + 2)(𝑝 + 3) 𝑝 + 1 𝑝 + 2 𝑝 + 3
7 + 6𝑝 + 𝑝2 = 𝐴(𝑝 + 2)(𝑝 + 3) + 𝐵(𝑝 + 1)(𝑝 + 3) + 𝐶(𝑝 + 1)(𝑝 + 2)
𝑝 = −1: 2 = 2𝐴 ⟹ 𝐴 = 1
𝑝 = −2: − 1 = −𝐵 ⟹ 𝐵 = 1
𝑝 = −3: − 2 = 2𝐶 ⟹ 𝐶 = −1
1 1 1
∴ 𝑦(𝑡) = ℒ −1 { + − } = 𝑒 −𝑡 + 𝑒 −2𝑡 − 𝑒 −3𝑡
𝑝+1 𝑝+2 𝑝+3
97

Example 6.13
Solve 𝑥 ‴ + 5𝑥 ″ + 17𝑥 ′ + 13𝑥 = 1 subject to 𝑥(0) = 𝑥 ′ (0) = 1 and 𝑥 ″ (0) = 0
Solution:
1
𝑝3 𝑥̃ − 𝑝2 𝑥(0) − 𝑝𝑥 ′ (0) − 𝑥 ″ (0) + 5[𝑝2 𝑥̃ − 𝑝𝑥(0) − 𝑥 ′ (0)] + 17[𝑝𝑥̃ − 𝑥(0)] + 13𝑥̃ =
𝑝
1
𝑥̃[𝑝3 + 5𝑝2 + 17𝑝 + 13] = + 𝑝2 + 6𝑝 + 22
𝑝
𝑝3 + 6𝑝2 + 22𝑝 + 1 𝐴 𝐵 𝐶𝑝 + 𝐷
𝑥̃ = = + +
𝑝(𝑝3 + 5𝑝2 + 17𝑝 + 13) 𝑝 𝑝 + 1 𝑝2 + 4𝑝 + 13
𝑝 + 6𝑝 + 22𝑝 + 1 = 𝐴(𝑝 + 1)(𝑝2 + 4𝑝 + 13) + 𝐵𝑝(𝑝2 + 4𝑝 + 13)
3 2

+(𝐶𝑝 + 𝐷)(𝑝)(𝑝 + 1)
Equating linear factors to zero we have
8 1
𝑝 = −1 ∶ −16 = −10𝐵 ⟹ 𝐵 = 5, 𝑝 = 0 ∶ 1 = 13𝐴 ⟹ 𝐴 = 13
Comparing coefficients of 𝑝𝑛 , 𝑛 = 3 𝑎𝑛𝑑 2 we have,
𝑝3 : 1 = 𝐴 + 𝐵 + 𝐶
1 8 44
1 = 13 + 5 + 𝐶 ⟹ 𝐶 = − 65
5 32 44 7
𝑝2 : 6 = 13 + − 65 + 𝐷 ⟹ 𝐷 = − 65
5
1 8
−1 13 5 1 44𝑝+7
𝑥=ℒ {𝑝 + − 65 𝑝2+4𝑝+13}
𝑝+1
1 8 1 44(𝑝+2)−27(3)
= 13 + 5 𝑒 −𝑡 − 65 ℒ −1 { (𝑝+2)2 +32
}
1 8 1
∴ 𝑥(𝑡) = 13 + 5 𝑒 −𝑡 − 65 𝑒 −2𝑡 [44𝑐𝑜𝑠3𝑡 − 27𝑠𝑖𝑛3𝑡]

6.4 Mechanical Vibrations


Mechanical translation systems involve three basic elements: Masses (with mass
𝑖𝑛 𝑘𝑔′𝑠) , springs (with spring stiffness 𝑘 𝑖𝑛 𝑁/𝑚) and dampers (with damping
coefficient 𝛽 𝑖𝑛 𝑁𝑠/𝑚). The associated variables are displacement {𝑥(𝑡) 𝑖𝑛 𝑚𝑒𝑡𝑒𝑟𝑠}
and force {𝑓(𝑡) 𝑖𝑛 𝑁𝑒𝑤𝑡𝑜𝑛𝑠}. Assuming we are dealing with ideal springs and
dampers (i.e. they behave linearly), the relationship between the forces and
displacements at time 𝑡 we have,
mass: 𝐹 = 𝑚𝑎 = 𝑚𝑥″ (𝑁𝑒𝑤𝑡𝑜𝑛′ 𝑠 𝑙𝑎𝑤)
spring: 𝐹 = 𝑘(𝑥2 − 𝑥1 ) (𝐻𝑜𝑜𝑘𝑒 ′ 𝑠 𝑙𝑎𝑤)
damper: 𝐹 = 𝛽(𝑥 ′ 2 − 𝑥 ′1 )
98

6.4.1 Coupled springs


Two masses 𝑚1 and 𝑚2 are attached to two springs A and 𝐵 of negligible mass
having spring constants 𝑘1 and 𝑘2 respectively. The two springs are attached to the
ceiling as illustrated in the next figure(s).
Let 𝑥1 and 𝑥2 be vertical displacements of masses from their equilibrium
positions.
Figure (a) Figure (b)

𝐴 𝑘1

𝑥1 = 0 𝑚1 𝑥1
𝐵 𝑘2
𝑥2 = 0 ----------------𝑚2 𝑥2

We shall now use some known laws to formulate general equations from the analysis
of the above system. When the system is perturbed, spring 𝐵 is subjected to both
expansion and compression. Its net expansion is 𝑥2 − 𝑥1 . As a result, from Hooke’s
law springs, 𝐴 and 𝐵 exert the forces −𝑘1 𝑥1 and 𝑘2 (𝑥2 − 𝑥1) on mass 𝑚1 . In the
absence of external force and damping force on the system, then the net force
becomes,
−𝑘1 𝑥1 + 𝑘2 (𝑥2 − 𝑥1 )
From Newton’s second law an equation may be formulated as follows:
𝑑 2 𝑥1
𝑚1 = −𝑘1 𝑥1 + 𝑘2 (𝑥2 − 𝑥1 ).
𝑑𝑡 2

Similarly, the net force exerted on mass 𝑚2 is due only to the net force of the
expansion of spring 𝐵, which is
𝑘2 (𝑥2 − 𝑥1 )
𝑑 2 𝑥2
As a result, the other formula becomes 𝑚2 = −𝑘2 (𝑥2 − 𝑥1 )
𝑑𝑡 2

Combining these two formulae for the coupled spring gives rise to the following
system of equations,
𝑑 2 𝑥1
𝑚1 = −𝑘1 𝑥1 + 𝑘2 (𝑥2 − 𝑥1 )
𝑑𝑡 2
2
𝑑 𝑥2
𝑚2 = −𝑘2 (𝑥2 − 𝑥1 )
𝑑𝑡 2
99

In the next examples we apply techniques learned so far to solve mechanical


vibration problems.

Example 6.14
The mass of a system is subjected to an externally applied force of 𝐹(𝑡) = 4𝑠𝑖𝑛𝜔𝑡 at
time 𝑡 = 0. Determine the resulting displacement 𝑥(𝑡) of the mass at time 𝑡, given
that 𝑥(0) = 𝑥 ′ (0) = 0 for the two cases (a) 𝜔 = 2 𝑎𝑛𝑑 (𝑏) 𝜔 = 5. The illustration
of the system is as follows:
Figure (a) Figure (b)
𝐹1 = 𝑘𝑥 ; 𝐹2 = 𝛽𝑥′
𝑘 = 25 𝛽=6 resolution of forces
𝑚=1 𝐹(𝑡) = 4𝑠𝑖𝑛𝜔𝑡 𝑚=1

𝐹(𝑡) = 4 𝑠𝑖𝑛 𝜔𝑡

Solution:
Formulating a differential equation from the figures above we have,
𝑚𝑥 ″ (𝑡) = 𝐹(𝑡) − 𝐹1 (𝑡) − 𝐹2 (𝑡), where 𝑚 = 1 ; 𝐹1 = 𝑘𝑥(𝑡) = 25𝑥 ; 𝐹2 = 𝛽𝑥 ′ (𝑡) = 6𝑥′
So, the equation becomes 𝑥 ″ + 6𝑥 ′ + 25𝑥 = 4 𝑠𝑖𝑛 𝜔𝑡
(a) For 𝜔 = 2: 𝑥 ″ + 6𝑥 ′ + 25𝑥 = 4 𝑠𝑖𝑛 2𝑡 where 𝑥(0) = 𝑥 ′ (0) = 0
8
𝑥̃[𝑝2 + 6𝑝 + 25] = 𝑝2+4
8 𝐴𝑝+𝐵 𝐶𝑝+𝐷
𝑥̃ = (𝑝2+6𝑝+25)(𝑝2+4) = 𝑝2+6𝑝+25 + 𝑝2 +4
2 2
From this we have 8 = (𝐴𝑝 + 𝐵)(𝑝 + 4) + (𝐶𝑝 + 𝐷)(𝑝 + 6𝑝 + 25)
On comparing coefficients we have 𝑝3 : 0 = 𝐴 + 𝐶 (1)
𝑝2 : 0 = 𝐵 + 6𝐶 + 𝐷 (2)
𝑝1 : 0 = 4𝐴 + 25𝐶 + 6𝐷 (3)
𝑝0 : 8 = 4𝐵 + 25𝐷 (4)
16 8 −16 56
From the above equations verify that 𝐴 = 195 ; 𝐵 = 39 ; 𝐶 = 𝑎𝑛𝑑 𝐷 = 195
195
The result is
1 16𝑝 + 40 16𝑝 − 56
𝑥̃ = [ 2 − 2 ]
195 𝑝 + 6𝑝 + 25 𝑝 +4
1 16(𝑝 + 3) − 8 16𝑝 − 56
= [ − 2 ]
195 (𝑝 + 3)2 + 16 𝑝 +4
1
∴ 𝑥(𝑡) = [2𝑒 −3𝑡 (8𝑐𝑜𝑠4𝑡 − 2𝑠𝑖𝑛4𝑡) − 16𝑐𝑜𝑠2𝑡 + 28𝑠𝑖𝑛2𝑡]
195
20
(b) For 𝜔 = 5, 𝑥̃ = (𝑝2+6𝑝+25)(𝑝2+25)
1 2(𝑝+3)+6 2𝑝
= 15 [(𝑝+3)2+16 − 𝑝2+25]
100

1 −3𝑡 3
∴ 𝑥(𝑡) =[𝑒 (2𝑐𝑜𝑠4𝑡 + 𝑠𝑖𝑛4𝑡) − 2𝑐𝑜𝑠5𝑡]
15 2
For an interesting observation suppose for 𝜔 = 5 the damping term was missing, then
20 20
𝑥̃ = 2 = 2
(𝑝 + 25)(𝑝 + 25) (𝑝 + 25)2
2
𝑑 𝑝 (𝑝2 +25)−2𝑝2 𝑝2 −25 𝑝2 +25−50
Since ℒ{𝑡 𝑐𝑜𝑠5𝑡} = − 𝑑𝑡 (𝑝2+25) = − (𝑝2 +25)2
= (𝑝2+25)2 = (𝑝2 +25)2
1 50 1
So ℒ{𝑡 𝑐𝑜𝑠5𝑡} = 𝑝2+25 − (𝑝2+25)2 = ℒ {5 𝑠𝑖𝑛5𝑡} − ℒ{𝑡𝑐𝑜𝑠5𝑡}
50 1
Now (𝑝2 +25)2
= ℒ {5 𝑠𝑖𝑛5𝑡} − ℒ{𝑡𝑐𝑜𝑠5𝑡}
20 2 1
𝑥̃ = = ℒ { 𝑠𝑖𝑛5𝑡} − ℒ{𝑡𝑐𝑜𝑠5𝑡}
(𝑝2 + 25) 2 5 5
2
∴ 𝑥(𝑡) = (𝑠𝑖𝑛5𝑡 − 5𝑡𝑐𝑜𝑠5𝑡)
25
Because of the term 𝑡𝑐𝑜𝑠5𝑡 , 𝑥 → ∞ 𝑎𝑠 𝑡 → ∞ 𝑎𝑛𝑑 𝑡ℎ𝑖𝑠 ⟹ 𝑥(𝑡) is unbounded. This
shows that the applied force 𝐹(𝑡) = 4𝑠𝑖𝑛5𝑡 is in resonance with the system.

Example 6.15
The system shown below consists of two masses, 𝑚1 = 1 𝑘𝑔 𝑎𝑛𝑑 𝑚2 = 2 𝑘𝑔 each
attached to a fixed base by a spring having constants 𝑘1 = 1 𝑎𝑛𝑑 𝑘2 = 2 respectively.
These masses are attached to each other by a third spring with constant 𝑘3 = 2. The
system is released from rest at time 𝑡 = 0 such that 𝑚1 is displaced 1 unit to the left
of its equilibrium position and 𝑚2 is displaced 2 units to the right of its equilibrium
position. Neglecting all frictional effects, determine the position of the masses at time 𝑡.

Figure (a)

𝑘1 𝑘3 𝑘2

𝑚1 𝑚2

𝑥1 𝑥2

Resolution of forces
Figure (b)
𝐹1 = 𝑘1 𝑥1 𝐹3 = 𝑘3 (𝑥2 − 𝑥1 ) 𝐹2 = 𝑘2 𝑥2
𝑚1 𝑚2

𝑥″1 𝑥″2
101

Solution:
Let 𝑥′1 (𝑡) and 𝑥′2 (𝑡) be displacements of the masses to the right from equilibrium
positions. The only forces acting on the masses are restoring forces due to springs
(Frictional forces are ignored). Applying Newton’s law on the masses 𝑚1 and 𝑚2
respectively the following equations are obtained.
𝑚1 𝑥″1 = 𝐹2 − 𝐹1 = 𝑘2 (𝑥2 − 𝑥1 ) − 𝑘1 𝑥1
𝑚2 𝑥 ″ 2 = −𝐹3 − 𝐹2 = −𝑘3 𝑥2 − 𝑘2 (𝑥2
Substituting the given values leads to the following equations:
𝑥″1 + 3𝑥1 − 2𝑥2 = 0
𝑥″2 − 𝑥1 + 2𝑥2 = 0
Class Activity

Now, introduce Laplace transforms on both sides and inset initial conditions
𝑥1 (0) = 𝑥ʹ1 (0) = 𝑥ʹ2 (0) = 0 𝑎𝑛𝑑 𝑥2 (0) = 2 to solve the system.

Activity 6.3

1. Determine the displacements of the masses depicted below at time 𝑡 if


𝑚1 = 𝑚2 = 1 and 𝑘1 = 1 ; 𝑘2 = 3 𝑎𝑛𝑑 𝑘3 = 9 (See example 1.30)

𝑘1 𝑘3 𝑘2

𝑚1 𝑚2

𝑥1 𝑥2
2. A coupled mass spring system is defined by the following equations:
𝑥″1 + 10𝑥1 − 4𝑥2 = 0
𝑥 ″ 2 − 4𝑥1 + 4𝑥2 = 0,
subject to 𝑥1 (0) = 𝑥2 (0) = 0 ; 𝑥 ′1 (0) = 1 𝑎𝑛𝑑 𝑥 ′ 2 (0) = −1
Determine the displacements 𝑥1 (𝑡) 𝑎𝑛𝑑 𝑥2 (𝑡) of the system.

6.5 Solutions of Simultaneous Differential Equations


The technique used for solving systems is based on the principle of systematic
elimination of variables.
The analogue of multiplying an algebraic equation by a constant operates on a
differential equation with some combination of derivatives. This is illustrated by the
example given below.
102

Example 6.16
𝑑𝑥 𝑑𝑦 𝑑𝑥 𝑑𝑦
Solve + 𝑑𝑡 + 5𝑥 + 3𝑦 = 𝑒 −𝑡 ; 2 𝑑𝑡 + 𝑑𝑡 + 𝑥 + 𝑦 = 3 subject to 𝑥 = 2
𝑑𝑡

and 𝑦 = 1, when 𝑡 = 0 .
Solution:
1
𝑝𝑥̃ − 𝑥(0) + 𝑝𝑦̃ − 𝑦(0) + 5𝑥̃ + 3𝑦̃ = 𝑝+1 (1)
3
2[𝑝𝑥̃ − 𝑥(0)] + 𝑝𝑦̃ − 𝑦(0) + 𝑥̃ + 𝑦̃ = 𝑝 (2)

After substituting the given conditions we have,


1 3
x̃[𝑝 + 5] + 𝑦̃[𝑝 + 3] = 𝑝+1 + 3 𝑎𝑛𝑑 𝑥̃[2𝑝 + 1] + 𝑦̃[𝑝 + 1] = 𝑝 + 5

Eliminating 𝑦̃ we have
𝑥̃[𝑝 + 5](𝑝 + 1) + 𝑦̃[𝑝 + 3](𝑝 + 1) = 1 + 3(𝑝 + 1)
3
𝑥̃[2𝑝 + 1](𝑝 + 3) + 𝑦̃[𝑝 + 1](𝑝 + 3) = [𝑝 + 5] (𝑝 + 3)

Now we have
9
𝑥̃{[(2𝑝 + 1)(𝑝 + 3)] − [(𝑝 + 5)(𝑝 + 1)]} = 𝑝 + 14 + 2𝑝

2𝑝2 +14𝑝+9 𝐴 𝐵 𝐶
∴ 𝑥̃ = = + +
𝑝(𝑝+2)(𝑝−1) 𝑝 𝑝+2 𝑝−1

2𝑝2 + 14𝑝 + 9 = 𝐴(𝑝 + 2)(𝑝 − 1) + 𝐵𝑝(𝑝 − 1) + 𝐶𝑝(𝑝 + 2)


11
𝑝 = −2 ∶ −11 = 6𝐵 ⟹ 𝐵 = − 6
9
𝑝 = 0 ∶ 9 = −2𝐴 ⟹ 𝐴 = − 2
25
𝑝 = 1 ∶ 25 = 3𝐶 ⟹ 𝐶 = 3
9 11 25 𝑡
Hence 𝑥 = − 2 − 𝑒 −2𝑡 + 𝑒
6 3

Similarly y may be determined by eliminating x̃ or by substituting x in the original


𝑑𝑦
differential equations after eliminating as outlined below
𝑑𝑡
𝑑𝑥
− 𝑑𝑡 + 4𝑥 + 2𝑦 = 𝑒 −𝑡 − 3
𝑑 9 11 25 9 11 −2𝑡 25
So, 2𝑦 = 𝑑𝑡 [− 2 − 𝑒 −2𝑡 + 𝑒 𝑡 ] − 4 [− 2 − 𝑒 + 𝑒 𝑡 ] + 𝑒 −𝑡 − 3
6 3 6 3

∴ 𝑦 = 7,5 + 0,5𝑒 −𝑡 + 5,5𝑒 −2𝑡 − 12,5𝑒 𝑡


103

Activity 6.4
1. Use Laplace transforms to solve the following differential equations.
(a) 𝑥 ′ − 𝑦 ′ + 𝑦 = 𝑡 𝑎𝑛𝑑 𝑦 ′ − 4𝑥 ′ + 𝑥 = 1 , 𝑥(00 = 0 , 𝑦(0) = 1
𝑑𝑥 𝑑𝑦 𝑑𝑥 𝑑𝑦
(b) 𝑑𝑡
+ 𝑑𝑡 + 𝑦 = 𝑡 and 𝑑𝑡
+ 4 𝑑𝑡 + 𝑥 = 1 ; 𝑥(0) = 1 ; 𝑦(0) = 0
(c) 𝑥 = 𝑥 − 𝑦 𝑎𝑛𝑑 𝑦 ′′ = 𝑦 − 𝑥 , 𝑥(0) = 1 , 𝑦(0) = −2 , 𝑥 ′ (0) = 𝑦 ′ (0) = 0
′′

6.6 The Transfer Function


The transfer function of a linear time-invariant system is defined as the ratio of the
Laplace transform of the output (response function) to the Laplace transform of the
input (forcing function) where all initial conditions are assumed to be zero. The
associated characteristic equation is then used to determine the stability of the system
with transfer function
𝑋(𝑝)
𝐺(𝑝) =
𝑈(𝑝)
𝑋(𝑝) 𝑏𝑚 𝑝 + 𝑏𝑚−1 𝑝𝑚−1 + ⋯ +𝑏0
𝑚
𝐺(𝑝) = = ; 𝑚≤𝑛
𝑈(𝑝) 𝑎𝑛 𝑝𝑛 + 𝑎𝑛−1 𝑝𝑛−1 + ⋯ +𝑎0
The equation 𝑈(𝑝) = 0 is called the characteristic equation of the system and its
order the order of the system.
If 𝑚 > 𝑛, then 𝑋(𝑝) = 𝐺(𝑝)𝑈(𝑝) will involve powers of 𝑝 and from,
𝐿{𝛿 (𝑛) (𝑡 − 𝑎)} = 𝑝𝑛 𝑒 −𝑎𝑝 or ℒ{𝛿 (𝑛) (𝑡)} = 𝑝2 we see that 𝑥(𝑡) will then contain impulse
functions. In practice, an overall system may be made up of a number of components
each with its own transfer function. The overall system transfer function is then
obtained by the rules of block diagrams.
𝑏𝑚 (𝑝−𝑧𝑚 )(𝑝−𝑧𝑚−1 )…(𝑝−𝑧1 )
𝐺(𝑝) may be written as 𝐺(𝑝) = 𝑎𝑛 (𝑝−𝑎𝑛 )(𝑝−𝑎𝑛−1 )…(𝑝−𝑎1 )

The 𝑧𝑖 ’s are the zeros of the system and 𝑎𝑖 ’s are the poles. A plot of the poles and
zeros is used as an aid in the graphical analysis of the transfer function. The position
of a zero is marked by a circle (o) and the pole by a cross (×). Since the coefficients
of 𝑋(𝑝) and 𝑈(𝑝) are real, all complex roots occur in conjugate pairs. Hence the pole
zero plot is symmetrical about the real axis.
We now use an example to illustrate the concepts outlined above.

Example 6.17
The response 𝑥(𝑡) of a system to an input 𝑢(𝑡) is determined by the differential
equation
9𝑥 ″ + 12𝑥 ′ + 13𝑥 = 2𝑢′ + 3𝑢
First determine the transfer function of the system and then
(a) write down the characteristic equation of the system and state its order.
(b) determine the transfer function poles, zeros and plot them on the p-plane.
104

Solution:
Taking Laplace transforms with initial conditions zero:
𝑋(𝑝)[9𝑝2 + 12𝑝 + 13] = 𝑈(𝑝)[2𝑝 + 3]
𝑋(𝑝) 2𝑝 + 3
𝐺(𝑝) = = 2
𝑈(𝑝) 9𝑝 + 12𝑝 + 13
(a) The characteristic equation is 9𝑝2 + 12𝑝 + 13 = 0 and the order is two.
−𝑏±√𝑏2 −4𝑎𝑐
(b) The poles are the roots of 9𝑝2 + 12𝑝 + 13 = 0 , 𝑝 = 2𝑎
−12±√144−4.9.13 −2±3𝑗
= =
18 3

3
The zeros are the roots of 2𝑝 + 3 = 0 ⟹ 𝑝 = − 2 . Plotting these on the
p- plane we have
𝐼𝑚(𝑧)
× 1

3 1 1
−2 −1 −2 0 1
2

× -1

6.7 Stability
A stable system is one that remains at rest unless it is excited by an external source
and returns to normal when the external source is removed. This ensures that a
bounded input produces a bounded output. This property is often taken as the
definition of a stable linear system.
The stability of a system is a property of the system itself and does not depend on the
input. The stability of a system depends on the nature of its poles. The roots of the
characteristic equation can take several forms:
1. For a simple factor of the form 𝑝 + 𝛼 where 𝛼 is real.
𝐴
This corresponds to a simple pole at 𝑝 = −𝛼 and the partial fraction form is 𝑝+𝛼
leading to a time response of 𝐴𝑒 −𝛼𝑡 𝐻(𝑡).
If 𝛼 > 0, the pole lies in the left half of the p-plane and the response will tend to
zero as 𝑡 → ∞. Clearly, if 𝛼 < 0, the response tends to infinity as 𝑡 → ∞.Thus
a stable system must have real-valued simple poles that occur on the left half of
the p-plane.
105

𝐴
If 𝛼 = 0, then has time response 𝐴𝐻(𝑡) and we say the system is marginally
𝑝
stable. This means that a bounded input does not ensure a bounded output.
2. Repeated simple factors of the form (𝑝 + 𝛼)𝑛 where 𝛼 is real.

This corresponds to a multiple pole of order 𝑛 at 𝑝 = −𝛼 and its partial fraction


𝐴 𝐴
form is (𝑝+𝛼)𝑛 , 𝑛 = 1; 2; … leading to a time response (𝑛−1)! 𝑡 𝑛−1 𝑒 −𝛼𝑡 𝐻(𝑡).

3. Quadratic factors of the form (𝑝 + 𝛼)2 + 𝛽 2 with 𝛼 and 𝛽 real.

This corresponds to a pair of conjugate poles at 𝑝 = −𝛼 ± 𝛽𝑗 and its partial


𝐴(𝑝+𝛼)+𝐵𝛽
fraction form is (𝑝+𝛼)2 +𝛽 2
leading to a time response
−𝛼𝑡
𝑒 (𝐴𝑐𝑜𝑠𝛽𝑡 + 𝐵𝑠𝑖𝑛𝛽𝑡) ≈ 𝐾𝑒 −𝛼𝑡 𝑠𝑖𝑛 (𝛽𝑡 + 𝜏)
𝐴
where 𝐾 = √𝐴2 + 𝐵 2 and 𝜏 = 𝑡𝑎𝑛−1 𝐵

Again, the system will only be stable if 𝛼 > 0, thus a stable system must therefore have
complex conjugate poles in the left half of the p-plane, that is, all complex poles must
have negative real parts.
To prove stability thus we have to show that all roots of the characteristic equation
𝑈(𝑝) = 𝑎𝑛 𝑝𝑛 + 𝑎𝑛−1 𝑝𝑛−1 + ⋯ + 𝑎1 𝑝 + 𝑎0
have negative real parts.
In terms of the poles of the transfer function, its abscissa of convergence 𝜎𝑐
corresponds to the real part that is located furthest to the right in the p-plane. For
𝑝+3
example, if 𝐺(𝑝) = (𝑝+2)(𝑝+4) then the abscissa of convergence is 𝜎𝑐 = −2.

6.8 Routh-Hurwitz Criterion for stability


A necessary and sufficient condition for all roots of the characteristic equation to have
negative real parts, is that the determinants ∆𝑖 > 0 for 𝑖 = 1; 2; 3; … ; 𝑛.
Where the determinant ∆𝑖 is given as
𝑎𝑛−1 𝑎𝑛 0 0 ⋯ 0
𝑎𝑛−3 𝑎𝑛−2 𝑎𝑛−1 0 ⋯ 0
| 𝑎 𝑎𝑛−4 𝑎𝑛−3 𝑎𝑛−2 ⋯ 0 |
∆𝑖 =
| 𝑛−5 |
⋮ ⋮ ⋮ ⋮
𝑎𝑛−(2𝑖−1) 𝑎𝑛−2𝑖 𝑎𝑛−2𝑖−1 ⋯ 𝑎𝑛−𝑖

N.B. All the a’s with subscripts that are negative or greater than 𝒏 are replaced by
zeros.
106

Example 6.18
Use Routh-Hurwitz criterion to show that the roots of 𝑝4 + 9𝑝3 + 33𝑝2 + 51𝑝 + 26 = 0
have negative real parts.
Solution:
𝑛 = 4 ; 𝑎4 = 1 ; 𝑎3 = 9 ; 𝑎2 = 33 ; 𝑎1 = 51 ; 𝑎0 = 26
𝑎𝑖 = 0 (𝑖 > 4 𝑜𝑟 𝑖 < 0)
∆1 = |𝑎𝑛−1 ||𝑎3 | = |9| = 9
𝑎3 𝑎4 9 1
∆2 = | 𝑎 𝑎2 | = |51 | = 9(33) − 1(51) = 256
1 33
𝑎3 𝑎4 0 9 1 0
33 9 51 9
∆3 = | 𝑎1 𝑎2 𝑎3 | = |51 33 9 | = 9 | | −1| |
𝑎−1 𝑎0 𝑎1 26 51 0 51
0 26 51
= 9(33.51 − 9.26) − 1(51.51 − 0)
= 10440
9 1 0 0
51 33 9 1
∆4 = | | = 26 . ∆3 = 271440
0 26 51 33
0 0 0 26

Since ∆𝑖 > 0 𝑓𝑜𝑟 𝑖 = 1 ; 2; 3 𝑎𝑛𝑑 4. It then follows that all roots of the equation have
negative real parts.

Activity 6.5

1. Suppose the response 𝑥(𝑡) of a system with input 𝑢(𝑡) is determined by the
differential equation,
𝑥 (𝑖𝑣) − 𝑥 = 𝑢′
(a) Determine the transfer function characterizing the system.
(b) Given that all initial conditions are zero, show that the response is given by
1
ℎ(𝑡) = (𝑐𝑜𝑠ℎ𝑡 − 𝑐𝑜𝑠𝑡)
2
1
(c) Investigate the stability of the system ℎ(𝑡) = 2 (𝑐𝑜𝑠ℎ𝑡 − 𝑐𝑜𝑠𝑡) as impulse
response.
2. Let the response 𝑥(𝑡) of a system to a forcing function 𝑢(𝑡) be determined by
the differential equation model
𝑥 ″ + 2𝑥 ′ + 5𝑥 = 3𝑢′ + 2𝑢
(a) Determine the transfer function characterizing the system.
(b) Write down the characteristic equation of the system and state the order of
the system.
(c) Determine the transfer poles and zeros and illustrate them on the p-plane.
107

3. Which of the following transfer functions represent stable and unstable systems?
𝑝−1
(a) (𝑝+2)(𝑝2 +4)
(𝑝+2)(𝑝−2)
(b) (𝑝2 −1)(𝑝+4)
𝑝−4
(c) (𝑝+3)(𝑝+6)
8
(d) (𝑝2 +𝑝+4)(𝑝+2)2
4(𝑝+10)
(e) (𝑝2 −𝑝+10)(𝑝+5)

4. Which of the following characteristic equations represent stable systems?


(a) 𝑝2 − 4𝑝 + 13 = 0
(b) 5𝑝3 + 13𝑝2 + 31𝑝 + 15 = 0
(c) 𝑝3 + 𝑝2 + 𝑝 + 1 = 0
(d) 𝑝3 + 2𝑝2 + 2𝑝 + 1 = 0

6.9 The Impulse Response


From 𝑋(𝑝) = 𝐺(𝑝)𝑈(𝑝) we find that if 𝑢(𝑡) = 𝛿(𝑡), 𝑋(𝑝) = 𝐺(𝑝). (1)
∴ 𝑋(𝑝) = 𝐺(𝑝)
On taking inverse transforms we find that 𝑥(𝑡) = ℎ(𝑡), which is called the impulse
response of the system. It then follows that ℎ(𝑡) = ℒ −1 {𝑋(𝑝)} = ℒ −1 {𝐺(𝑝)}.

Definition 6.4
The impulse response to a linear time –invariant system is the response of the system
to a unit impulse applied at time 𝑡 = 0 when all initial conditions are zero. It is such
that ℒ{ℎ(𝑡)} = 𝐺(𝑝) where 𝐺(𝑝) is the system’s transfer function.
Since the impulse response is the inverse Laplace transform of the transfer function,
it follows that both the impulse response and transfer function carry the same
information about the dynamics of the system. Therefore, it is theoretically possible to
obtain the complete information about the system by exciting it with and impulse and
measuring the response. For this reason, it is common practice in engineering to
regard the transfer function as the Laplace transform of the impulse response, since
this places greater emphasis on the parameters of the system when considering
system design.
Characterizing a system by its impulse response, we can say that the system is stable
if its impulse response tends to zero when 𝑡 → ∞.
108

Example 6.19
Determine the impulse response to a linear system whose response 𝑥(𝑡) to an input
𝑢(𝑡) is determined by
𝑥 ″ + 5𝑥 ′ + 6𝑥 = 5𝑢(𝑡)
Solution:
The impulse response ℎ(𝑡) is the system’s response to 𝑢(𝑡) = 𝛿(𝑡) when initial
conditions are zero. Thus ℎ″ + 5ℎ′ + 6ℎ = 5𝛿(𝑡) subject to ℎ′ (0) = ℎ(0) = 0.
5
Clearly, (𝑝2 + 5𝑝 + 6)ℎ̃ = 5 and as a result ℎ̃ = (𝑝+2)(𝑝+3)

From 𝐻(𝑝) = 𝐺(𝑝) it follows that the system is stable since the poles 𝑝 = −2 and
𝑝 = −3 lie in the left half of the p-plane.
5 5 5
Now ℎ̃ = (𝑝+2)(𝑝+3) = 𝑝+2 − 𝑝+3 ⟹ ℎ(𝑡) = 5𝑒 −2𝑡 − 5𝑒 −3𝑡 and 5[𝑒 −2𝑡 − 𝑒 −3𝑡 ] → 0 as
𝑡 → ∞ which once again proves the stability of the system.

Example 6.20
Determine the impulse response 𝑥(𝑡) of a system with input 𝑢(𝑡) described
by the differential equation
𝑥 ‴ − 𝑥 ″ + 2𝑥ʹ = 2𝑢ʹ − 𝑢
Solution
𝑥 ‴ − 𝑥 ″ + 2𝑥ʹ = 2𝑢ʹ − 𝑢
𝑋(𝑝)[𝑝3 − 𝑝2 + 2𝑝] = 𝑈(𝑝)[2𝑝 − 1]
2𝑝−1 𝐴 𝐵𝑝+𝐶
𝐻(𝑝) = 𝑝(𝑝2 −𝑝+2) = 𝑝 + 𝑝2 −𝑝+2

2𝑝 − 1 = 𝐴(𝑝2 − 𝑝 + 2) + (𝐵𝑝 + 𝐶)𝑝


1
𝑝 = 0 ∶ −1 = 2𝐴 ⇒ 𝐴 = − 2
1
𝑝2 ∶ 0 = 𝐴 + 𝐵 ⇒ 𝐵 = 2
3
𝑝 ∶ 2 = −𝐴 + 𝐶 ⇒ 𝐶 = 2
1 7
−1 1 1 (p−2 )+2
ℎ(𝑡) = ℒ {− 2𝑝 + [ ]}
2 (p−1)2 +7
2 4

1 1
1 1 √7 7 √7
Finally, ℎ(𝑡) = − 2 + 2 𝑒 2𝑡 𝑐𝑜𝑠 𝑡 + 2√7 𝑒 2 𝑡 𝑠𝑖𝑛 𝑡
2 2
109

Activity 6.6
1. Determine the impulse response 𝑥(𝑡) of the given linear system whose reaction
to an input 𝑢(𝑡) is determined by the following differential equation:
(a) 𝑥 ″ + 15𝑥 ′ + 56𝑥 = 3𝑢(𝑡)
(b) 𝑥 ″ + 8𝑥 ′ + 25𝑥 = 𝑢(𝑡)
(c) 𝑥 ″ − 2𝑥 ′ − 8𝑥 = 4𝑢(𝑡)
(d) 𝑥 ″ − 4𝑥 ′ + 13𝑥 = 𝑢(𝑡)
2. Investigate the stability of each of the systems in exercise above.
3. Use the Routh-Hurwitz criterion to investigate the stability of systems having
the following characteristic equations:
(a) 24𝑝4 + 11𝑝3 + 26𝑝2 + 45𝑝 + 36 = 0
(b) 𝑝4 + 3𝑝3 + 32𝑝2 + 50𝑝 + 23 = 0
(c) 𝑝3 + 2𝑝2 + 4𝑝 + 8 = 0

6.10 Applications to beams


The problems we discuss in this section arise because we want to describe the
deflection (sag) of a homogeneous structure (beam) of length, say 𝐿, subject to some
transverse load. Generally, a beam may be mounted in a variety of ways, giving rise
to a particular set of boundary conditions.
Consider a beam of length 𝐿 , with a homogeneous elastic material (e.g. corrugated
iron sheet) whose ends are at 𝑥 = 0 𝑎𝑛𝑑 𝑥 = 𝑙. If we apply a load, given by 𝑊(𝑥) to
the beam in the vertical plane through the axis of symmetry (the 𝑥 − 𝑎𝑥𝑖𝑠), the beam
is bent. The axis is curved into an elastic deflection curve with transverse deflection
𝑦(𝑥) at the point 𝑥 described by the differential equation
𝑑4 𝑦 𝑊(𝑥)
= , 0<𝑥<𝑙
𝑑𝑥 4 𝐸𝐼

The quantity 𝐸𝐼 is called the flexural rigidity of the beam and we assume it to be
constant. The quantities 𝐸𝐼𝑌 ″ (𝑥) 𝑎𝑛𝑑 𝐸𝐼𝑌‴(𝑥) are called the bending moment and
𝑑3 𝑦
vertical shear at 𝑥. Finally the function 𝐹(𝑥) = 𝐸𝐼(𝑑𝑥 3 ) is called the shear force.

Note that the 𝑦 − 𝑎𝑥𝑖𝑠 is taken as positive downward so that deflections are positive
downward.
110

Boundary conditions associated with the differential equation depend on the way in
which the beam is supported. The following are some common forms of support.
1. Simply supported ends
𝑦(0) = 𝑦 ″ (0) = 0

𝑦(𝑙) = 𝑦 ″ (𝑙) = 0

𝑥=0 𝑥=𝑙

2. Fixed ends
𝑦(0) = 𝑦 ʹ (0) = 0

𝑦(𝑙) = 𝑦 ʹ (𝑙) = 0

𝑥=0 𝑥=𝑙

3. Free end
𝑦 ″ (0) = 𝑦 ‴ (0) = 0

𝑦″(𝑙) = 𝑦 ‴ (𝑙) = 0

𝑥=0 𝑥=0

𝑦(0) = 𝑦 ʹ (0) = 0

Example 6.21
A horizontal beam of length 𝑙 in metres is hinged at 𝑥 = 2 𝑎𝑛𝑑 𝑥 = 2 and carries a
uniform load 𝑊(𝑥) = 𝐻(𝑥 − 2) per unit length defined by
𝑑4 𝑦 𝐻(𝑥−2)
= , 2<𝑥<6
𝑑𝑥 4 100
3 1
subject to the boundary conditions 𝑦(0) = 𝑦 ʹ (0) = 0, 𝑦 ″ (0) = 40 , 𝑦 ‴ (0) = − 100
111

Determine,
(a) the deflection (sag) equation of the beam
(b) the defection when 𝑥 = 1 𝑚
(c) the bending moment when 𝑥 = 4 𝑚
Solution
𝑑4 𝑦 𝐻(𝑥−2) 3 1
= , 2 < 𝑥 < 6, 𝑦(0) = 𝑦 ʹ (0) = 0, 𝑦 ″ (0) = 40 , 𝑦 ‴ (0) = − 100
𝑑𝑥 4 100
1
𝑝4 𝑌(𝑝) − 𝑝3 𝑦(0) − 𝑝2 𝑦ʹ(0) − 𝑝𝑦 ″ (0) − 𝑦 ‴ (0) = 100𝑝 𝑒 −2𝑝
1 3 1
𝑝4 𝑌(𝑝) = 100𝑝 𝑒 −2𝑝 + 40 𝑝 − 100
1 3 1
𝑌(𝑝) = 100𝑝5 𝑒 −2𝑝 + 40𝑝3 − 100𝑝4

1 4! 3 2! 1 3!
(a) 𝑦(𝑥) = 100×4! ℒ −1 {𝑝5 𝑒 −2𝑝 } + 40×2! ℒ −1 {𝑝3} − 100×3! ℒ −1 {𝑝4}
1 3 1
= 2400 (𝑥 − 2)4 + 80 𝑥 2 − 600 𝑥 3
3 1
𝑥 2 − 600 𝑥 3 , 0 < 𝑥 ≤ 2
80
= {3 1 1
𝑥 2 − 600 𝑥 3 + 2400 (𝑥 − 2)4 , 2 < 𝑥 ≤ 6
80

3 1
(b) 𝑦(1) = 80 (1)2 − 600 (1)3 ≈ 0,036 𝑚

6 3 4(𝑥−2)3
(c) 𝑦ʹ(𝑥) = 80 𝑥 − 600 𝑥 2 + 2400

6 6 12(𝑥−2)2
𝑦″(𝑥) = 80 − 600 𝑥 + 2400

6 6 12(4−2)2
𝑦″(4) = 80 − 600 (4) + ≈ 0,055
2400

Bending moment is 𝐸𝐼𝑌 ″ (4) = 100 × 0,055 = 5,5

Activity 6.7
1. A horizontal beam of length 𝑙 = 10 in meters is hinged at 𝑥 = 0 𝑎𝑛𝑑 𝑥 = 10 and
carries a uniform load 𝑊(𝑥) = 𝐻(𝑥 − 5) per unit length defined by
𝑑4 𝑦 𝐻(𝑥−5)
= , 0 < 𝑥 < 10
𝑑𝑥 4 5000
3 1
subject to the boundary conditions 𝑦(0) = 𝑦 ʹ (0) = 0, 𝑦 ″ (0) = 400 , 𝑦 ‴ (0) = − 1000

Determine,
(a) the deflection (sag) 𝑦(𝑥) of the beam
112

(b) the defection when 𝑥 = 6 𝑚


(c) the vertical shear when 𝑥 = 4 𝑚
2. A horizontal beam of length 𝑙 in meters is hinged at 𝑥 = 2 𝑎𝑛𝑑 𝑥 = 2 and carries
a uniform load 𝑊(𝑥) = 𝛿(𝑥 − 2) per unit length defined by
𝑑4 𝑦 𝛿(𝑥−2)
= , 0 < 𝑥 < 10
𝑑𝑥 4 25
1 2
subject to the boundary conditions 𝑦(0) = 𝑦 ʹ (0) = 0, 𝑦 ″ (0) = 5 , 𝑦 ‴ (0) = − 25

Determine,
(a) the deflection 𝑦(𝑥) of the beam
(b) the defection when 𝑥 = 6 𝑚
(c) the vertical shear when 𝑥 = 4 𝑚
(d) the shear force at 𝑥 = 4 𝑚
113

FORMULA SHEET

Linear interpolation polynomial


For points 𝑅(𝑥0 ; 𝑦0 ) 𝑎𝑛𝑑 𝑆(𝑥1 ; 𝑦1 )
𝑃(𝑥) ≈ 𝑓(𝑥) = 𝐿0 𝑓(𝑥0 ) + 𝐿1 𝑓(𝑥1 )

𝑥−𝑥1 𝑥−𝑥0
where 𝐿0 = 𝑥 , 𝐿1 = 𝑥
0 −𝑥1 1 −𝑥0

Quadratic Interpolation polynomial


Given points 𝑅(𝑥0 ; 𝑦0 ) , 𝑆(𝑥1 ; 𝑦1 ) 𝑎𝑛𝑑 𝑇(𝑥2 ; 𝑦2 )
𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥0 𝑥−𝑥2 𝑥−𝑥0 𝑥−𝑥1
𝑃(𝑥) ≈ 𝑓(𝑥) = 𝑥 ×𝑥 𝑓(𝑥0 ) + 𝑥 ×𝑥 𝑓(𝑥1 ) + 𝑥 ×𝑥 𝑓(𝑥2 )
0 −𝑥1 0 −𝑥2 1 −𝑥0 1 −𝑥2 2 −𝑥0 2 −𝑥1

Lagrange interpolation polynomials


𝑥−𝑥1 𝑥−𝑥0
𝐹𝑖𝑟𝑠𝑡 𝑜𝑟𝑑𝑒𝑟/𝑘𝑖𝑛𝑑: 𝑃1 (𝑥) ≈ 𝑓1 (𝑥) = 𝑥 𝑓(𝑥0 ) + 𝑓(𝑥1 )
0 −𝑥1 𝑥1 −𝑥0

(𝑥−𝑥1 )(𝑥−𝑥2 (𝑥−𝑥0 )(𝑥−𝑥2 )


𝑆𝑒𝑐𝑜𝑛𝑑 𝑜𝑟𝑑𝑒𝑟/𝑘𝑖𝑛𝑑: 𝑃2 (𝑥) ≈ 𝑓2 (𝑥) = (𝑥 𝑓(𝑥0 ) + 𝑓(𝑥1 )
0 −𝑥1 )(𝑥0 −𝑥2 ) (𝑥1 −𝑥0 )(𝑥1 −𝑥2)

Forward difference polynomial


𝑝∆𝑦1 𝑝(𝑝−1)∆2 𝑦2 𝑝(𝑝−1)(𝑝−2)∆3 𝑦3
𝑃(𝑥0 + 𝑝ℎ) = 𝑦0 + 1!
+ 2!
+ 3!
+⋯
𝑝(𝑝−1)(𝑝−2)(𝑝−3)…(𝑝−𝑛+1)∆𝑛 𝑦𝑛
+ 𝑛!
𝑏−𝑎 𝑥−𝑥0
where ℎ = 𝑛−1 and 𝑝 = ℎ

Backward difference polynomial


𝑝∆𝑦1 𝑝(𝑝+1)∆2 𝑦2 𝑝(𝑝+1)(𝑝+2)∆3 𝑦3
𝑃(𝑥0 + 𝑝ℎ) = 𝑦𝑛 + + + +⋯
1! 2! 3!

𝑝(𝑝+1)(𝑝+2)(𝑝+3)…(𝑝+𝑛−1)∆𝑛 𝑦𝑛
+ 𝑛!
𝑏−𝑎 𝑥−𝑥𝑛
where ℎ = 𝑛−1 and 𝑝 = ℎ
114

Divided difference polynomial


Given data points 𝑥0 , 𝑥1 , 𝑥2 , …. and 𝑦0 = 𝑓(𝑥0 ), 𝑦1 = 𝑓(𝑥1 ), 𝑦2 = 𝑓(𝑥2 ), …
𝑃(𝑥) ≈ 𝑓(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 )𝑓(𝑥0 ; 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓(𝑥0 ; 𝑥1 ; 𝑥2 )
+(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )𝑓(𝑥0 ; 𝑥1 ; 𝑥2 ; 𝑥3 ) + ⋯
𝑓(𝑥1 )−𝑓(𝑥0 ) 𝑓(𝑥2 )−𝑓(𝑥1 )
where (𝑥0 ; 𝑥1 ) = , 𝑓(𝑥1 ; 𝑥2 ) = , ….
𝑥1 −𝑥0 𝑥2 −𝑥1

Euler’s method
𝒚𝒏+𝟏 = 𝒉𝒇(𝒙𝒏 ; 𝒚𝒏 ), 𝒏 = 𝟎, 𝟏, 𝟐, …

𝟏
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝟐 (𝒌𝟏 + 𝒌𝟐 ) , 𝒏 = 𝟎, 𝟏, 𝟐, …

Euler’s method
From Euler’s formula for first order differential equations the corresponding second
order form starts with
𝒉𝟐
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒚′𝒏 + 𝒚′′
𝒏 , 𝒏 = 𝟎, 𝟏 𝟐, …
𝟐!

to approximates 𝑦(𝑥𝑛+1 ) and then determine


𝑦′𝒏+𝟏 = 𝑦𝑛′ + ℎ𝑦𝑛′′

Runge-Kutta
Given the differential equation 𝑦 ′′ = 𝑓(𝑥; 𝑦; 𝑦 ′ )
subject to the conditions 𝑦(𝑥0 ) = 𝑦0 and 𝑦 ′ (𝑥0 ) = 𝑦0′
The range of initial iteration steps are given by
1
𝑘1 = 2 ℎ2 𝑓(𝑥𝑛 ; 𝑦𝑛 ; 𝑦𝑛′ )
1 ℎ ℎ 1 𝑘1
𝑘2 = 2 ℎ2 𝑓(𝑥𝑛 + 2 ; 𝑦𝑛 + 2 𝑦𝑛′ + 4 𝑘1 ; 𝑦𝑛′ + )

1 ℎ ℎ 1 𝑘2
𝑘3 = 2 ℎ2 𝑓(𝑥𝑛 + 2 ; 𝑦𝑛 + 2 𝑦𝑛′ + 4 𝑘1 ; 𝑦𝑛′ + )

1 ℎ 2𝑘3
𝑘4 = 2 ℎ2 𝑓(𝑥𝑛 + ℎ ; 𝑦𝑛 + 2 𝑦𝑛′ + 𝑘3 ; 𝑦𝑛′ + )

115

Auxiliary iteration quantities are given by


1
𝐴 = 3 [𝑘1 + 𝑘2 + 𝑘3 ]
1
𝐵 = 3 [𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ]

Then
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑦𝑛′ + 𝐴
and
𝐵
𝑦′𝑛+1 = 𝑦′𝑛 + ℎ

Finite difference equation


Given a differential equation
𝑦 ″ + 𝑃(𝑥)𝑦ʹ + 𝑄(𝑥)𝑦 = 𝑓(𝑥) , 𝑤ℎ𝑒𝑟𝑒 𝑦(𝑎) = 𝛼 𝑎𝑛𝑑 𝑦(𝑏) = 𝛽
where 𝑃𝑖 = 𝑃(𝑥𝑖 ), 𝑄𝑖 = 𝑄(𝑥𝑖 ), 𝑓𝑖 = 𝑓(𝑥𝑖 ) , 𝑖 = 1, 2, 3, …
then the finite difference equation is given by
𝒉 𝒉
(𝟏 + 𝟐 𝑷𝒊 ) 𝒚𝒊+𝟏 + (−𝟐 + 𝒉𝟐 𝑸𝒊 )𝒚𝒊 + (𝟏 − 𝟐 𝑷𝒊 ) 𝒚𝒊−𝟏 = 𝒉𝟐 𝒇𝒊

Method of undetermined coefficients (Some trial solutions)

𝒇(𝒙) 𝒚𝑷𝑰
1. 𝑘 (𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡) 𝐴
2. 𝑘𝑥 + 𝑏 𝐴𝑥 + 𝐵
3. 𝑘𝑥 2 𝐴𝑥 2 + 𝐵𝑥 + 𝐶
4. 𝐴𝑒 𝑏𝑥 , 𝐴𝑒 −𝑏𝑥
𝑘𝑒 𝑏𝑥 , 𝑘𝑒 −𝑏𝑥

5. 𝑘𝑥𝑒 𝑏𝑥 (𝐴𝑥 + 𝐵)𝑒 𝑏𝑥


6. 𝑠𝑖𝑛𝑏𝑥 , 𝑐𝑜𝑠𝑏𝑥 𝐴𝑐𝑜𝑠𝑏𝑥 + 𝐵𝑠𝑖𝑛𝑏𝑥
7. 𝑘𝑥𝑠𝑖𝑛𝑏𝑥, 𝑘𝑥𝑐𝑜𝑠𝑏𝑥 (𝐴𝑥 + 𝐵)(𝐶𝑠𝑖𝑛𝑏𝑥 + 𝐷𝑐𝑜𝑠𝑏𝑥)

8. (𝐴𝑥 + 𝐵)(𝐶𝑠𝑖𝑛ℎ𝑏𝑥 + 𝐷𝑐𝑜𝑠ℎ𝑏𝑥)


𝑘𝑥𝑠𝑖𝑛ℎ𝑏𝑥, 𝑘𝑥𝑐𝑜𝑠ℎ𝑏𝑥
9. 𝑘𝑒 𝑎𝑥 𝑐𝑜𝑠𝑏𝑥, 𝑘𝑒 𝑎𝑥 𝑠𝑖𝑛𝑏𝑥 𝐴𝑒 𝑎𝑥 𝑐𝑜𝑠𝑏𝑥 + 𝐵𝑒 𝑎𝑥 𝑠𝑖𝑛𝑏𝑥
116

Table of Laplace Transforms


𝑓(𝑡) ℒ{𝑓(𝑡)} = ∫ 𝑒 −𝑝𝑡 𝑓(𝑡)𝑑𝑡 = 𝐹(𝑝)


0
1 0
𝑡 =1 1
𝑝
2 𝑡𝑛 𝑛!
𝑝𝑛+1
3 𝑒 𝑏𝑡 1
𝑝−𝑏
4 𝑠𝑖𝑛𝑎𝑡 𝑎
𝑝 + 𝑎2
2

5 𝑐𝑜𝑠𝑎𝑡 𝑝
𝑝2 + 𝑎2
6 𝑠𝑖𝑛ℎ𝑎𝑡 𝑎
𝑝2 − 𝑎2
7 𝑐𝑜𝑠ℎ𝑎𝑡 𝑝
𝑝2 − 𝑎2
8 𝑡 𝑛 𝑒 𝑏𝑡 𝑛!
(𝑝 − 𝑏)𝑛+1
9 𝑒 𝑏𝑡 𝑠𝑖𝑛𝑎𝑡 𝑎
(𝑝 − 𝑏)2 + 𝑎2
10 𝑒 𝑏𝑡 𝑐𝑜𝑠𝑎𝑡 𝑝−𝑏
(𝑝 − 𝑏)2 + 𝑎2
11 𝑒 𝑏𝑡 𝑠𝑖𝑛ℎ𝑎𝑡 𝑎
(𝑝 − 𝑏)2 − 𝑎2
12 𝑒 𝑏𝑡 𝑐𝑜𝑠ℎ𝑎𝑡 𝑝−𝑏
(𝑝 − 𝑏)2 − 𝑎2
13
𝐻(𝑡 − 𝑘) = {
0 , 𝑖𝑓 𝑡 < 𝑘 𝑒 −𝑘𝑝
1 , 𝑡≥𝑘 𝑝
𝑓(𝑡 − 𝑘)𝐻(𝑡 − 𝑘) −𝑘𝑝
14 𝑒 ℒ{𝑓(𝑡)}
15 𝛿(𝑡 − 𝑘) 𝑒 −𝑘𝑝
16 𝑑𝑦 𝑝ℒ{𝑦} − 𝑦(0) = 𝑝𝑦̃ − 𝑦(0)
𝑑𝑡
17 𝑑2𝑦 𝑝2 𝑦̃ − 𝑝𝑦(0) − 𝑦ʹ(0)
𝑑𝑡 2
18 𝑑3𝑦 𝑝3 𝑦̃ − 𝑝2 𝑦(0) − 𝑝𝑦ʹ(0) − 𝑦″(0)
𝑑𝑡 3
19 𝑑4𝑦 𝑝4 𝑦̃ − 𝑝3 𝑦(0) − 𝑝2 𝑦ʹ(0) − 𝑝𝑦 ″ (0) − 𝑦‴(0)
𝑑𝑡 4
117

Answers to selected activities


Class activity page 101
4 4
𝑥1 (𝑡) = − 3 𝑐𝑜𝑠2𝑡 + 3 𝑐𝑜𝑠𝑡
2 4
𝑥2 (𝑡) = 3 𝑐𝑜𝑠2𝑡 + 3 𝑐𝑜𝑠𝑡

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy