You are on page 1of 214

NKAY STUDY NANA KWABENA

Problem Set#1
Multiple Choice Test
Chapter 01.04 Binary Representation
COMPLETE SOLUTION SET

1. 2510  ?2

NKAY
(A) 100110
(B) 10011
(C) 11001
(D) 110010

Solution
The correct answer is (C).

Quotient Remainder
25/2 12 1
12/2 6 0
6/2 3 0
3/2 1 1
1/2 0 1

The binary representation is therefore


2510  110012

NKAY NKAY
NKAY STUDY NANA KWABENA

2. 11012  ?10

NKAY
(A) 3
(B) 13
(C) 15
(D) 26

Solution
The correct answer is (B).

To convert from base 2 to base 10,


11012  1  2 0  0  21  1  2 2  1  2 3
 1 0  4  8
 13

NKAY NKAY
NKAY STUDY NANA KWABENA

3. 25.37510  ? . ?2
(A) 100110.011
(B) 11001.011
(C) 10011.0011
(D) 10011.110

Solution

NKAY
The correct answer is (B).

Integer portion:
Quotient Remainder
25/2 12 1
12/2 6 0
6/2 3 0
3/2 1 1
1/2 0 1

Decimal portion:

Number Number after decimal Number before decimal


0.375  2 0.750 0.750 0
0.750  2 1.500 0.500 1
0.500  2 1.000 0 1

25.37510  11001.0112

NKAY NKAY
NKAY STUDY NANA KWABENA

4. Representing 2 in a fixed point register with 2 bits for the integer part and 3 bits for
the fractional part gives a round off error of most nearly
(A) -0.085709
(B) 0.0392
(C) 0.1642
(D) 0.2892

Solution
The correct answer is (B).

2  1.4142

NKAY
If two bits for the integer portion are used,
110  012  12
Decimal portion:
Number Number after decimal Number before decimal
0.4142  2 0.8284 0.8284 0
0.8284  2 1.6568 0.6568 1
0.6568  2 1.3136 0.3136 1

Since only three bits are allowed,


0.414210  0.0112
Total approximation
1.414210  1.0112
Converting 1.0112 back to base 10 yields
1.0112  1  2 0  0  2 1  1  2 2  1  2 3
 1.37510
Subtracting gives the round-off error as
1.4142  1.3750  0.0392

NKAY NKAY
NKAY STUDY NANA KWABENA

5. An engineer working for the Department of Defense is writing a program that


transfers non-negative real numbers to integer format. To avoid overflow problems, the

NKAY
maximum non-negative integer that can be represented in a 5-bit integer word is
(A) 16
(B) 31
(C) 63
(D) 64

Solution
The correct answer is (B).

The maximum non-negative integer that can be represented using 5 bits is given by
 
111112  1  2 0  1  21  1  2 2  1  2 3  1  2 4
 1  2  4  8  16
 31

NKAY NKAY
NKAY STUDY NANA KWABENA

6. For a numerically controlled machine, integers need to be stored in a memory


location. The minimum number of bits needed for an integer word to represent all
integers between 0 and 1024 is
(A) 8

NKAY
(B) 9
(C) 10
(D) 11

Solution
The correct answer is (D).

The maximum number that can be represented is related to the number of bits. Using 10
bits gives,
11111111112
 1  2 0  1  21  1  2 2  1  2 3  1  2 4  1  2 5  1  2 6  1  2 7  1  2 8  1  2 9 
 1023

This is too small, so one more bit is needed for an accurate approximation, that is, a total
of 11 bits are needed.

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY

NKAY NKAY
NKAY STUDY NANA KWABENA

Problem Set #1
Multiple Choice Test
Chapter 01.05 Floating Point Representation
COMPLETE SOLUTION SET

1. A hypothetical computer stores real numbers in floating point format in 8-bit words.
The first bit is used for the sign of the number, the second bit for the sign of the exponent,
the next two bits for the magnitude of the exponent, and the next four bits for the
magnitude of the mantissa. Represent e ≈ 2.718 in the 8-bit format.
(A) 00010101
(B) 00011010
(C) 00010011
(D) 00101010

Solution
The correct answer is (A).

NKAY
Finding (2 )10 = (? )2

Quotient Remainder
2/2 1 0
1/2 0 1

Hence (2)10 = (10)2

Finding (0.718)10 = (? )2
Number Number after decimal Number before decimal
0.718 × 2 1.436 0.436 1
0.436 × 2 0.872 0.872 0
0.872 × 2 1.744 0.744 1
0.744 × 2 1.488 0.488 1

(0.718)10 ≈ (0.101)2
(2.718)10 ≈ (10.101)2
= (1.0101)2 × 2 (1)10

= (1.0101)2 × 2 (01)2

Bits in mantissa = 0101


Bits in exponent = 01
Sign number bit = 0
Sign exponent bit = 0
The final floating point representation is 00010101.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. A hypothetical computer stores real numbers in floating point format in 8-bit words.
The first bit is used for the sign of the number, the second bit for the sign of the exponent,
the next two bits for the magnitude of the exponent, and the next four bits for the
magnitude of the mantissa. The base-10 number (10100111) 2 represents in the above
given 8-bit format is
(A) -5.75
(B) -2.875
(C) -1.75
(D) -0.359375

NKAY
Solution
The correct answer is (A).

The number is 10100111


Sign number bit = 1
Sign of number is negative
Sign exponent bit = 0
Sign of exponent is positive
Bits in exponent = 10
(10 )2 = 1 × 21 + 0 × 2 0
= (2 )10
Bits in mantissa = 0111
(1.0111)2 = 1 × 2 0 + 0 × 2 −1 + 1 × 2 −2 + 1 × 2 −3 + 1 × 2 −4
= (1.4375)10
Hence, the number in base-10 is
= − 1.4375 × 2 2
= −5.75

NKAY NKAY
NKAY STUDY NANA KWABENA

3. A hypothetical computer stores floating point numbers in 8-bit words. The first bit is
used for the sign of the number, the second bit for the sign of the exponent, the next two
bits for the magnitude of the exponent, and the next four bits for the magnitude of the

NKAY
mantissa. The machine epsilon is most nearly
(A) 2 −8
(B) 2 −4
(C) 2 −3
(D) 2 −2

Solution
The correct answer is (B).

The machine epsilon is


ε mach = 2 − (number of bits for mantissa )
= 2 −4

NKAY NKAY
NKAY STUDY NANA KWABENA

4. A machine stores floating point numbers in 7-bit word. The first bit is used for the
sign of the number, the next three for the biased exponent and the next three for the
magnitude of the mantissa. The number (0010110) 2 represented in base-10 is
(A) 0.375
(B) 0.875
(C) 1.5
(D) 3.5

NKAY
Solution
The correct answer is (B).

Sign bit of number = 0


Hence, the number is positive
Bits in biased exponent = 010

Thus, it is biased by 3 as the maximum value in the biased exponent is (111)2 = 7 . So the
exponent is (010)2 − 3 = 2 − 3 = −1 .
Bits in mantissa = 110
(1.110 )2 = 1 × 2 0 + 1 × 2 −1 + 1 × 2 −2 + 0 × 2 −3
= (1.75)10
Hence, the number in base-10 is
= (1.75) × 2 −1
= (0.875)10

NKAY NKAY
NKAY STUDY NANA KWABENA

5. A machine stores floating point numbers in 7-bit word. The first bit is stored for the
sign of the number, the next three for the biased exponent and the next three for the
magnitude of the mantissa. You are asked to represent 33.35 in the above word. The
error you will get in this case would be
(A) underflow
(B) overflow
(C) NaN
(D) No error will be registered

Solution
The correct answer is (B).
(33)10 = (?????)2
Quotient Remainder

NKAY
33/2 16 1
16/2 8 0
8/2 4 0
4/2 2 0
2/2 1 0
1/2 0 1

Therefore,
(33)10 = (100001)2
Number Number after decimal Number before decimal
0.35 × 2 0.70 0.70 0
0.70 × 2 1.40 0.40 1
0.40 × 2 0.80 0.80 0

(0.35)10 ≈ (0.01…)2
(33.35)10 ≈ (100001.01)2
= (1.0000101)2 × 2 5
= (1.0000101)2 × 2 (101)
2

The biased exponent has 3 bits, so the biased exponent varies from 0 to (111)2 = (7 )10 .
So the exponent can vary from -3 to 4. Hence the number (33.35)10 which has an
exponent of 5 would overflow.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. A hypothetical computer stores floating point numbers in 9-bit words. The first bit is
used for the sign of the number, the second bit for the sign of the exponent, the next three
bits for the magnitude of the exponent, and the next four bits for the magnitude of the
mantissa. Every second, the error between 0.1 and its binary representation in the 9-bit
word is accumulated. The accumulated error after one day most nearly is
(A) 0.002344
(B) 20.25
(C) 202.5
(D) 8640

Solution
The correct answer is C.

Number Number after decimal Number before decimal


0.1× 2 0.2 0.2 0
0.2 × 2 0.4 0.4 0

NKAY
0.4 × 2 0.8 0.8 0

0.8 × 2 1.6 0.6 1


0.6 × 2 1.2 0.2 1

0.2 × 2 0.4 0.4 0

0.4 × 2 0.8 0.8 0

0.8 × 2 1.6 0.6 1

0.6 × 2 1.2 0.2 1

(0.1)10 = (0.000110011…)2
≈ (1.1001)2 × 2 −4
= (1.1001)2 × 2 −(100 ) 2

Thus, (0.1)10 is represented approximately by


(0.1)10 ≈ (1 × 2 0 + 1 × 2 −1 + 0 × 2 −2 + 0 × 2 −3 + 1 × 2 −4 )× 2 −4
= 0.09765625
The difference is = 0.1 − 0.09765625
= 0.00234375
This difference is accumulated every second for one day, giving the accumulated error as
= 0.00234375× 60 × 60 × 24
= 202.5

NKAY NKAY
NKAY STUDY NANA KWABENA

Problem Set#1
Multiple Choice Test
Chapter 01.02 Measuring Errors

NKAY
COMPLETE SOLUTION SET

1. True error is defined as


(A) Present Approximation – Previous Approximation
(B) True Value – Approximate Value
(C) abs (True Value – Approximate Value)
(D) abs (Present Approximation – Previous Approximation)

Solution
The correct answer is (B).

True error is defined as the difference between the exact (true) value and the approximate
value.

NKAY NKAY
NKAY STUDY NANA KWABENA

π
2. The expression for true error in calculating the derivative of sin(2 x ) at x = by
4
f (x + h ) − f (x )
using the approximate expression f ′( x ) ≈ is
h
h − cos(2h ) − 1
(A)
h
h − cos(h ) − 1
(B)
h
1 − cos(2h )
(C)
h
sin (2h )
(D)
h

Solution
The correct answer is (C).
Exact answer

NKAY
f ( x ) = sin( 2 x )
f ′( x ) = 2 cos( 2 x )
⎛π ⎞ ⎛ π⎞
f ′⎜ ⎟ = 2 cos⎜ 2 ⎟
⎝4⎠ ⎝ 4⎠
=0
Approximate Solution
f (x + h ) − f (x )
f ′( x ) ≈
h
f ( x ) = sin( 2 x )
sin( 2( x + h)) − sin( 2 x)
f ′( x) ≅
h
sin( 2 x ) cos( 2h ) + cos( 2 x ) sin( 2h ) − sin( 2 x )
=
h
⎛ π⎞ ⎛ π⎞ ⎛ π⎞
sin⎜ 2 ⎟ cos(2h ) + cos⎜ 2 ⎟ sin(2h ) − sin⎜ 2 ⎟
⎛π ⎞ 4⎠ ⎝ 4⎠ ⎝ 4⎠
f ′⎜ ⎟ ≅ ⎝
⎝4⎠ h
⎛π ⎞ ⎛π ⎞ ⎛π ⎞
sin⎜ ⎟ cos(2h ) + cos⎜ ⎟ sin(2h ) − sin⎜ ⎟
= ⎝2⎠ ⎝2⎠ ⎝2⎠
h
(1) cos( 2h ) + (0) sin( 2h ) − 1
=
h
cos( 2h ) − 1
=
h

Et = True Value – Approximate Value

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
cos(2h ) − 1
=0−
h
1 − cos( 2h)
=
h

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The relative approximate error at the end of an iteration to find the root of an
equation is 0.004% . The least number of significant digits we can trust in the
solution is
(A) 2
(B) 3
(C) 4

NKAY
(D) 5

Solution
The correct answer is (C).

If ∈a < 0.5 × 10 2−m , then at least m significant digits are correct in the answer.
0.004 < 0.5 × 10 2 − m for m = 4 as the largest possible value of m.
0.5 × 10 2 −m = 0.004
0.004
10 2 −m =
0 .5
= 0.008

( )
log 10 10 2 −m = log 10 (0.008 )
2 − m = −2.0969
m = 4.0969
The integer part of the solution is m = 4 .

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
4. The number 0.01850 × 10 3 has ________ significant digits
(A) 3
(B) 4
(C) 5
(D) 6

Solution
The correct answer is (B).

The number 0.01850 × 10 3 has 4 significant digits. The trailing zero in the number is
significant, while all the leading zeros are not significant.

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The following gas stations were cited for irregular dispensation by the Department of
Agriculture. Which one cheated you the most?
Station Actual Gasoline
Gasoline Reading at
dispensed pump
Ser 9.90 10.00
Cit 19.90 20.00
Hus 29.80 30.00
She 29.95 30.00

NKAY
(A) Ser
(B) Cit
(C) Hus
(D) She

Solution
The correct answer is (A).

The conclusion for this question will be based on relative true errors.
9.90 − 10.00
∈t = × 100 = −1.0101% (Ser)
9.90
19.90 − 20.00
∈t = × 100 = −0.50251% (Cit)
19.90
29.80 − 30.00
∈t = × 100 = −0.67114% (Hus)
29.80
29.95 − 30.00
∈t = × 100 = −0.16694% (She)
29.95

The gas station that cheated you the most is Ser as it has the largest magnitude of a
negative relative true error of 1.0101%.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The number of significant digits in the number 219900 is


(E) 4

NKAY
(F) 5
(G) 6
(H) 4 or 5 or 6

Solution
The correct answer is (D).

In this case, the number of significant digits can be 4, 5 or 6. The trailing zeros may or
may not be significant. For example, if someone asked you what is the population of
Tampa, you generally will reply as 325,000. However, if someone was refunding taxes
to every citizen of Tampa, you will need the exact number which very well could be
exactly 325,000 or 325,200 or 325,221 or 325,214.

NKAY NKAY
NKAY STUDY NANA KWABENA

Problem Set#1
Multiple Choice Test
Chapter 01.06 Propagation Errors
COMPLETE SOLUTION SET

1. If A = 3.56 ± 0.05 and B = 3.25 ± 0.04 , the values of A + B are


(A) 6.81 ≤ A + B ≤ 6.90
(B) 6.72 ≤ A + B ≤ 6.90

NKAY
(C) 6.81 ≤ A + B ≤ 6.81
(D) 6.71 ≤ A + B ≤ 6.91

Solution
The correct answer is (B).

A = 3.50 ± 0.05
Hence
3.56 − 0.05 ≤ A ≤ 3.56 + 0.05
3.51 ≤ A ≤ 3.61

B = 3.25 ± 0.04
Hence
3.25 − 0.04 ≤ B ≤ 3.25 + 0.04
3.21 ≤ B ≤ 3.29
Hence
3.51 + 3.21 ≤ A + B ≤ 3.61 + 3.29
6.72 ≤ A + B ≤ 6.90

NKAY NKAY
NKAY STUDY NANA KWABENA

2. A number A is correctly rounded to 3.18 from a given number B. Then A − B ≤ C ,

NKAY
where C is
(A) 0.005
(B) 0.01
(C) 0.18
(D) 0.09999

Solution
The correct answer is (A).

Since A is rounded off to 3.18, the number can be 3.17 XYZ … where X is a number
between 5 and 9 or 3.18 XYZ where X is a number between 0 and 4. Hence,
A − B ≤ C makes C = 0.005

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Two numbers A and B are approximated as C and D, respectively. The relative error
in C × D is given by
⎛ A−C ⎞ ⎛ B− D⎞
(A) ⎜ ⎟×⎜ ⎟
⎝ A ⎠ ⎝ B ⎠
⎛ A−C ⎞ ⎛ B − D⎞ ⎛ A−C ⎞ ⎛ B − D⎞
(B) ⎜ ⎟+⎜ ⎟+⎜ ⎟×⎜ ⎟
⎝ A ⎠ ⎝ B ⎠ ⎝ A ⎠ ⎝ B ⎠
⎛ A−C ⎞ ⎛ B − D⎞ ⎛ A−C ⎞ ⎛ B − D⎞
(C) ⎜ ⎟+⎜ ⎟−⎜ ⎟×⎜ ⎟
⎝ A ⎠ ⎝ B ⎠ ⎝ A ⎠ ⎝ B ⎠
⎛ A−C ⎞ ⎛ B− D⎞
(D) ⎜ ⎟−⎜ ⎟
⎝ A ⎠ ⎝ B ⎠

NKAY
Solution
The correct answer is (C).

A× B − C × D
Rel (C × D ) =
A× B

True Error = True Value – Approximate Value


Approximate Value = True Value – True Error
C = A −α
D= B−β
Where α and β are the true errors in the representation of A and B, respectively.
AB − ( A − α )( B − β )
Rel (CD ) =
AB
AB − AB + Bα + Aβ − αβ
=
AB
AB cancels which yields,
α β α β
Rel (CD ) = + −
A B AB
= Rel(A) + Rel(B) + Rel(A)Rel(B)
⎛ A−C ⎞ ⎛ B− D⎞ ⎛ A−C ⎞ ⎛ B− D⎞
=⎜ ⎟+⎜ ⎟−⎜ ⎟×⎜ ⎟
⎝ A ⎠ ⎝ B ⎠ ⎝ A ⎠ ⎝ B ⎠

NKAY NKAY
NKAY STUDY NANA KWABENA

F
4. The formula for normal strain in a longitudinal bar is given by ∈= where
AE
F = normal force applied
A = cross-sectional area of the bar
E = Young’s modulus
If F = 50 ± 0.5 N , A = 0.2 ± 0.002 m 2 , and E = 210 × 109 ± 1 × 10 9 Pa , the maximum
error in the measurement of strain is
(A) 10 −12
(B) 2.95 × 10 −11
(C) 1.22 × 10 −9

NKAY
(D) 1.19 × 10 −9
Solution
The correct answer is (B).

The total error for strain is given by


∂∈ ∂∈ ∂∈
| Δ ∈|= ΔF + ΔA + ΔE
∂F ∂A ∂E
The partial derivatives are then
∂∈ 1 ∂∈ F ∂∈ F
= , =− 2 , =−
∂F AE ∂A A E ∂E AE 2
The total error for strain is then
⎛ 1 ⎞ ⎛ −F ⎞ ⎛ −F ⎞
| Δ ∈| = ⎜ ⎟ ΔF + ⎜ 2 ⎟ ΔA + ⎜ 2 ⎟
ΔE
⎝ AE ⎠ ⎝A E⎠ ⎝ AE ⎠

⎛ 1 ⎞ ⎛ − 50 ⎞ ⎛ − 50 ⎞
| Δ ∈| = ⎜⎜ 9 ⎟
⎟(0.5) + ⎜⎜ 9 ⎟
⎟(0.002) + ⎜⎜ 9 ⎟
⎟(1 × 109 )
⎝ ( 0.2 )( 210 × 10 ) ⎠ ⎝ ( 0.2 ) 2
( 210 × 10 ) ⎠ ⎝ ( 0.2 )( 210 × 10 ) ⎠

| Δ ∈| = 1.19 × 10 −11 + 1.19 × 10 −11 + 5.67 × 10 −12 = 2.95 × 10 −11

NKAY NKAY
NKAY STUDY NANA KWABENA

5. A wooden block is measured to be 60mm by a ruler and the measurements are

NKAY
considered to be good to 1/4th of a millimeter. Then in the measurement 60mm, we have
. . significant digits
(A) 0
(B) 1
(C) 2
(D) 3

Solution
The correct answer is (C).

We are given the uncertainty is within 1/4th of a millimeter so at least 2 significant digits
are accurate.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. In the calculation of the volume of a cube of nominal size 5" , the uncertainty in the
measurement of each side is 10%. The uncertainty in the measurement of the volume
would be
(A) 5.477%
(B) 10.00%
(C) 17.32%
(D) 30.00%

Solution
The correct answer is (D).

NKAY
For this problem, V = a 3 where a is the length of the side of the cube.
dV
ΔV = Δa
da
= 3a 2 Δa
a3
ΔV = 3 Δa
a
V
ΔV = 3 Δa
a
ΔV Δa
=3
V a
Plugging in numbers yields
ΔV
= 3× 0.1
V
= 0.3
= 30%

NKAY NKAY
NKAY STUDY NANA KWABENA

Problem Set#1
Multiple Choice Test
Chapter 01.03 Sources of Error
COMPLETE SOLUTION SET

NKAY
1. Truncation error is caused by approximating
(A) irrational numbers
(B) fractions
(C) rational numbers
(D) exact mathematical procedures.

Solution
The correct answer is (D).

Truncation error is related to approximating mathematical procedures. Examples include


using a finite number of terms of a Taylor series to approximate transcendental and
trigonometric functions, the use of a finite number of areas to find the integral of a
function, etc.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. A computer that represents only 4 significant digits with chopping would calculate
66.666*33.333 as

NKAY
(A) 2220
(B) 2221
(C) 2221.17778
(D) 2222

Solution
The correct answer is (B).

66.666 ≈ 66.66
33.333 ≈ 33.33

66.66 × 33.33 = 2221.7778


≈ 2221

NKAY NKAY
NKAY STUDY NANA KWABENA

3. A computer that represents only 4 significant digits with rounding would calculate
66.666*33.333 as

NKAY
(A) 2220
(B) 2221
(C) 2221.17778
(D) 2222

Solution
The correct answer is (D).

66.666 ≈ 66.67
33.333 ≈ 33.33

66.67 × 33.33 = 2222.1111


≈ 2222

NKAY NKAY
NKAY STUDY NANA KWABENA

f (x + h ) − f (x )
4. The truncation error in calculating f ′(2) for f ( x ) = x 2 by f ′( x ) ≈
h
with h = 0.2 is
(A) -0.2
(B) 0.2
(C) 4.0
(D) 4.2

Solution
The correct answer is (A).
The approximate value of f ′( 2) is
f ( x + h) − f ( x)

NKAY
f ′( x ) ≈
h
x = 2, h = 0.2

f ( 2 + 0 .2 ) − f ( 2 )
f ′( 2) ≈
0 .2
f ( 2 .2 ) − f ( 2 )
=
0 .2
2.2 − 2 2
2
=
0.2
= 4.2
The true value of f ′(2) is
f (x ) = x 2
f ′( x ) = 2 x
f ′(2 ) = 2 × 2
=4
Thus, the true error is
Et = 4.2 − 4
= −0.2

NKAY NKAY
NKAY STUDY NANA KWABENA

∫ x dx
3
5. The truncation error in finding using LRAM (left end point Riemann
−3

approximation method) with equally portioned points − 3 < 0 < 3 < 6 < 9 is
(A) 648
(B) 756
(C) 972
(D) 1620

Solution
The correct answer is (C).

3
Graph of f(x)=x for LRAM Approximation

800
700

NKAY
600
500
400
f(x)

300
200
100
0
-3 -100 0 3 6 9
x

LRAM = f ( −3) × 3 + f (0) × 3 + f (3) × 3 + f (6) × 3


= (−3) 3 × 3 + (0) 3 × 3 + (3) 3 × 3 + (6) 3 × 3
= −81 + 0 + 81 + 648
= 648

9 9
⎡ x4 ⎤
∫ ⎢⎣ 4 ⎥⎦
= 3
x
−3 −3

⎡ 9 4 − ( −3) 4 ⎤
=⎢ ⎥
⎣ 4 ⎦
= 1620
Truncation Error = 1620 − 648
= 972

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The number 1 is registered in a fixed 6 bit-register with all bits used for the
10
fractional part. The difference is accumulated every 1 th of a second for one day. The
10
magnitude of the accumulated difference is
(A) 0.082
(B) 135
(C) 270
(D) 5400

Solution
The correct answer is (D).

Number Number after decimal Number before decimal


0.1× 2 0.2 0.2 0
0.2 × 2 0.4 0.4 0

NKAY
0.4 × 2 0.8 0.8 0

0.8 × 2 1.6 0.6 1


0.6 × 2 1.2 0.2 1

0.2 × 2 0.4 0.4 0

0.4 × 2 0.8 0.8 0

0.8 × 2 1.6 0.6 1

0.6 × 2 1.2 0.2 1

(0.1)10 ≅ (0.000110011)2
Hence
(0.1)10 ≅ (0.000110)2 in a six bit fixed register.
(0.000110 )2 = 0 × 2 −1 + 0 × 2 −2 + 0 × 2 −3 + 1 × 2 −4 + 1 × 2 −5 + 0 × 2 −6
= 0.09375
The difference (true error) between 0.1 and 0.09375 is
= 0.1 − 0.09375
= 0.00625
The accumulated difference in a day is then
= 0.00625 × 10 × 60 × 60 × 24
= 5400

NKAY NKAY
NKAY STUDY NANA KWABENA

Problem Set#1
Multiple Choice Test
Chapter 01.07 Taylors Series Revisited
COMPLETE SOLUTION SET

1. The coefficient of the x 5 term in the Maclaurin polynomial for sin 2 x  is

NKAY
(A) 0
(B) 0.0083333
(C) 0.016667
(D) 0.26667

Solution
The correct answer is (D).

The Maclaurin series for sin(2 x ) is

sin(2 x )  2 x 
2 x 3  2 x 5  
3! 5!
3 5
8x 32 x
 2x   
6 120
 2 x  1.3333x 3  0.26667 x 5  
Hence, the coefficient of the x 5 term is 0.26667.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. Given f 3  6 , f 3  8 , f 3  11 , and all other higher order derivatives of f x 
are zero at x  3 , and assuming the function and all its derivatives exist and are
continuous between x  3 and x  7 , the value of f 7  is
(A) 38.000
(B) 79.500
(C) 126.00
(D) 331.50

NKAY
Solution
The correct answer is (C).

The Taylor series is given by


f  x  2 f  x  3
f  x  h   f  x   f  x h  h  h 
2! 3!
x  3, h  7 3  4
f 3 2 f 3 3
f 3  4  f 3  f 34  4  4 
2! 3!
f (3) 2 f (3) 3
f 7   f (3)  f (3)4  4  4 
2! 3!
Since all the derivatives higher than second are zero,
f 3 2
f 7   f 3  f 34  4
2!
11
 6  8  4  42
2!
 126

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Given that y x  is the solution to y 3  2 , y (0)  3 the value of y 0.2  from a
dy
dx
second order Taylor polynomial around x=0 is
(A) 4.400
(B) 8.800
(C) 24.46
(D) 29.00

Solution
The correct answer is (C).

NKAY
The second order Taylor polynomial is
y  x  2
y  x  h   y  x   y x h  h
2!
x  0 , h  0.2  0  0.2
y 0 2
y 0  0.2  y 0  y 0  0.2  0.2
2!
y 0.2  y 0   y 0   0.2  y 0   0.02
y 0   3
y  x   y 3  2
y 0  33  2
 29
y  x   3 y 2
dy
dx
 3 y y 3  2
2


y 0  33 33  2
2

 783
y 0.2   3  29  0.2  783  0.02
 24.46

NKAY NKAY
NKAY STUDY NANA KWABENA


x 2n n
  1
n
4. The series 4 is a Maclaurin series for the following function
n 0 ( 2n )!
(A) cosx 
(B) cos2 x 

NKAY
(C) sin x 
(D) sin 2 x 

Solution
The correct answer is (B).

x 2n
cos x     1
n

n 0 2n !
cos2 x     1

n 2 x 2n
n 0 2n !

2 2n x 2n
   1
n

n 0 2n !

4 n x 2n
   1
n

n 0 2n !

NKAY NKAY
NKAY STUDY NANA KWABENA

x
5. The function erf  x  
2
e
t 2
dt is called the error function. It is used in the field of
 0
probability and cannot be calculated exactly. However, one can expand the integrand as
a Taylor polynomial and conduct integration. The approximate value of erf 2.0  using
the first three terms of the Taylor series around t  0 is
(A) -0.75225
(B) 0.99532
(C) 1.5330
(D) 2.8586

Solution
The correct answer is (A).
The first three terms of the Taylor series for f t  
2
e t around t  0 are
2


f t  
2
e t
2

NKAY

f 0 
2 0 2
e

2


f t   e  2t 
2 t 2


f 0  e  20
2 t 2


0
f t   e t  2t  2t   e t  2 
2 2 2 2

 

f 0  e 0  20 20  e 0  2


2 2 2 2

 
4


The first three terms of the Taylor series are
f ( x) 2
f ( x  h)  f ( x)  f ( x)h  h
2!
f (0) 2
f (0  h)  f (0)  f (0)h  h
2!
f (0) 2
f (h)  f (0)  f (0)h  h
2!

NKAY NKAY
NKAY STUDY NANA KWABENA

2 4 h2
  0(h) 
  2!
4 h2
2
 
  2!

NKAY
2 2 2
  h
 
Hence
 2 2 2
x
erf  x      t dt
0   
x
 2 2 t3 
 t 
   3 0
2 2 x3
 x 
  3
2 23
erf 2   2 
2
  3
 0.75225
Note: Compare with the exact value of erf 2 

NKAY NKAY
NKAY STUDY NANA KWABENA

6. Using the remainder of Maclaurin polynomial of n th order for f x  defined as


x n 1
Rn  x   f n 1 c , n  0, 0  c  x
n  1!
the order of the Maclaurin polynomial at least required to get an absolute true error of at
most 10 6 in the calculation of sin 0.1 is (do not use the exact value of sin 0.1 or
cos0.1 to find the answer, but the knowledge that |sin( x)|  1 and | cos( x) | 1 ).
(A) 3
(B) 5
(C) 7
(D) 9

Solution

NKAY
The correct answer is (B).
x n 1
Rn  x   f n 1 c  , n  0 , 0  c  x
(n  1)!

Rn 0.1 
0.1
n 1
f n 1 c , n  0, 0  c  0.1
( n  1)!
Since derivatives of f x  are simply sin  x  and cos x  , and
sin  x   1 and cos x   1
f n 1 c   1

Rn 0.1 
0.1n1 1
(n  1)!


0.1n1
(n  1)!

So when is
Rn 0.1  10 6
0.1n1 10 6
(n  1)!
n4
But since the Maclaurin series for sin  x  only includes odd terms, n  5 .

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Background
Differentiation
COMPLETE SOLUTION SET

1. The definition of the first derivative of a function f (x) is


f ( x + Δx) + f ( x)

NKAY
(A) f ' ( x) =
Δx
f ( x + Δx) − f ( x)
(B) f ' ( x) =
Δx
f ( x + Δx) + f ( x)
(C) f ' ( x) = lim
Δx → 0 Δx
f ( x + Δx) − f ( x)
(D) f ' ( x) = lim
Δx → 0 Δx

Solution
The correct answer is (D).
The definition of the first derivative of the function f (x) is

f ( x + Δx) − f ( x)
f ' ( x) = lim
Δx → 0 Δx

Choice (B) is incorrect as it is an approximate method to calculate the first derivative of a


function f (x) . In fact, choice (B) is the forward divided difference method of approximately
calculating the first derivative of a function.

NKAY NKAY
NKAY STUDY NANA KWABENA

dy
2. Given y = 5e 3 x + sin x, is
dx
(A) 5e 3 x + cos x
(B) 15e 3 x + cos x
(C) 15e 3 x − cos x
(D) 2.666e 3 x − cos x

Solution
The correct answer is (B)

Use the sum rule of differentiation


d du dv

NKAY
(u + v ) = +
dx dx dx
Re-write the function as
y =u+v
where
u = 5e3 x
v = sin x
du dv
Find and
dx dx
d ⎛ d ax ax ⎞
(5e3 x ) = 15e3 x ⎜ (e ) = ae ⎟
dx ⎝ dx ⎠
d ⎛d ⎞
(sin x ) = cos x ⎜ (sin x ) = cos x ⎟
dx ⎝ dx ⎠
dy du dv
= +
dx dx dx
= 15e3 x + cos x

NKAY NKAY
NKAY STUDY NANA KWABENA

dy
3. Given y = sin 2 x, at x = 3 is most nearly
dx
(A) 0.9600
(B) 0.9945
(C) 1.920
(D) 1.989

Solution
The correct answer is (C).

NKAY
Using the chain rule
u = 2x
y = sin u
du
=2
dx
dy
= cos u
du
= cos 2 x
Since,
dy dy du
= ×
dx du dx
dy
= (cos 2 x ) × 2
dx
At x = 3
dy
= (cos 6) × 2 (Don’t forget to use radians)
dx
= 0.9602 × 2
= 1.920

NKAY NKAY
NKAY STUDY NANA KWABENA

dy
4. Given y = x 3 ln x, is
dx
(A) 3x 2 ln x
(B) 3x 2 ln x + x 2
(C) x 2
(D) 3 x

NKAY
Solution
The correct answer is (B).

Using the product rule,


d
(uv ) = u dv + v du (1)
dx dx dx
u=x 3

v = ln x
du
= 3x 2
dx
dv 1
=
dx x
Substituting into Equation (1),
dy 1
= x 3 × + ln x × 3x 2
dx x
= x + 3x 2 ln x
2

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The velocity of a body as a function of time is given as ν (t ) = 5e −2t + 4 , where t is in


seconds, and ν is in m/s. The acceleration in m/s 2 at t = 0.6 s is
(A) -3.012
(B) 5.506

NKAY
(C) 4.147
(D) -10.00

Solution
The correct answer is (A)

dv
a(t ) =
dt
=
d
dt
(
5e − 2t + 4 )
⎛ d ax ax ⎞
= −10e − 2t ⎜ (e ) = ae ⎟
⎝ dx ⎠
a(0.6) = −10e −2( 0.6 )
= −3.012 m/s2

NKAY NKAY
NKAY STUDY NANA KWABENA

dy
6. If x 2 + 2 xy = y 2 , then is
dx

x+ y
(A)
y−x
(B) 2 x + 2 y
x +1
(C)

NKAY
y
(D) − x

Solution
The correct answer is (A).

d 2 d d
[ x ] + [2 xy ] = [ y 2 ]
dx dx dx
dy dy ⎛d dv du ⎞
2x + 2x + 2 y = 2 y ⎜ (uv) = u + v ⎟
dx dx ⎝ dx dx dx ⎠
dy
x + y = ( y − x)
dx
dy x + y
=
dx y − x

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Background

NKAY
Nonlinear Equations
COMPLETE SOLUTION SET

1. The value of x that satisfies f ( x ) = 0 is called the


(A) root of an equation f ( x ) = 0
(B) root of a function f ( x )
(C) zero of an equation f ( x ) = 0
(D) none of the above

Solution
The correct answer is (A).

Only an equation has roots, while functions have zeros. A root of an equation f(x) = 0 is defined
as the point where f(x) is zero.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. A quadratic equation has root(s).


(A) one
(B) two
(C) three

NKAY
(D) four

Solution
The correct answer is (B).

The quadratic equation


ax 2 + bx + c = 0
has two roots
− b + b 2 − 4ac
x1 =
2a
− b − b 2 − 4ac
x2 =
2a
These two roots may be real or complex. If b 2 − 4ac = 0 , the roots are repeated.

NKAY NKAY
NKAY STUDY NANA KWABENA

3. For a certain cubic equation, at least one of the roots is known to be a complex root. How
many total complex roots does the cubic equation have?
(A) one

NKAY
(B) two
(C) three
(D) cannot be determined

Solution
The correct answer is (B).

The equation would have two complex roots. There are two possible cases for the roots of a
cubic equation:
1. Three real roots
2. Two complex roots and one real root
Complex roots always come in conjugate pairs (a+ib,a-ib).

NKAY NKAY
NKAY STUDY NANA KWABENA

4. An equation such as tan x = x has root(s).


(A) zero
(B) one
(C) two
(D) infinite

Solution
The correct answer is (D).

The equation,
tan x = x
has infinite roots.

NKAY x

For example, the roots of


tan x = x
include
x1 = 0
x 2 = 4.49341
x3 = 7.72525
x 4 = 54.9597

NKAY NKAY
NKAY STUDY NANA KWABENA

5. A polynomial of order n has __________ zeros.


(A) n − 1
(B) n
(C) n + 1

NKAY
(D) n + 2

Solution
The correct answer is (B).

A polynomial of order n has n zeros.


For example a second order polynomial
ax 2 + bx + c
has two zeros
− b + b 2 − 4ac
x1 =
2a
− b − b 2 − 4ac
x2 =
2a
Similarly a third order polynomial has three zeros.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The velocity of a body is given by v(t ) = 5e −t + 4 , where t is in seconds and v is in m/s. The
velocity of the body is 6 m/s at t = ____________ seconds.
(A) 0.1823
(B) 0.3979
(C) 0.9163
(D) 1.609

Solution
The correct answer is (C).

v(t ) = 5e −t + 4
where

NKAY
v(t ) = 6 m/s
Thus,
5e −t + 4 = 6
5e −t = 6 − 4 = 2
2
e −t =
5
If we take the natural log of both sides
⎛2⎞
ln(e −t ) = ln⎜ ⎟
⎝5⎠
− t = −0.9162
t = 0.9163 s

Or if we take the log10 of both sides


⎛2⎞
log10 (e −t ) = log10 ⎜ ⎟
⎝5⎠
− t × log10 (e) = −0.3979
− 0.3979
t=
− 0.4343
t = 0.9163 s

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Bisection Method
Nonlinear Equations

NKAY
COMPLETE SOLUTION SET

1. The bisection method of finding roots of nonlinear equations falls under the category of a (an)
_________ method.
(A) open
(B) bracketing
(C) random
(D) graphical

Solution
The correct answer is (B).

The bisection method is a bracketing method since it is based on finding the root between two
guesses that bracket the root, that is, where the real continuous function f ( x ) in the equation
f ( x ) = 0 changes sign between the two guesses.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. If for a real continuous function f ( x ) , f (a) f (b ) < 0 , then in the range of [a, b] for f ( x ) = 0 ,
there is (are)

NKAY
(A) one root
(B) an undeterminable number of roots
(C) no root
(D) at least one root

Solution
The correct answer is (D).

If f (a) f (b ) < 0 , then f (a ) and f (b) have opposite signs. Since f (x ) is continuous between a
and b, the function needs to cross the x-axis. The point where the function f (x ) crosses the x-
axis is the root of the equation f ( x ) = 0.

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Assuming an initial bracket of [1,5] , the second (at the end of 2 iterations) iterative value of
the root of te −t − 0.3 = 0 using the bisection method is
(A) 0
(B) 1.5
(C) 2
(D) 3

Solution
The correct answer is (C).

f (t ) = te −t − 0.3
If the initial bracket is [1,5] then
tu = 5
tA = 1
Check to see if the function changes sign between t A and t u

NKAY
f (t u ) = 5e −5 − 0.3
= −0.2663
f (t A ) = 1e −1 − 0.3
= 0.0679
Hence,
f (t u ) f (t A ) = f (5) f (1)
= (−0.2663)(0.0679)
= −0.0181 < 0
So there is at least one root between t A and t u .
Iteration 1
The estimate of the root is
t +t
tm = A u
2
1+ 5
=
2
=3
f (t m ) = 3e −3 − 0.3
= −0.1506
Thus,
f (t A ) f (t m ) = f (1) f (3)
= (0.0679)(−0.1506)
= −0.0102 < 0

NKAY NKAY
NKAY STUDY NANA KWABENA

The root lies between t A and t m , so the new upper and lower guesses for the root are
tA = tA = 1

NKAY
tu = t m = 3
Iteration 2
The estimate of the root is
t +t
tm = A u
2
1+ 3
=
2
=2

NKAY NKAY
NKAY STUDY NANA KWABENA

4. To find the root of f(x) = 0, a scientist is using the bisection method. At the beginning of an
iteration, the lower and upper guesses of the root are xl and x u . At the end of the iteration, the
absolute relative approximate error in the estimated value of the root would be
xu
(A)
xu + x A
xA
(B)
xu + x A
xu − x A
(C)
xu + x A
xu + x A
(D)
xu − x A

Solution
The correct answer is (C).

NKAY
The absolute relative approximate error is
x new − x old
∈a = m new m
xm
where

x A + xu
x mnew =
2
If
x mold = x A

x A + xu
− xA
∈a = 2
xA + xu
2
( x A + xu ) − 2 x A
=
xA + xu
xu − xA
=
xu + xA

If
x mold = xu

NKAY NKAY
NKAY STUDY NANA KWABENA

x A + xu

NKAY
− xu
∈a = 2
xA + xu
2
( xA + xu ) − 2 xu
=
xA + xu
x l − xu
=
xu + xA
The answer is the same whether x mold = x A or xu as xm is exactly in the middle of xA and xu.

NKAY NKAY
NKAY STUDY NANA KWABENA

5. For an equation like x 2 = 0 , a root exists at x = 0 . The bisection method cannot be adopted
to solve this equation in spite of the root existing at x = 0 because the function f (x ) = x 2
(A) is a polynomial
(B) has repeated roots at x = 0
(C) is always non-negative
(D) has a slope equal to zero at x = 0

Solution

NKAY
The correct answer is (C).

Since f ( x) = x 2 will never be negative, the statement f ( xu ) f ( xA ) < 0 will never be true.
Therefore, no interval [xA , xu ] will contain the root of x2 = 0.

f (x )

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The ideal gas law is given by


pv = RT
where p is the pressure, v is the specific volume, R is the universal gas constant, and T is the
absolute temperature. This equation is only accurate for a limited range of pressure and
temperature. Vander Waals came up with an equation that was accurate for larger ranges of
pressure and temperature given by
⎛ a⎞
⎜ p + 2 ⎟(v − b ) = RT
⎝ v ⎠
where a and b are empirical constants dependent on a particular gas. Given the value of
R = 0.08 , a = 3.592 , b = 0.04267 , p = 10 and T = 300 (assume all units are consistent), one is

NKAY
going to find the specific volume, v , for the above values. Without finding the solution from the
Vander Waals equation, what would be a good initial guess for v ?
(A) 0
(B) 1.2
(C) 2.4
(D) 3.6

Solution
The correct answer is (C).

From the physics of the problem, the initial guess can be found from the linear relationship of the
ideal gas law
pv = RT
RT
v=
p
0.08 × 300
=
10
= 2.4

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Newton-Raphson Method
Nonlinear Equations

NKAY
COMPLETE SOLUTION SET

1. The Newton-Raphson method of finding roots of nonlinear equations falls under the category
of _____________ methods.
(A) bracketing
(B) open
(C) random
(D) graphical

Solution
The correct answer is (B).

The Newton-Raphson method is an open method since the guess of the root that is needed to get
the iterative method started is a single point. Other open methods such as the secant method use
two initial guesses of the root but they do not have to bracket the root.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. The Newton-Raphson method formula for finding the square root of a real number R from the
equation x 2 − R = 0 is,
x
(A) xi +1 = i
2
3x
(B) xi +1 = i
2
1⎛ R⎞
(C) xi +1 = ⎜⎜ xi + ⎟⎟
2⎝ xi ⎠
1⎛ R⎞
(D) xi +1 = ⎜⎜ 3xi − ⎟⎟
2⎝ xi ⎠

Solution
The correct answer is (C).

NKAY
The Newton-Raphson method formula for solving f(x) = 0 is
f ( xi )
xi +1 = xi −
f ′( xi )
where
f ( x) = x 2 − R
f ′( x) = 2 x
Thus,
xi2 − R
xi +1 = xi −
2 xi
⎛ R⎞
xi ⎜⎜ xi − ⎟⎟
xi ⎠
= xi − ⎝
2 xi
xi R
= xi − +
2 2 xi
1 R
= xi +
2 2 xi
1⎛ R⎞
= ⎜⎜ xi − ⎟⎟
2⎝ xi ⎠

NKAY NKAY
NKAY STUDY NANA KWABENA

3. The next iterative value of the root of x 2 − 4 = 0 using the Newton-Raphson method, if the
initial guess is 3, is
(A) 1.5
(B) 2.067
(C) 2.167
(D) 3.000

Solution
The correct answer is (C).

NKAY
The estimate of the root is
f ( xi )
xi +1 = xi −
f ′( xi )
Chose i = 0,
x0 = 3
2
f ( x0 ) = x0 − 4
= 32 − 4
=5
f ′( x0 ) = 2 x0
= 2×3
=6
Thus,
f ( x0 )
x1 = x 0 −
f ′( x 0 )
5
= 3−
6
= 2.166

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The root of the equation f ( x) = 0 is found by using the Newton-Raphson method. The initial
estimate of the root is x0 = 3 , f (3) = 5 . The angle the line tangent to the function f (x ) makes
at x = 3 is 57° with respect to the x-axis. The next estimate of the root, x1 most nearly is
(A) –3.2470
(B) −0.24704
(C) 3.2470
(D) 6.2470

Solution
The correct answer is (B).

f(x)

NKAY
f(x0 )
[x0,f(x0)]

f(x1)

θ
x1 x0 x

Δx

Since,
θ = 57°,
x0 = 3, and
f ( x0 ) = 5
rise
tan(θ ) =
run
f ( x 0 ) − f ( x1 )
tan(57°) =
x 0 − x1
5−0
tan(57°) =
3 − x1

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
5 − 3(tan(57°))
x1 =
− tan(57°)
5 − 3 × 1.5399
=
− 1.5399
= −0.24704

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The root of x 3 = 4 is found by using the Newton-Raphson method. The successive iterative
values of the root are given in the table below.
Iteration Value of Root
Number
0 2.0000
1 1.6667
2 1.5911
3 1.5874
4 1.5874

The iteration number at which I would first trust at least two significant digits in the answer
is
(A) 1
(B) 2

NKAY
(C) 3
(D) 4

Solution
The correct answer is (C).

The absolute relative approximate error for the first iteration is


1.6667 − 2
∈a = × 100
1.6667
= − 0.19999 × 100
= 19.999%
Since, 19.99% ≤ 0.5 × 10 2− m , m = 0 . There are no significant digits correct.
The absolute relative approximate error for the second iteration is
1.5911 − 1.6667
∈a = × 100
1.5911
= − 0.047514 × 100
= 4.7514%
Since, 4.7514 % ≤ 0.5 × 10 2− m , m = 1 . There is at least one significant digit correct.
The absolute relative approximate error for the third iteration is
1.5874 − 1.5911
∈a = × 100
1.5874
= − 0.0023308 × 100
= 0.23308%

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
Since, 0.23308 % ≤ 0.5 × 10 2 − m , m = 2 . There are at least two significant digits correct.
Thus, the third iteration is the first iteration in which at least two significant digits are correct.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The ideal gas law is given by


pv = RT
where p is the pressure, v is the specific volume, R is the universal gas constant, and T is the
absolute temperature. This equation is only accurate for a limited range of pressure and
temperature. Vander Waals came up with an equation that was accurate for larger range of
pressure and temperature given by
⎛ a⎞
⎜ p + 2 ⎟(v − b ) = RT
⎝ v ⎠
where a and b are empirical constants dependent on a particular gas. Given the value of
R = 0.08 , a = 3.592 , b = 0.04267 , p = 10 and T = 300 (assume all units are consistent), one is

NKAY
going to find the specific volume, v , for the above values. Without finding the solution from the
Vander Waals equation, what would be a good initial guess for v ?
(A) 0
(B) 1.2
(C) 2.4
(D) 3.6

Solution
The correct answer is (C).

From the physics of the problem, the initial guess can be found from the linear relationship of the
ideal gas law
pv = RT
RT
v=
p
0.08 × 300
=
10
= 2.4

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Secant Method
Nonlinear Equations
COMPLETE SOLUTION SET

1. The secant method of finding roots of nonlinear equations falls under the category of
_____________ methods.
(A) bracketing
(B) graphical
(C) open
(D) random

NKAY
Solution
The correct answer is (C).

The secant method of finding roots of nonlinear equations falls under the category of open
methods. The secant method uses two initial guesses of the root but unlike the bisection method,
they do not have to bracket the root.

f(x)

f(xi ) B

f(xi-1 ) C

E D A x
xi+ 1 x i-1 xi

Figure 1 Geometrical representation of the secant method.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. The secant method formula for finding the square root of a real number R from the equation
x 2 − R = 0 is
x x +R
(A) i i −1
xi + xi −1
xi xi −1
(B)
xi + xi −1
1⎛ R⎞
(C) ⎜⎜ xi + ⎟⎟
2⎝ xi ⎠
2 xi2 + xi xi −1 − R
(D)
xi + xi −1

Solution
The correct solution is (A).

NKAY
The secant method formula for finding the root of f(x) = 0 is
f ( xi )( xi − xi −1 )
xi +1 = xi −
f ( xi ) − f ( xi −1 )
where
f ( x) = x 2 − R
Thus
( x 2 − R )( xi − xi −1 )
xi +1 = xi − 2i
( xi − R) − ( xi2−1 − R )
( xi2 − R)( xi − xi −1 )
= xi −
xi2 − xi2−1
( xi2 − R)( xi − xi −1 )
= xi −
( xi − xi −1 )( xi + xi −1 )
xi2 − R
= xi −
xi + xi −1

=
(
xi ( xi + xi −1 ) − xi2 − R )
xi + xi −1
xi2 + xi xi −1 − xi2 + R
=
xi + xi −1
xi xi −1 + R
=
xi + xi −1

NKAY NKAY
NKAY STUDY NANA KWABENA

3. The next iterative value of the root of x 2 − 4 = 0 using secant method, if the initial guesses
are 3 and 4, is
(A) 2.2857
(B) 2.5000
(C) 5.5000
(D) 5.7143

Solution
The correct solution is (A).

NKAY
The first iteration is
f ( xi )( xi − xi −1 )
xi +1 = xi −
f ( xi ) − f ( xi −1 )
for i = 0, x0 = 4, x −1 = 3

f ( x0 )( x0 − x −1 )
x1 = x0 −
f ( x0 ) − f ( x −1 )

= x0 −
(x ) 2
0 − 4 ( x0 − x −1 )
(x ) (
2
0 )
− 4 − x −21 − 4

= 4−
(4
− 4 )(4 − 3)
2

(4 − 4) − (3 − 4)
2 2

= 4−
(12)(1)
(12) − (5)
12
= 4−
7
= 2.2857

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The root of the equation f ( x ) = 0 is found by using the secant method. Given one of the
initial estimates is x0 = 3 , f (3) = 5 , and the angle the secant line makes with the x-axis is 57° ,
the next estimate of the root, x1 , is
(A) –3.2470
(B) –0.24704
(C) 3.247
(D) 6.2470

Solution
The correct answer is (B).

f(x)

NKAY
secant line

f(x0 ) B

C 57° A x
x1 x0

f (x0 )
tan(θ ) =
x0 − x1
f (3)
tan (57 ) =
3 − x1
f (3)
3 − x1 =
tan (57 )
5
x1 = − +3
1.5399
= −3.2470 + 3
= −0.24704

NKAY NKAY
NKAY STUDY NANA KWABENA

5. For finding the root of sin x = 0 by the secant method, the following choice of initial guesses
would not be appropriate.
π π
(A) and
4 2
π 3π
(B) and
4 4

NKAY
π π
(C) − and
2 2
π π
(D) and
3 2

Solution
The correct answer is (B).

π 3π π 3π 1
and are not good initial guesses because sin = sin = . This would result in
4 4 4 4 2
division by zero in the formula

f ( xi )( xi − xi −1 )
xi +1 = xi −
f ( xi ) − f ( xi −1 )

NKAY NKAY
NKAY STUDY NANA KWABENA

6. When drugs are given orally to a patient, the drug concentration c in the blood stream at time
t is given by a formula
c = Kte − at
where K is dependent on parameters such as the dose administered while a is dependent on the
absorption and elimination rates of the drug. If K = 2 and a = 0.25 , and t is in seconds and c is
in mg/ml, the time at which the maximum concentration is reached is given by the solution of the
equation,
(A) 2te −0.25t = 0
(B) 2e −0.25t − 2te −0.25t = 0
(C) 2e −0.25t − 0.5te −0.25t = 0

NKAY
(D) 2te −0.25t = 2

Solution
The correct answer is (C).

c = Kte − at
Given
K = 2, a = 0.25
c = 2te −0.25t
To find the time of maximum concentration, we set
dc
=0
dt
d
dt
(2te −0.25t ) = 0

2e −0.25t − 0.5te −0.25t = 0


Note: The solution of the above equation will only give a local maximum or minimum. We need
to do the second derivative test after finding the root of the equation.

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Background
Simultaneous Linear Equations
COMPLETE SOLUTION SET

NKAY
⎡6 2 3 9⎤
⎢0 1 2 3⎥⎥
1. Given [A] = ⎢ then [A] is a (an) ______________ matrix.
⎢0 0 4 5⎥
⎢ ⎥
⎣0 0 0 6⎦

(A) diagonal
(B) identity
(C) lower triangular
(D) upper triangular

Solution
The correct answer is (D).

A square matrix [A] is an upper triangular matrix if aij = 0 when i > j , that is, all the elements
below the diagonal are zero. Note that the statement aij = 0 when i > j implies that the matrix
elements are zero for all elements where the row number is strictly greater than the column
number.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. A square matrix [A] is lower triangular if


(A) aij = 0, j > i
(B) aij = 0, i > j
(C) aij ≠ 0, i > j

NKAY
(D) aij ≠ 0, j > i

Solution
The correct answer is (A).

A n× n matrix [A] is lower triangular if aij = 0 for j > i . That is, all elements above the
diagonal are zero. Note that all the elements of [A] for which the column number is greater than
the row numbers are zero. An example of a lower triangular matrix is
⎡2 0 0 0 ⎤
⎢6 3 0 0 ⎥⎥
[ A] = ⎢
⎢4 − 5 0 0 ⎥
⎢ ⎥
⎣2 9 3 − 3.2⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Given
⎡12.3 − 12.3 20.3 ⎤ ⎡ 2 4 ⎤
⎢ ⎥ ⎢
[ A] = ⎢11.3 − 10.3 − 11.3⎥ , [B ] = − 5
⎢ 6 ⎥⎥
⎢⎣10.3 − 11.3 − 12.3⎥⎦ ⎢⎣ 11 − 20 ⎥⎦

then if
[C ] = [A][B] , then
c31 = _____________________

(A) − 58.2
(B) − 37.6
(C) 219.4
(D) 259.4

NKAY
Solution
The correct answer is (A).

The ith row and jth column of the [C ] matrix in [C ] = [ A][B ] is calculated by multiplying the ith
row of [ A] by the jth column of [B ], that is,
⎡ b1 j ⎤
⎢b ⎥
⎢ 2j⎥
[ ]
cij = ai1 ai 2 …… aip ⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ bpj ⎥
⎣ ⎦
= ai1 b1 j + ai 2 b2 j + ........ + aip b pj
p
= ∑ aik bkj
k =1
Therefore,
⎡2⎤
c31 = [10.3 − 11.3 − 12.3]⎢⎢− 5⎥⎥
⎢⎣ 11 ⎥⎦
= (10.3 × 2) + (−11.3 × −5) + (−12.3 × 11)
= 20.6 + 56.5 + −135.3
= −58.2

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The following system of equations has ____________ solution(s).


x+ y = 2
6 x + 6 y = 12
(A) infinite
(B) no
(C) two

NKAY
(D) unique

Solution
The correct answer is (A).

The system of equations


x+ y = 2 (1)
6 x + 6 y = 12 (2)
has an infinite number of solutions because the two equations are the same. Equation (2) is a
multiple of 6 of Equation (1).

NKAY NKAY
NKAY STUDY NANA KWABENA

5. Consider there are only two computer companies in a country. The companies are named
Dude and Imac. Each year, Dude keeps 1/5th of its customers, while the rest switch to Imac.
Each year, Imac keeps 1/3rd of its customers, while the rest switch to Dude. If in 2003, Dude had
1/6th of the market and Imac had 5/6th of the market, what will be the share of Dude computers
when the market becomes stable?
(A) 37/90
(B) 5/11
(C) 6/11
(D) 53/90

Solution
The correct answer is (B).

If D is the current market if Dude computers and M is the current market of Imac computers, and
if Dn is the next year’s Dude market and Mn is the next years Imac market, then since we want

NKAY
when the market is stable, the market share should not change from year to year.
⎡1 2⎤
⎡ n ⎤ ⎢ 5 3 ⎥ ⎡ Dn ⎤
D
⎢M ⎥ = ⎢ 4 1 ⎥ ⎢M ⎥
⎣ n⎦ ⎢ ⎥⎣ n ⎦
⎣5 3⎦
1 2
Dn = × Dn + × M n
5 3
4 1
M n = Dn + M n
5 3

⎡ 4 2⎤

⎢ 5 3 ⎥ ⎡ Dn ⎤ ⎡0⎤
⎢ 4 2 ⎥ ⎢M ⎥ = ⎢ ⎥
⎢− ⎥ ⎣ n ⎦ ⎣0 ⎦
⎣ 5 3 ⎦
This has a trivial solution if Dn = 0, Mn = 0, but we know that Dn + M n = 1 . So we are looking for
a non-trivial solution. Note also that the coefficient matrix is singular.
4 2
0 = × Dn − × M n
5 3
Dn + M n = 1
gives,
5
Dn =
11
Extra notes for the student:
If one was going to find what the market share would be in 2004

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
⎡ 1 2 ⎤⎡ 1 ⎤
⎡ Dn ⎤ ⎢ 5 3 ⎥ ⎢ 6 ⎥
⎢M ⎥ = ⎢ 4 1 ⎥ ⎢ 5 ⎥
⎣ n⎦ ⎢ ⎥⎢ ⎥
⎣ 5 3 ⎦⎣ 6 ⎦
⎡ 53 ⎤
⎢ ⎥
= ⎢ 90 ⎥
37
⎢ ⎥
⎣ 90 ⎦
One would use this number to find the market share in 2005 and so on. Eventually the market
share would stabilize. But that would be a lenthier way to solve the problem.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. Three kids - Jim, Corey and David receive an inheritance of $2,253,453. The money is put in
three trusts but is not divided equally to begin with. Corey's trust is three times that of David's
because Corey made an A in Dr. Kaw’s class. Each trust is put in an interest generating
investment. The three trusts of Jim, Corey and David pays an interest of 6%, 8%, 11%,
respectively. The total interest of all the three trusts combined at the end of the first year is
$190,740.57. The equations to find the trust money of Jim (J), Corey (C) and David (D) in a
matrix form is
⎡ 1 1 1 ⎤ ⎡ J ⎤ ⎡ 2,253,453 ⎤

(A) ⎢ 0 3 − 1 ⎥⎥ ⎢⎢C ⎥⎥ = ⎢⎢ 0 ⎥

⎢⎣0.06 0.08 0.11⎥⎦ ⎢⎣ D ⎥⎦ ⎢⎣190,740.57⎥⎦
⎡ 1 1 1 ⎤ ⎡ J ⎤ ⎡ 2,253,453 ⎤

(B) ⎢ 0 1 − 3 ⎥⎥ ⎢⎢C ⎥⎥ = ⎢⎢ 0 ⎥

⎢⎣0.06 0.08 0.11⎥⎦ ⎢⎣ D ⎥⎦ ⎢⎣190,740.57⎥⎦
⎡1 1 1 ⎤ ⎡ J ⎤ ⎡ 2,253,453 ⎤
(C) ⎢⎢0 1 − 3⎥⎥ ⎢⎢ C ⎥⎥ = ⎢⎢ 0 ⎥

NKAY
⎢⎣6 8 11 ⎥⎦ ⎢⎣ D ⎥⎦ ⎢⎣190,740.57⎥⎦
⎡1 1 1 ⎤ ⎡ J ⎤ ⎡ 2,253,453 ⎤
(D) ⎢⎢0 3 − 1⎥⎥ ⎢⎢C ⎥⎥ = ⎢⎢ 0 ⎥

⎢⎣6 8 11 ⎥⎦ ⎢⎣ D ⎥⎦ ⎢⎣19,074,057⎥⎦

Solution
The correct answer is (B).

Let J, C, and D be the inheritance portions of Jim, Corey and David, respectively.

The total inheritance is $2,253,453 gives


J + C + D = $2,253,453

Corey's trust is three times that of David's


C = 3D
gives
C − 3D = 0

The three trusts of Jim, Corey and David pay an interest of 6%, 8%, 11%, respectively. The total
interest of all the three trusts combined at the end of the first year is $190,740.57.
The total interest is
6 8 11
J+ C+ D = $190,740.57
100 100 100
gives

NKAY NKAY
NKAY STUDY NANA KWABENA

0.06 J + 0.08C + 0.11D = $190,740.57


Three equations can be made from the information given

NKAY
J + C + D = $2,253,453
C − 3D = 0
0.06 J + 0.08C + 0.11D = $190,740.57
Setting the three equations in matrix form is as follows
⎡ 1 1 1 ⎤ ⎡ J ⎤ ⎡ 2,253,453 ⎤
⎢ 0 1 − 3 ⎥⎥ ⎢⎢C ⎥⎥ = ⎢⎢ 0 ⎥
⎢ ⎥
⎢⎣0.06 0.08 0.11⎥⎦ ⎢⎣ D ⎥⎦ ⎢⎣190,740.57⎥⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Gaussian Elimination
Simultaneous Linear Equations

NKAY
COMPLETE SOLUTION SET

1. The goal of forward elimination steps in the Naïve Gauss elimination method is to reduce the
coefficient matrix to a (an) _____________ matrix.
(A) diagonal
(B) identity
(C) lower triangular
(D) upper triangular

Solution
The correct answer is (D).

By reducing the coefficient matrix to an upper triangular matrix, starting from the last equation,
each equation can be reduced to one equation-one unknown to be solved by back substitution.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. Division by zero during forward elimination steps in Naïve Gaussian elimination of the set of
equations [A][ X ] = [C ] implies the coefficient matrix [A]
(A) is invertible
(B) is nonsingular
(C) may be singular or nonsingular
(D) is singular

NKAY
Solution
The correct answer is (C).

Division by zero during forward elimination does not relate to whether or not the coefficient
matrix is singular or nonsingular. For example
⎡0 2 3⎤ ⎡ x1 ⎤ ⎡ 5 ⎤
⎢2 3 7⎥ ⎢ x ⎥ = ⎢12⎥
⎢ ⎥⎢ 2 ⎥ ⎢ ⎥
⎢⎣1 5 6⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣12⎥⎦
would give a division by zero error in the first step of forward elimination. However, the
coefficient matrix in this case is nonsingular.
In another example
⎡0 2 3 ⎤ ⎡ x1 ⎤ ⎡ 5 ⎤
⎢2 3 7 ⎥ ⎢ x ⎥ = ⎢12⎥
⎢ ⎥⎢ 2 ⎥ ⎢ ⎥
⎢⎣4 6 14⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣12⎥⎦
would also give a division by zero error in the first step of forward elimination. In this case the
coefficient matrix is singular.

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Using a computer with four significant digits with chopping, the Naïve Gauss elimination
solution to
0.0030 x1 + 55.23x 2 = 58.12
6.239 x1 − 7.123x 2 = 47.23
is
(A) x1 = 26.66; x2 = 1.051
(B) x1 = 8.769; x2 = 1.051
(C) x1 = 8.800; x2 = 1.000
(D) x1 = 8.771; x2 = 1.052
Solution
The correct answer is (A).

NKAY
⎡0.0030 55.23 ⎤ ⎡ x1 ⎤ ⎡58.12⎤
⎢ 6.239 − 7.123⎥ ⎢ x ⎥ = ⎢47.23⎥
⎣ ⎦⎣ 2 ⎦ ⎣ ⎦
Forward Elimination: Divide Row 1 by 0.0030 and then multiply it by 6.239
⎡ Row 1 ⎤
⎢⎣ 0.0030 ⎥⎦ × (6.239) = [Row 1] × 2079 gives Row 1 as

[6.239 1.148 ×105 ] [1.208 ×10 ]5

Subtract the result from Row 2.


⎡0.0030 55.23 ⎤ ⎡ x1 ⎤ ⎡ 58.12 ⎤
=
⎢ 0
⎣ − 1.148 × 10 5 ⎥⎦ ⎢⎣ x 2 ⎥⎦ ⎢⎣− 1.207 × 10 5 ⎥⎦

Back substitution: From the second equation


(− 1.148 ×105 )× x2 = −1.207 ×105
− 1.207 × 105
x2 =
− 1.148 × 105
= 1.051
Substituting the value of x2 in the first equation

NKAY NKAY
NKAY STUDY NANA KWABENA

0.0030 x1 + 55.23 x2 = 58.12

NKAY
58.12 − 55.23 x2
x1 =
0.0030
58.12 − 55.23(1.051)
=
0.0030
58.12 − 58.04
=
0.0030
0.08
=
0.0030
= 26.66

NKAY NKAY
NKAY STUDY NANA KWABENA

4. Using a computer with four significant digits with chopping, the Gaussian elimination with
partial pivoting solution to
0.0030 x1 + 55.23 x 2 = 58.12
6.239 x1 − 7.123x 2 = 47.23
is
(A) x1 = 26.66; x2 = 1.051
(B) x1 = 8.769; x2 = 1.051
(C) x1 = 8.800; x2 = 1.000
(D) x1 = 8.771; x2 = 1.052
Solution
The correct answer is (B).

⎡0.0030 55.23 ⎤ ⎡ x1 ⎤ ⎡58.12⎤


⎢ 6.239 − 7.123⎥ ⎢ x ⎥ = ⎢47.23⎥

NKAY
⎣ ⎦⎣ 2 ⎦ ⎣ ⎦
Forward elimination:
Now for the first step of forward elimination, the absolute value of first column elements is
0.0030 , 6.239

or
0.0030, 6.239
So the largest absolute value is in Row 2. So as per Gaussian elimination with partial pivoting,
the switch is between Row 1 and Row 2 to give
⎡ 6.239 − 7.123⎤ ⎡ x1 ⎤ ⎡47.23⎤
⎢0.0030 55.23 ⎥ ⎢ x ⎥ = ⎢58.12⎥
⎣ ⎦⎣ 2 ⎦ ⎣ ⎦
⎡ Row 1⎤ -4
⎢⎣ 6.239 ⎥⎦ × (0.0030) = [Row 1] × 4.808 × 10 gives Row 1 as

[2.999 ×10 −3
− 3.424 ×10−3 ] [2.270 ×10 ]
−2

Subtract the result from Row 2.


⎡6.239 − 7.123⎤ ⎡ x1 ⎤ ⎡47.23⎤
=
⎢ 0
⎣ 55.23 ⎥⎦ ⎢⎣ x 2 ⎥⎦ ⎢⎣58.09⎥⎦
Note: This entry is zero because the algorithm for forward elimination treats it as zero.

Back substitution: From the second equation

NKAY NKAY
NKAY STUDY NANA KWABENA

55.23 x 2 = 58.09
58.09
x2 =
55.23
= 1.051

NKAY
Substituting the value of x2 in the first equation
6.239 x1 − 7.123x2 = 47.23
47.23 + 7.123x2
x1 =
6.239
47.23 + 7.123(1.051)
=
6.239
47.23 + 7.486
=
6.239
54.71
=
6.239
= 8.769

NKAY NKAY
NKAY STUDY NANA KWABENA

5. At the end of the forward elimination steps of the Naïve Gauss elimination method on the
following equations
⎡4.2857 × 10 7 − 9.2307 × 10 5 0 0 ⎤ ⎡ c1 ⎤ ⎡− 7.887 × 10 3 ⎤
⎢ 5 ⎥ ⎢c ⎥ ⎢ ⎥
⎢4.2857 × 10 − 5.4619 × 10 5 − 4.2857 × 10 7 5.4619 × 10 ⎥
7
⎢ 2⎥ = ⎢ 0 ⎥
⎢ − 6.5 − 0.15384 6.5 0.15384 ⎥ ⎢c3 ⎥ ⎢ 0.007 ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣⎢ 0 0 4.2857 × 10 7 − 3.6057 × 10 5 ⎦⎥ ⎣c 4 ⎦ ⎣⎢ 0 ⎦⎥
the resulting equations in matrix form are given by
⎡4.2857 × 10 7 − 9.2307 × 10 5 0 0 ⎤ ⎡ c1 ⎤ ⎡ − 7.887 × 10 3 ⎤
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ 0 3.7688 × 10 5 − 4.2857 × 10 7 5.4619 × 10 5 ⎥ ⎢c 2 ⎥ ⎢ 7.887 × 10 3 ⎥

NKAY
=
⎢ 0 0 − 26.9140 0.579684 ⎥ ⎢ c 3 ⎥ ⎢1.19530 × 10 −2 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣⎢ 0 0 0 5.62500 × 10 5 ⎦⎥ ⎣c 4 ⎦ ⎣⎢ 1.90336 × 10 4 ⎦⎥

The determinant of the original coefficient matrix is


(A) 0.00
(B) 4.2857 × 107
(C) 5.486 × 1019

(D) − 2.445 × 10 20
Solution
The correct answer is (D).

If a matrix is upper triangular, lower triangular or diagonal, then the determinant is


n
a11 × a 22 × ......... × a nn = ∏ aii
i =1

Thus, the determinant, D, of the matrix is


D = (4.2857 × 10 7 )× (3.7688 × 10 5 )× (− 26.9140 ) × (5.62500 × 10 5 )
= −2.445 × 10 20

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The following data is given for the velocity of the rocket as a function of time. To find the
velocity at t = 21 s , you are asked to use a quadratic polynomial, v(t ) = at 2 + bt + c to
approximate the velocity profile.
t (s) 0 14 15 20 30 35
v (t ) ( m / s) 0 227.04 362.78 517.35 602.97 901.67
The correct set of equations that will find a, b and c are
⎡176 14 1⎤ ⎡a ⎤ ⎡227.04⎤
(A) ⎢225 15 1⎥ ⎢b ⎥ = ⎢362.78 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢⎣400 20 1⎥⎦ ⎢⎣ c ⎥⎦ ⎢⎣517.35 ⎥⎦

⎡ 225 15 1⎤ ⎡a ⎤ ⎡362.78⎤
(B) ⎢400 20 1⎥ ⎢ b ⎥ = ⎢517.35⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥

NKAY
⎢⎣900 30 1⎥⎦ ⎢⎣ c ⎥⎦ ⎢⎣602.97⎥⎦

⎡ 0 0 1⎤ ⎡a ⎤ ⎡ 0 ⎤
(C) ⎢ 225 15 1⎥ ⎢ b ⎥ = ⎢362.78⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢⎣400 20 1⎥⎦ ⎢⎣ c ⎥⎦ ⎢⎣517.35⎥⎦

⎡ 400 20 1⎤ ⎡a ⎤ ⎡517.35⎤
(D) ⎢ 900 30 1⎥ ⎢b ⎥ = ⎢602.97 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢⎣1225 35 1⎥⎦ ⎢⎣ c ⎥⎦ ⎢⎣901.67 ⎥⎦

Solution
The correct answer is (B).

First choose the three points closest to t = 21 s that also bracket it.
t0 = 15 s, v(t0 ) = 362.78 m/s
t1 = 20 s, v(t1 ) = 517.35 m/s
t 2 = 30 s, v(t 2 ) = 602.97 m/s
Such that
v(15) = 362.78 = a(15) 2 + b(15) + c
v(20) = 517.35 = a(20) 2 + b(20) + c
v(30) = 602.97 = a(30) 2 + b(30) + c
This expands to

NKAY NKAY
NKAY STUDY NANA KWABENA

225a + 15b + c = 362.78

NKAY
400a + 20b + c = 517.35
900a + 30b + c = 602.97
⎡ 225a + 15b + c ⎤ ⎡362.78⎤
⎢400a + 20b + c ⎥ = ⎢517.35⎥
⎢ ⎥ ⎢ ⎥
⎢⎣900a + 30b + c ⎥⎦ ⎢⎣602.97⎥⎦
This can be rewritten as
⎡ 225 15 1⎤ ⎡a ⎤ ⎡362.78⎤
⎢400 20 1⎥ ⎢b ⎥ = ⎢517.35⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢⎣900 30 1⎥⎦ ⎢⎣ c ⎥⎦ ⎢⎣602.97 ⎥⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Gauss-Seidel Method of Solving
Simultaneous Linear Equations
COMPLETE SOLUTION SET

1. A square matrix [A]n×n is diagonally dominant if


n
(A) aii ≥ ∑ aij , i = 1,2,..., n
j =1
i≠ j
n n
(B) aii ≥ ∑ aij , i = 1,2,..., n and aii > ∑ aij , for any i = 1,2,..., n
j =1 j =1
i≠ j i≠ j
n n
aii ≥ ∑ aij , i = 1,2,..., n and aii > ∑ aij , for any i = 1,2,..., n

NKAY
(C)
j =1 j =1
n
(D) aii ≥ ∑ aij , i = 1,2,..., n
j =1

Solution
The correct answer is (B).
n
A n × n square matrix [A] is a diagonally dominant matrix if aii ≥ ∑ aij , for all i = 1, 2, …, n
j =1
i≠ j
n
and aii > ∑ a ij for at least one i, that is, for each row, the absolute value of the diagonal
j =1
i≠ j

element is greater than or equal to the sum of the absolute values of the rest of the elements of
that row, and that the inequality is strictly greater than for at least one row. Diagonally dominant
matrices are important in ensuring convergence in iterative schemes of solving simultaneous
linear equations.
⎡15 6 7⎤
[A] = ⎢ 2 − 4 − 2⎥⎥ is a diagonally dominant matrix as

⎢⎣ 3 2 6 ⎥⎦

a11 = 15 = 15 ≥ a12 + a13 = 6 + 7 = 13


a 22 = − 4 = 4 ≥ a 21 + a 23 = 2 + − 2 = 4
a33 = 6 = 6 ≥ a31 + a32 = 3 + 2 = 5
and for at least one row, that is Rows 1 and 3 in this case, the inequality is a strictly greater than
inequality.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. Using [ x1 , x2 , x3 ] = [1,3,5] as the initial guess, the values of [ x1 , x2 , x3 ] after three iterations in
the Gauss-Seidel method for
⎡12 7 3 ⎤ ⎡ x1 ⎤ ⎡ 2⎤
⎢ 1 5 1 ⎥ ⎢ x ⎥ = ⎢− 5⎥
⎢ ⎥⎢ 2 ⎥ ⎢ ⎥
⎢⎣ 2 7 − 11⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣ 6⎥⎦
are
(A) [-2.8333 -1.4333 -1.9727]
(B) [1.4959 -0.90464 -0.84914]
(C) [0.90666 -1.0115 -1.0243]
(D) [1.2148 -0.72060 -0.82451]

Solution
The correct answer is (C).

Rewriting the equations gives

NKAY
2 − 7 x 2 − 3 x3
x1 =
12
− 5 − x1 − x3
x2 =
5
6 − 2 x1 − 7 x 2
x3 =
− 11

Iteration #1
Given the initial guess of the solution vector as
⎡ x1 ⎤ ⎡1⎤
⎢ x ⎥ = ⎢3⎥
⎢ 2⎥ ⎢ ⎥
⎢⎣ x3 ⎥⎦ ⎢⎣5⎥⎦

we get
2 − 7(3) − 3(5)
x1 =
12
= −2.8333
− 5 − (− 2.8333) − (5)
x2 =
5
= −1.4333
6 − 2(− 2.8333) − 7(− 1.4333)
x3 =
− 11
= −1.9727

NKAY NKAY
NKAY STUDY NANA KWABENA

At the end of the first iteration, the estimate of the solution vector is
⎡ x1 ⎤ ⎡− 2.8333⎤
⎢ x ⎥ = ⎢ − 1.4333 ⎥
⎢ 2⎥ ⎢ ⎥
⎢⎣ x3 ⎥⎦ ⎢⎣ − 1.9727 ⎥⎦

Iteration #2
Since the estimate of the solution vector at the end of Iteration #1 is
⎡ x1 ⎤ ⎡− 2.8333⎤
⎢ x ⎥ = ⎢ − 1.4333 ⎥
⎢ 2⎥ ⎢ ⎥
⎢⎣ x3 ⎥⎦ ⎢⎣ − 1.9727 ⎥⎦

we get
2 − 7(− 1.4333) − 3(− 1.9727 )
x1 =

NKAY
12
= 1.4960
− 5 − (1.4960 ) − (− 1.9727 )
x2 =
5
= −0.90465
6 − 2(1.4960 ) − 7(− 0.90464 )
x3 =
− 11
= −0.84915

At the end of the second iteration, the estimate of the solution vector is
⎡ x1 ⎤ ⎡ 1.4960 ⎤
⎢ x ⎥ = ⎢− 0.90465⎥
⎢ 2⎥ ⎢ ⎥
⎢⎣ x3 ⎥⎦ ⎢⎣− 0.84915⎥⎦

Iteration #3
Since the estimate of the solution vector at the end of Iteration #2 is
⎡ x1 ⎤ ⎡ 1.4960 ⎤
⎢ x ⎥ = ⎢− 0.90465⎥
⎢ 2⎥ ⎢ ⎥
⎢⎣ x3 ⎥⎦ ⎢⎣− 0.84915⎥⎦

we get

NKAY NKAY
NKAY STUDY NANA KWABENA

2 − 7(− 0.90465) − 3(− 0.84915)


x1 =
12
= 0.90666
− 5 − (0.90666 ) − (− 0.84914)
x2 =
5
= −1.0115

NKAY
6 − 2(0.90666 ) − 7(− 1.0115)
x3 =
− 11
= −1.0243

At the end of the third iteration, the estimate of the solution vector is
⎡ x1 ⎤ ⎡ 0.90666 ⎤
⎢ x ⎥ = ⎢− 1.0115⎥
⎢ 2⎥ ⎢ ⎥
⎢⎣ x3 ⎥⎦ ⎢⎣− 1.0243⎥⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

3. To ensure that the following system of equations,


2 x1 + 7 x 2 − 11x3 = 6
x1 + 2 x 2 + x3 = − 5
7 x1 + 5 x 2 + 2 x3 = 17
converges using the Gauss-Seidel method, one can rewrite the above equations as follows:
⎡2 7 − 11⎤ ⎡ x1 ⎤ ⎡ 6 ⎤
(A) ⎢⎢1 2 1 ⎥⎥ ⎢⎢ x2 ⎥⎥ = ⎢⎢− 5⎥⎥
⎢⎣7 5 2 ⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣ 17 ⎥⎦
⎡7 5 2 ⎤ ⎡ x1 ⎤ ⎡ 17 ⎤
(B) ⎢1
⎢ 2 1 ⎥⎥ ⎢⎢ x2 ⎥⎥ = ⎢⎢− 5⎥⎥

NKAY
⎢⎣2 7 − 11⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣ 6 ⎥⎦
⎡7 5 2 ⎤ ⎡ x1 ⎤ ⎡ 6 ⎤
(C) ⎢1
⎢ 2 1 ⎥⎥ ⎢⎢ x2 ⎥⎥ = ⎢⎢− 5⎥⎥
⎢⎣27 − 11⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣ 17 ⎥⎦
(D) The equations cannot be rewritten in a form to ensure convergence.

Solution
The correct answer is (B).

A system of equations will converge using the Gauss-Seidel method if the coefficient matrix is
diagonally dominant. Thus, rewriting the system of equations as
⎡7 5 2 ⎤ ⎡ x1 ⎤ ⎡ 17 ⎤
⎢1 2 1 ⎥ ⎢ x ⎥ = ⎢− 5⎥
⎢ ⎥⎢ 2⎥ ⎢ ⎥
⎢⎣2 7 − 11⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣ 6 ⎥⎦
results in the coefficient matrix being diagonally dominant.

a11 = 7 = 7 ≥ a12 + a13 = 5 + 2 = 7


a 22 = 2 = 2 ≥ a 21 + a 23 = 1 + 1 = 2
a33 = − 11 = 11 ≥ a31 + a32 = 2 + 7 = 9

NKAY NKAY
NKAY STUDY NANA KWABENA

⎡12 7 3 ⎤ ⎡ x1 ⎤ ⎡ 22 ⎤
4. For ⎢⎢ 1 5 1 ⎥⎥ ⎢⎢ x2 ⎥⎥ = ⎢⎢ 7 ⎥⎥ and using [x1 x2 x3 ] = [1 2 1] as the initial
⎢⎣ 2 7 − 11⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣− 2⎥⎦
guess, the values of [x1 x2 x3 ] are found at the end of each iteration as

Iteration # x1 x2 x3
1 0.41667 1.1167 0.96818
2 0.93990 1.0184 1.0008
3 0.98908 1.0020 0.99931
4 0.99899 1.0003 1.0000

At what first iteration number would you trust at least 1 significant digit in your solution?
(A) 1
(B) 2
(C) 3

NKAY
(D) 4

Solution
The correct answer is (C).

The absolute relative approximate error at the end of the first iteration is
0.41667 − 1.0000
∈a 1 = × 100
0.41667

= 140.00%
1.1167 − 2.0000
∈a 2
= × 100
1.1167

= 79.104%
0.96818 − 1.0000
∈a 3
= × 100
0.96818

= 3.2864%
The maximum absolute relative approximate error is 140%.
Since, 140% ≤ 0.5 × 10 2− m , m = −1 . There are no significant digits correct. We are looking for 1
significant digit, so we must continue to conduct iterations.

NKAY NKAY
NKAY STUDY NANA KWABENA

The absolute relative approximate error at the end of the second iteration is

0.93990 − 0.41667
∈a 1 = × 100
0.93990

= 55.669%
1.0184 − 1.1167
∈a 2
= × 100
1.0184

= 9.6509%
1.0008 − 0.96818
∈a 3
= × 100
1.0008

NKAY
= 3.2564%
The maximum absolute relative approximate error is 55.669%.
Since, 55.669% ≤ 0.5 × 10 2 − m , m = −1 . There are no significant digits correct. We are looking for
1 significant digit so we must continue to conduct more iterations.

The absolute relative approximate error at the end of the third iteration is

0.98908 - 0.9399
∈a 1 = × 100
0.98908

= 4.9727%
1.0020 - 1.0184
∈a 2
= × 100
1.0020

= 1.6322%
0.99930 - 1.0007
∈a 3
= × 100
0.99930

= 0.14660%
The maximum absolute approximate error is 4.9733%.
Since, 4.9733 % ≤ 0.5 × 10 2− m , m = 1 . There is at least one significant digit correct. Since we
were looking for 1 correct significant digit, we need not conduct any more iterations.

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The algorithm for the Gauss-Seidel method to solve [A][X ] = [C ] is given as follows when
using n max iterations. The initial value of [ X ] is stored in [ X ] .

(A) Sub Seidel ( n, a, x, rhs , nmax )


For k = 1 To nmax
For i = 1 To n
For j = 1 To n
If ( i <> j ) Then
Sum = Sum + a (i, j ) * x ( j )
endif
Next j
x (i ) = ( rhs (i ) − Sum ) / a (i, i )
Next i
Next j
End Sub

NKAY
(B) Sub Seidel ( n, a, x, rhs , nmax)
For k = 1 To nmax
For i = 1 To n
Sum = 0
For j = 1 To n
If ( i <> j ) Then
Sum = Sum + a (i, j ) * x ( j )
endif
Next j
x (i ) = ( rhs (i ) − Sum ) / a (i, i )
Next i
Next k
End Sub

(C) Sub Seidel ( n, a, x, rhs , nmax)


For k = 1 To nmax
For i = 1 To n
Sum = 0
For j = 1 To n
Sum = Sum + a (i, j ) * x ( j )
Next j
x (i ) = ( rhs (i ) − Sum ) / a (i, i )
Next i
Next k
End Sub

NKAY NKAY
NKAY STUDY NANA KWABENA

(D) Sub Seidel ( n, a, x, rhs , nmax )


For k = 1 To nmax
For i = 1 To n
Sum = 0
For j = 1 To n
If ( i <> j ) Then
Sum = Sum + a (i, j ) * x ( j )
endif
Next j
x (i ) = ( rhs (i ) − Sum ) / a (i, i )
Next i
Next k
End Sub

NKAY
Solution
The correct answer is (B).

Sub Seidel(n, a, x, rhs, nmax)


For k = 1 To nmax
For i = 1 To n
Sum = 0
For j = 1 To n
If (i <> j) Then
Sum = Sum + a(i, j) * x(j)
endif

Next j
x(i) = (rhs(i) - Sum) / a(i, i)
Next i
Next k
End Sub
Choice (A) is incorrect because the value of the variable ‘Sum’ needs to be reset on each row.
Choice (C) is incorrect because it does not include an if statement that only adds the sum when
the value of ‘i’ is not equal to the value of ‘j’. The value of ‘Sum’ would include the value of
‘a(i,i)*x(i)’, which would give an incorrect answer for the value of ‘x(i)’. Choice (D) is incorrect
because it does not subtract the value of ‘Sum’ from ‘rhs(i)’, which again, would give the
incorrect answer for ‘x(i)’.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. Thermistors measure temperature, have a nonlinear output and are valued for a limited range.
So when a thermistor is manufactured, the manufacturer supplies a resistance vs. temperature
curve. An accurate representation of the curve is generally given by
1
= a 0 + a1 ln( R ) + a 2 {ln (R )} + a3 {ln (R )}
2 3

T
where T is temperature in Kelvin, R is resistance in ohms, and a 0 , a1 , a 2 , a3 are constants of the
calibration curve. Given the following for a thermistor
R T
ohm °C
1101.0 25.113
911.3 30.131
636.0 40.120
451.1 50.128
the value of temperature in °C for a measured resistance of 900 ohms most nearly is
(A) 30.002
(B) 30.473

NKAY
(C) 31.272
(D) 31.445

Solution
The correct answer is (B).

Given
1
= a 0 + a1 ln( R ) + a 2 {ln (R )} + a3 {ln (R )}
2 3

T
Then from the data in the table we can write four equations

1
= a 0 + a1 ln(1101) + a 2 {ln (1101)} + a3 {ln (1101)}
2 3

25.113
1
= a 0 + a1 ln(911.3) + a 2 {ln (911.3)} + a3 {ln (911.3)}
2 3

30.131
1
= a 0 + a1 ln(636) + a 2 {ln (636)} + a3 {ln (636 )}
2 3

40.120
1
= a0 + a1 ln(451.1) + a 2 {ln (451.1)} + a3 {ln (451.1)}
2 3

50.128
which reduce to
0.039820 = a 0 + 7.0040a1 + 49.056a 2 + 343.58a3
0.033188 = a 0 + 6.8149a1 + 46.442a 2 + 316.50a3
0.024925 = a 0 + 6.4552a1 + 41.670a 2 + 268.99a3
0.019949 = a0 + 6.1117a1 + 37.353a 2 + 228.29a3
In matrix form the equations can be rewritten as

NKAY NKAY
NKAY STUDY NANA KWABENA

⎡343.58 49.056 7.0040 1⎤ ⎡ a3 ⎤ ⎡0.039820⎤


⎢ 316.5 46.442
⎢ 6.8149 1⎥⎥ ⎢⎢a 2 ⎥⎥ ⎢⎢ 0.03318 ⎥⎥
=
⎢268.99 41.670 6.4552 1⎥ ⎢ a1 ⎥ ⎢0.024925⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣228.29 37.353 6.1117 1⎦ ⎣ a0 ⎦ ⎣0.019949⎦

NKAY
Using any method gives
a 3 = 0.011173
a 2 = −0.20448
a1 = 1.2605
a 0 = −2.5964
1
= −2.5964 + 1.2605 ln( R) + −0.20448{ln (R )} + 0.011173{ln(R )}
2 3

T
= −2.5964 + 1.2605 ln(900) + −0.20448{ln(900)} + 0.011173{ln(900)}
2 3

= 0.032816
1
T=
0.032816
= 30.473 °C

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
LU Decomposition Method
Simultaneous Linear Equations
COMPLETE SOLUTION SET

1. The [L][U ] decomposition method is computationally more efficient than Naïve Gauss
elimination for solving
(A) a single set of simultaneous linear equations.
(B) multiple sets of simultaneous linear equations with different coefficient matrices
and the same right hand side vectors.
(C) multiple sets of simultaneous linear equations with the same coefficient matrix
and different right hand side vectors.

NKAY
(D) less than ten simultaneous linear equations.

Solution
The correct answer is (C).

An example can be demonstrated by finding the inverse of the matrix [ A] . The problem of
finding the inverse reduces to solving n sets of equations with the n columns of the identity
matrix as the RHS vector. For calculations of each column of the inverse of the [ A] matrix, the
coefficient matrix [ A] in the set of equations [A][X ] = [C ] does not change. So if we use the LU
Decomposition method, the [A] = [L][U ] decomposition needs to be done only once and the use
of equations [L][Z ] = [C ] and [U ] [ X ] = [Z ] still needs to be done n times.

So the total computational time required to find the inverse of a matrix using LU decomposition
n3 4n 3
is approximately proportional to + n×n =2
.
3 3
In comparison, if the Gaussian elimination method were applied to find the inverse of a matrix,
the time would be approximately proportional to
⎛ n3 n 2 ⎞ n 4 n3
n⎜⎜ + ⎟⎟ = +
⎝ 3 2⎠ 3 2
n3
with the computational time of forward elimination approximately proportional to , and back
3
n2
substitution approximately proportional to .
2

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAYFor large values of n,


n 4 n 3 4n 3
3
+ 〉〉
2 3
.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. The lower triangular matrix [L ] in the [L][U ] decomposition of the matrix given below
⎡25 5 4 ⎤ ⎡ 1 0 0⎤ ⎡u11 u12 u13 ⎤
⎢10 8 16 ⎥ = ⎢
⎢ ⎥ ⎢ 21 1 0⎥⎥ ⎢⎢ 0 u 22 u 23 ⎥⎥
⎢⎣ 8 12 22⎥⎦ ⎢⎣ 31 32 1⎥⎦ ⎢⎣ 0 0 u 33 ⎥⎦
is
⎡ 1 0 0⎤
(A) ⎢0.40000
⎢ 1 0⎥⎥
⎣⎢0.32000 1.7333 1⎥⎦

⎡25 5 4 ⎤
(B) ⎢ 0 6 14.400 ⎥
⎢ ⎥
⎢⎣ 0 0 − 4.2400⎥⎦

NKAY
⎡ 1 0 0⎤
(C) ⎢10 1 0⎥
⎢ ⎥
⎢⎣ 8 12 0⎥⎦

⎡ 1 0 0⎤
(D) ⎢0.40000
⎢ 1 0⎥⎥
⎢⎣0.32000 1.5000 1⎥⎦

Solution
The correct answer is (A).

We must first complete the first step of forward elimination.


⎡25 5 4 ⎤
⎢10 8 16 ⎥
⎢ ⎥
⎢⎣ 8 12 22⎥⎦
10
First step: Multiply Row 1 by = 0.4 , and subtract the results from Row 2
25
⎡25 5 4 ⎤
[Row 2] − [Row 1]× (0.4) = ⎢⎢ 0 6 14.4⎥⎥
⎢⎣ 8 12 22 ⎥⎦

8
Multiply Row 1 by = 0.32 , and subtract the results from Row 3
25

NKAY NKAY
NKAY STUDY NANA KWABENA

⎡25 5 4 ⎤
[Row 3] − [Row 1]× (0.32) = ⎢ 0 6 14.4 ⎥⎥

⎢⎣ 0 10.4 20.72⎥⎦

To find 21 and 31 , what multiplier was used to make the a 21 and a 31 elements zero in the first
step of forward elimination using the Naïve Gauss elimination method? They are

NKAY
21 = 0 .4

31 = 0.32
To find 32 , what multiplier would be used to make the a 32 element zero? Remember the a 32
element is made zero in the second step of forward elimination.
So
10.4
32 = = 1.7333
6
Hence
⎡ 1 0 0⎤
[L] = ⎢0.40000 1 0⎥⎥

⎢⎣0.32000 1.7333 1⎥⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

3. The upper triangular matrix [U ] in the [L][U ] decomposition of the matrix given below
⎡25 5 4 ⎤ ⎡ 1 0 0⎤ ⎡u11 u12 u13 ⎤
⎢ 0 8 16 ⎥ = ⎢
⎢ ⎥ ⎢ 21 1 0⎥⎥ ⎢⎢ 0 u 22 u 23 ⎥⎥
⎢⎣ 0 12 22⎥⎦ ⎢⎣ 31 32 1⎥⎦ ⎢⎣ 0 0 u 33 ⎥⎦
is

⎡ 1 0 0⎤
(A) ⎢0.40000
⎢ 1 0⎥⎥
⎢⎣0.32000 1.7333 1⎥⎦

⎡25 5 4 ⎤
(B) ⎢ 0 6 14.400 ⎥
⎢ ⎥

NKAY
⎢⎣ 0 0 − 4.2400⎥⎦

⎡25 5 4 ⎤
(C) ⎢ 0 8 16 ⎥
⎢ ⎥
⎢⎣ 0 0 − 2⎥⎦

⎡1 0.2000 0.16000⎤
(D) ⎢0
⎢ 1 2.4000 ⎥⎥
⎢⎣0 0 − 4.240 ⎥⎦
Solution
The correct answer is (C).

The [U ] matrix is the same as the coefficient matrix that is found at the end of the forward
elimination steps of the Naïve Gauss elimination method, that is
⎡25 5 4 ⎤
[U ] = ⎢⎢ 0 8 16 ⎥⎥
⎢⎣ 0 12 22⎥⎦

First step: The first step of forward elimination does not need to be conducted as a 21 and a31 are
already zero.
12
Second step: Multiply Row 2 by = 1.5 and subtract the results from Row 3
8

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
⎡25 5 4 ⎤
[Row 3] − [Row 2]× (1.5) = ⎢⎢ 0 8 16 ⎥⎥
⎢⎣ 0 0 − 2⎥⎦

Thus,
⎡25 5 4 ⎤
[U ] = ⎢⎢ 0 8 16 ⎥⎥
⎢⎣ 0 0 − 2⎥⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

4. For a given 2000 × 2000 matrix [ A] , assume that it takes about 15 seconds to find the inverse
of [A] by the use of the [L][U ] decomposition method, that is, finding the [L][U ] once, and then
doing forward substitution and back substitution 2000 times using the 2000 columns of the
identity matrix as the right hand side vector. The approximate time, in seconds, that it will take
to find the inverse if found by repeated use of the Naive Gauss elimination method, that is, doing
forward elimination and back substitution 2000 times by using the 2000 columns of the identity
matrix as the right hand side vector is most nearly
(A) 300
(B) 1500
(C) 7500
(D) 30000

Solution
The correct solution is (C).

NKAY
The computational times for finding the inverse of [ A] by Naïve Gaussian elimination and LU
n 4 n3 4n 3
decomposition are proportional to + and , respectively. Hence the ratio of
3 2 3
computational time is
n 4 n3
+
R≈ 3 2
4n 3
3
For a 2000 × 2000 matrix
2000 4 20003
+
R≈ 3 2
20003

3
1.600 × 1013 8.000 × 109
+
= 3 2
3.200 × 1010
3
5.3373 × 10 12
=
1.0667 × 1010
= 500.38
Since it takes 15 seconds to find the inverse by LU decomposition, it would take
500.38 ×15 = 7505.6 seconds
to find the inverse by using Naïve Gaussian elimination.

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The algorithm for solving a set of n equations [A][X ] = [C ] , where [A] = [L][U ] involves
solving [L][Z ] = [C ] by forward substitution. The algorithm to solve [L][Z ] = [C ] is given by

(A) z1 = c1 / l11
for i from 2 to n do
sum = 0
for j from 1 to i do
sum = sum + lij * z j
end do
zi = (ci − sum) / lii
end do
(B) z1 = c1 / l11
for i from 2 to n do
sum = 0

NKAY
for j from 1 to (i − 1) do
sum = sum + lij * z j
end do
zi = (ci − sum) / lii
end do
(C) z1 = c1 / l11
for i from 2 to n do
for j from 1 to (i − 1) do
sum = sum + lij * z j
end do
zi = (ci − sum) / lii
end do
(D) for i from 2 to n do
sum = 0
for j from 1 to (i − 1) do
sum = sum + lij * z j
end do
zi = (ci − sum) / lii
end do

Solution
The correct answer is (B).
Since [L][Z ] = [C ] is written as

NKAY NKAY
NKAY STUDY NANA KWABENA

⎡1 0 … 0⎤ ⎡ z1 ⎤ ⎡ c1 ⎤
⎢ 1 ⎥ ⎢ z ⎥ ⎢c ⎥
⎢ 21 ⎥⎢ 2 ⎥ ⎢ 2 ⎥
⎢ 31 0⎥ ⎢ z 3 ⎥ = ⎢ c3 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢⎣ n1 n2 1⎥⎦ ⎢⎣ z n ⎥⎦ ⎢⎣c n ⎥⎦

We know that the first step of forward substitution is


z1 = c1 / l11
The next equations would be
c − 21 × z1
z2 = 2

NKAY
22

c3 − ( × z1 + × z2 )
z3 = 31 32

33

i −1
ci − ∑ ( ij ×zj)
j =1
zi =
ii

Thus, the algorithm is

z1 = c1 / l11
for i from 2 to n do
sum = 0 (the variable sum must be cleared each time through the loop)
i −1
for j from 1 to (i-1) do (this loop finds ∑(
j =1
ij ×zj))

sum = sum + l ij * z j
end do
zi = (ci – sum) / lii
end do

NKAY NKAY
NKAY STUDY NANA KWABENA

6. To solve boundary value problems, the finite difference method is used resulting in
simultaneous linear equations with tridiagonal coefficient matrices. These are solved using the
specialized [L][U ] decomposition method. The set of equations in matrix form with a tridiagonal
coefficient matrix for
d2y
2
= 6 x − 0.5 x 2 , y (0) = 0 , y (12 ) = 0 ,
dx
using the finite difference method with a second order accurate central divided difference
method and a step size of h = 4 is
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢0.0625 0.125 0.0625
⎢ 0 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢16.0⎥⎥
(A) =
⎢ 0 0.0625 0.125 0.0625⎥ ⎢ y 3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0 0 1 ⎦⎣ y4 ⎦ ⎣ 0 ⎦
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢0.0625 − 0.125 0.0625
⎢ 0 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢16.0⎥⎥

NKAY
(B) =
⎢ 0 0.0625 − 0.125 0.0625⎥ ⎢ y 3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0 0 1 ⎦⎣ y4 ⎦ ⎣ 0 ⎦
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢ 0
⎢ 0 0 1 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢ 0 ⎥⎥
(C) =
⎢0.0625 − 0.125 0.0625 0 ⎥ ⎢ y 3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0.0625 − 0.125 0.0625⎦ ⎣ y 4 ⎦ ⎣16.0⎦
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢ 0
⎢ 0 0 1 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢ 0 ⎥⎥
(D) =
⎢0.0625 0.125 0.0625 0 ⎥ ⎢ y 3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0.0625 0.125 0.0625⎦ ⎣ y 4 ⎦ ⎣16.0⎦

Solution
The correct answer is (B).

The first equation and is


y (0) = 0
or
y1 = 0

d2y
The approximation for with a second order accurate central divided difference method is
dx 2
d 2 y yi−1 − 2 yi + yi+1

dx 2 h2
Hence

NKAY NKAY
NKAY STUDY NANA KWABENA

yi−1 − 2 yi + yi+1
≈ 6 xi − 0.5 xi2
h2
Where x i +1 = xi + h
At node i = 2, x2 = 0 + 4 = 4

y1 − 2 y 2 + y 3
= 6 × 4 − 0.5 × 4 2

NKAY
2
4
0.0625 y1 − 0.125 y 2 + 0.0625 y 3 = 16
At node i = 3, x 2 = 4 + 4 = 8
y 2 − 2 y3 + y 4
2
= 6 × 8 − 0.5 × 8 2
4
0.0625 y 2 − 0.125 y 3 + 0.0625 y 4 = 16
The final equation is
y (12) = 0
or
y4 = 0
Written in matrix form
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢0.0625 − 0.125 0.0625
⎢ 0 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢16.0⎥⎥
=
⎢ 0 0.0625 − 0.125 0.0625⎥ ⎢ y 3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0 0 1 ⎦⎣ y4 ⎦ ⎣ 0 ⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Background
Interpolation
COMPLETE SOLUTION SET

NKAY
1. The number of different polynomials that can go through two fixed data points (x1 , y1 ) and
(x2 , y 2 ) is
A) 0
B) 1
C) 2
D) infinite

Solution
The correct answer is (D).

The number of polynomials that can go through two fixed data points (x1 , y1 ) and ( x2 , y 2 ) is
infinite. For example the polynomials y = 5 x − 6 and y = x 2 go through the two data points
(2,4) and (3,9). So does every polynomial of the form y = ax m + bx n , where m and n are any
positive integers of your choice.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. Given n+1 data pairs, a unique polynomial of degree __________________ passes


through n + 1 data points.
(A) n + 1
(B) n + 1 or less
(C) n
(D) n or less

Solution
The correct answer is (D).

A unique polynomial of degree n or less passes through n + 1 data points. If the polynomial is
not unique, then at least two polynomials of order n or less pass through the n + 1 data points.
Assume two polynomials Pn (x ) and Qn ( x ) go through n + 1 data points,
(x0 , y0 ), (x1 , y1 ),…, (xn , y n )
Then
Rn ( x ) = Pn ( x ) − Qn (x )

NKAY
Since Pn (x ) and Qn ( x ) pass through all the n + 1 data points,
Pn ( xi ) = Qn ( xi ), i = 0, … , n
Hence
Rn (xi ) = Pn ( xi ) − Qn ( xi ) = 0, i = 0, … , n
The n order polynomial Rn (x ) has n + 1 zeros. A polynomial of order n can have n + 1 zeros
th

only if it is identical to a zero polynomial, that is,


Rn ( x ) ≡ 0
Hence
Pn (x ) ≡ Qn (x )

Extra Notes for the Student:


How can one show that if a second order polynomial has three zeros, then it is zero everywhere?
If R2 ( x ) = a 0 + a1 x + a 2 x 2 , then if it has three zeros at x1, x2, and x3, then
R2 ( x1 ) = a0 + a1 x1 + a2 x12 = 0
R2 ( x2 ) = a0 + a1 x2 + a2 x22 = 0
R2 ( x3 ) = a0 + a1 x3 + a2 x32 = 0
which in matrix form gives
⎡1 x1 x12 ⎤ ⎡a 0 ⎤ ⎡0⎤
⎢ 2 ⎥⎢ ⎥ ⎢ ⎥
⎢1 x 2 x 2 ⎥ ⎢ a1 ⎥ = ⎢0⎥
⎢1 x3 x32 ⎥ ⎢⎣a 2 ⎥⎦ ⎢⎣0⎥⎦
⎣ ⎦
The above set of equations has a trivial solution, that is, a1 = a 2 = a3 = 0 . But is this the only
solution? That is true if the coefficient matrix is invertible.

NKAY NKAY
NKAY STUDY NANA KWABENA

The determinant of the coefficient matrix can be found symbolically with the forward

NKAY
elimination steps of naïve Gauss elimination to give
⎡1 x1 x12 ⎤
⎢ ⎥
det ⎢1 x 2 x 22 ⎥ = x 2 x32 − x 22 x3 − x1 x32 + x12 x3 + x1 x 22 − x12 x 2
⎢1 x3 x32 ⎥
⎣ ⎦
= ( x1 − x 2 )( x 2 − x3 )( x3 − x1 )
Since
x1 ≠ x2 ≠ x3
the determinant is non-zero. Hence the coefficient matrix is invertible. a1 = a 2 = a3 = 0 is the
only solution, that is, R2 ( x ) ≡ 0.

NKAY NKAY
NKAY STUDY NANA KWABENA

3. The following function(s) can be used for interpolation:


(A) polynomial

NKAY
(B) exponential
(C) trigonometric
(D) all of the above

Solution
The correct answer is (D).

Polynomials are often used for interpolation because they are easy to evaluate, differentiate and
integrate. However, other functions such as trigonometric and exponential can be used for
interpolation. How is a polynomial easy to evaluate as compared to a trigonometric function?
Because terms such as xm in a polynomial involve multiplication of x to itself m − 1 times.
However, trigonometric and exponential functions include the use of computationally more
involved calculations via a Taylor series.

NKAY NKAY
NKAY STUDY NANA KWABENA

4. Polynomials are the most commonly used functions for interpolation because they are
easy to

NKAY
(A) evaluate
(B) differentiate
(C) integrate
(D) evaluate, differentiate and integrate

Solution
The correct answer is (D).

Polynomials are often used for interpolation because they are easy to evaluate, differentiate and
integrate. However, other functions such as trigonometric and exponential can be used for
interpolation. How is a polynomial easy to evaluate as compared to a trigonometric function?
Because terms such as xm in a polynomial involve multiplication of x to itself m − 1 times.
However, trigonometric and exponential functions include the use of computationally more
involved calculations via a Taylor series.

NKAY NKAY
NKAY STUDY NANA KWABENA

5. Given n + 1 data points (x0 , y 0 ), ( x1 , y1 ),......, ( x n−1 , y n−1 ), ( x n , y n ) , assume you pass a

NKAY
function f (x) through all the data points. If now the value of the function f (x) is
required to be found outside the range of the given x-data, the procedure is called
(A) extrapolation
(B) interpolation
(C) guessing
(D) regression

Solution
The correct answer is (A).

If x falls outside the range of x for which the data is given, it is no longer interpolation but
instead is called extrapolation.

NKAY NKAY
NKAY STUDY NANA KWABENA

6. Given three data points (1,6), (3,28), and (10, 231), it is found that the function
y = 2 x 2 + 3x + 1 passes through the three data points. Your estimate of y at x = 2 is

NKAY
most nearly
(A) 6
(B) 15
(C) 17
(D) 28

Solution
The correct answer is (B).

y ( x) = 2 x 2 + 3x + 1
y (2) = 2 × 2 2 + 3 × 2 + 1
= 8 + 6 +1
= 15

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Lagrange Method
Interpolation
COMPLETE SOLUTION SET
1. Given n+1 data pairs, a unique polynomial of degree ______________ passes through the
n  1 data points.
(A) n  1
(B) n
(C) n or less
(D) n  1 or less

NKAY
Solution
The correct answer is (C).

A unique polynomial of degree n or less passes through n  1 data points. Assume two
polynomials Pn  x  and Qn  x  go through n  1 data points,
x0 , y 0 , x1 , y1 ,, xn , y n 
Then
Rn  x   Pn  x   Qn x 
Since Pn  x  and Qn  x  pass through all the n  1 data points,
Pn  xi   Qn  xi , i  0,  , n
Hence
Rn  xi   Pn ( xi )  Qn  xi   0, i  0,  , n
The n order polynomial Rn  x  has n  1 zeros. A polynomial of order n can have n  1 zeros
th

only if it is identical to a zero polynomial, that is,


Rn  x   0
Hence
Pn  x   Qn  x 
How can one show that if a second order polynomial has three zeros, then it is zero everywhere?
If R2  x   a 0  a1 x  a 2 x 2 , then if it has three zeros at x1 , x 2 , and x3 , then
R2  x1   a 0  a1 x1  a 2 x12  0
R2  x 2   a 0  a1 x 2  a 2 x 22  0
R2  x3   a 0  a1 x3  a 2 x32  0
Which in matrix form gives

NKAY NKAY
NKAY STUDY NANA KWABENA

1 x1 x12   a 0  0
 
1 x 2 x 22   a1   0
1 x3 x32  a 2  0

NKAY
The final solution a1  a 2  a3  0 exists if the coefficient matrix is invertible. The determinant
of the coefficient matrix can be found symbolically with the forward elimination steps of naïve
Gauss elimination to give
1 x1 x12 
 
det 1 x 2 x 22   x 2 x32  x 22 x3  x1 x32  x12 x3  x1 x 22  x12 x 2
1 x3 x32 
 
 ( x1  x 2 )( x 2  x3 )( x3  x1 )
Since
x1  x 2  x3
the determinant is non-zero. Hence, the coefficient matrix is invertible. Therefore,
a1  a 2  a3  0 is the only solution, that is, R2  x   0.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. Given the two points a, f a , b, f b  , the linear Lagrange polynomial f 1  x  that passes
through these two points is given by
xb xa
(A) f1  x   f a   f b 
a b ab
(B) f 1  x   f a   f b 
x x
ba ba
f b   f a 
(C) f 1 x   f a   b  a 
ba
xb xa
(D) f1  x   f a   f b 
a b ba

Solution
The correct answer is (D).
n
f n ( x)   Li ( x) f ( xi )
i 0
1

NKAY
f 1 ( x)   Li ( x) f ( xi )
i 0

 L0  x  f  x 0   L1  x  f  x1 
 L0  x  f a   L1  x  f b 

n x  xj
Li ( x)  
j 0 xi  x j
j i
1 x  xj
L0 ( x)  
j 0 x0  x j
j 0

x  x1

x0  x1
xb

ab
1 x  xj
L1 ( x)  
j 0 x1  x j
j 1

x  x0

x1  x0
xa

ba
f1 ( x)  L0  x  f a   L1  x  f b 
x b xa
 f a   f b 
ab ba

NKAY NKAY
NKAY STUDY NANA KWABENA

3. The Lagrange polynomial that passes through the 3 data points is given by
x 15 18 22
y 24 37 25
f 2  x   L0  x 24  L1  x 37   L2  x 25
The value of L1  x  at x  16 is
(A) –0.071430
(B) 0.50000
(C) 0.57143
(D) 4.3333

NKAY
Solution
The correct answer is (B).

n xxj
Li ( x )  
j 0 xi  x j
j i

2 xxj
L1 ( x)  
j 0 x1  x j
j 1

 x  x0  x  x2 
   
 x1  x0  x1  x2 
 16  15  16  22 
  
 18  15  18  22 
 1   6 
   
 3   4 
 0.50000

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The following data of the velocity of a body is given as a function of time.


Time (s) 10 15 18 22 24
Velocity (m/s) 22 24 37 25 123
A quadratic Lagrange interpolant is found using three data points, t  15 , 18 and 22. From
this information, at what of the times given in seconds is the velocity of the body 26 m/s during
the time interval of t  15 to t  22 seconds.
(A) 20.173
(B) 21.858
(C) 21.667
(D) 22.020

Solution
The correct answer is (B).

n
vn (t )   Li (t )v(ti )
i 0

where

NKAY
t0  15, vt0   24

t1  18, vt1   37

t 2  22, vt 2   25

gives
n t tj
Li (t )  
j 0 ti  t j
j i

2 t tj
L0 (t )  
j 0 t0  t j
j 0

 t  t1  t  t 2 
   
 t 0  t1  t 0  t 2 
2 t tj
L1 (t )  
j 0 t1  t j
j 1

 t  t0  t  t 2 
   
 t1  t 0  t1  t 2 
2 t tj
L2 (t )  
j 0 t2  t j
j2

NKAY NKAY
NKAY STUDY NANA KWABENA

 t  t0  t  t1 
   
 t2  t0 
 2 1 
t t

 t  t1  t  t 2   t  t 0  t  t 2   t  t 0  t  t1 
v2 (t )    v(t0 )    v(t1 )    v(t 2 )
 t0  t1  t0  t 2   t1  t 0   t1  t 2   t 2  t 0  t 2  t1 
 t  18  t  22   t  15  t  22   t  15  t  18 
  v(15)    v(18)    v (22)

NKAY
 15  18  15  22   18  15  18  22   22  15  22  18 
 t  18  t  22   t  15  t  22   t  15  t  18 
26      24      37      25
 15  18  15  22   18  15  18  22   22  15  22  18 
 t  18  t  22   t  15  t  22   t  15  t  18 
26      24      37      25
  3   7   3   4   7  4 
 t 2  40t  396   t 2  37t  330   t 2  33t  270 
26     24     37     25
 21    12   28 
  
26  1.1429t 2  45.714t  452.57   3.0833t 2  114.08t  1017.5 

 0.89286t 2  29.464t  241.07 
26  1.0476t 2  38.905t  323.86
0  1.0476t 2  38.905t  349.86
 38.905  38.9052  4  1.0476  349.86
t
2  1.0476
 21.858 and 15.278

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The path that a robot is following on a x-y plane is found by interpolating four data points as

x 2 4.5 5.5 7
y 7.5 7.5 6 5
y  x   0.15238 x  2.2571x  9.6048 x  3.9000
3 2

The length of the path from x  2 to x  7 is


(A) 7.5  7.52  4.5  22  6  7.52  5.5  4.52  5  62  7  5.52
7
(B) 
2
1  (0.15238 x 3  2.2571x 2  9.6048 x  3.9000) 2 dx
7
(C) 
2
1  (0.45714 x 2  4.5142 x  9.6048) 2 dx

NKAY
7
(D)  (0.15238 x 3  2.2571x 2  9.6048 x  3.9000)dx
2

Solution
The correct answer is (C).

The length S of the curve y  x  from a to b is given by


2
 dy 
b
S 1    dx
a  dx 
where
a2
b7
giving
2
 dy 
7
S   1    dx
2  dx 
y  x   0.15238 x 3  2.2571x 2  9.6048 x  3.9000
dy
 0.45714 x 2  4.5142 x  9.6048
dx
Thus,

 
7
S   1  0.45714 x 2  4.5142 x  9.6048 dx
2

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The following data of the velocity of a body is given as a function of time.


Time (s) 0 15 18 22 24
Velocity (m/s) 22 24 37 25 123
If you were going to use quadratic interpolation to find the value of the velocity at t  14.9
seconds, what three data points of time would you choose for interpolation?
(A) 0, 15, 18
(B) 15, 18, 22

NKAY
(C) 0, 15, 22
(D) 0, 18, 24

Solution
The correct answer is (A).

We need to choose the three points closest to t  14.9 s that also bracket t  14.9 s . Although the
data points in choice (B) are closest to 14.9, they do not bracket it. This would be performing
extrapolation, not interpolation. Choices (C) and (D) both bracket t  14.9 s but they are not the
closest three data points.
Time (s) Velocity (m/s) How far is t  14.9 s
0 22 14.9  0  14.9
15 24 14.9  15  0.1
18 37 14.9  18  3.1
22 25 14.9  22  7.1
24 123 14.9  24  9.1

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Newton’s Divided Difference Polynomial Method
Interpolation
COMPLETE SOLUTION SET
1. If a polynomial of degree n has more than n zeros, then the polynomial is
(A) oscillatory
(B) zero everywhere
(C) quadratic
(D) not defined

Solution
The correct answer is (B).

NKAY
A unique polynomial of degree n or less passes through n + 1 data points. Assume two
polynomials Pn ( x ) and Qn ( x ) go through n + 1 data points,
(x0 , y 0 ), (x1 , y1 ),…, (xn , y n )
Then
Rn ( x ) = Pn ( x ) − Qn ( x )
Since Pn ( x ) and Qn ( x ) pass through all the n + 1 data points,
Pn ( xi ) = Qn ( xi ), i = 0, … , n
Hence
Rn ( xi ) = Pn ( xi ) − Qn ( xi ) = 0, i = 0, … , n
The nth order polynomial Rn (x ) has n + 1 zeros. A polynomial of order n can have n + 1 zeros
only if it is identical to a zero polynomial, that is,
Rn ( x ) ≡ 0
Hence
Pn ( x ) ≡ Qn ( x )
How can one show that if a second order polynomial has three zeros, then it is zero everywhere?
If R2 ( x ) = a 0 + a1 x + a 2 x 2 , then if it has three zeros at x1 , x2 , and x3 , then
R2 ( x1 ) = a0 + a1 x1 + a2 x12 = 0
R2 ( x2 ) = a0 + a1 x2 + a2 x22 = 0
R2 ( x3 ) = a0 + a1 x3 + a2 x32 = 0
Which in matrix form gives
⎡1 x1 x12 ⎤ ⎡a 0 ⎤ ⎡0⎤
⎢ 2 ⎥⎢ ⎥ ⎢ ⎥
⎢1 x 2 x 2 ⎥ ⎢ a1 ⎥ = ⎢0⎥
⎢1 x3 x32 ⎥ ⎢⎣a 2 ⎥⎦ ⎢⎣0⎥⎦
⎣ ⎦

NKAY NKAY
NKAY STUDY NANA KWABENA

The final solution a1 = a 2 = a3 = 0 exists if the coefficient matrix is invertible. The determinant

NKAY
of the coefficient matrix can be found symbolically with the forward elimination steps of naïve
Gauss elimination to give
⎡1 x1 x12 ⎤
⎢ ⎥
det ⎢1 x2 x22 ⎥ = x2 x32 − x22 x3 − x1 x32 + x12 x3 + x1 x22 − x12 x2
⎢1 x3 x32 ⎥
⎣ ⎦
= ( x1 − x2 )( x2 − x3 )( x3 − x1 )
Since
x1 ≠ x 2 ≠ x3
the determinant is non-zero. Hence, the coefficient matrix is invertible. Therefore,
a1 = a 2 = a3 = 0 is the only solution, that is, R2 ( x ) ≡ 0.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. The following x - y data is given.


x 15 18 22
y 24 37 25
The Newton’s divided difference second order polynomial for the above data is given by
f 2 ( x) = b0 + b1 ( x − 15) + b2 ( x − 15)( x − 18)
The value of b1 is most nearly
(A) –1.0480
(B) 0.14333
(C) 4.3333
(D) 24.000

Solution
The correct answer is (C).

NKAY
Given
x0 = 15
x1 = 18
f 2 ( x0 ) = 24
f 2 ( x1 ) = 37
we have
f 2 ( x ) = b0 + b1 ( x − x0 ) + b2 ( x − x0 )( x − x1 )
Then
f 2 ( x0 ) = b0 + b1 ( x0 − x0 ) + b2 ( x0 − x0 )( x0 − x1 )
= b0
f 2 ( x1 ) = b0 + b1 (x1 − x0 ) + b2 ( x1 − x0 )( x1 − x1 )
= b0 + b1 ( x1 − x0 )
= f 2 ( x0 ) + b1 ( x1 − x0 )
Thus,
f 2 ( x1 ) − f 2 ( x0 )
b1 =
x1 − x0
37 − 24
=
18 − 15
= 4.3333

NKAY NKAY
NKAY STUDY NANA KWABENA

3. The polynomial that passes through the following x - y data

x 18 22 24
y ? 25 123

is given by
8.125 x 2 − 324.75 x + 3237, 18 ≤ x ≤ 24
The corresponding polynomial using Newton’s divided difference polynomial is given by

f 2 ( x) = b0 + b1 ( x − 18) + b2 (x − 18)( x − 22 )

NKAY
The value of b2 is

(A) 0.25000
(B) 8.1250
(C) 24.000
(D) not obtainable with the information given

Solution
The correct answer is (B).

Expanding,
f 2 ( x) = b0 + b1 ( x − 18) + b2 ( x − 18)( x − 22 )
(
= b0 + b1 x − 18b1 + b2 x 2 − 40 x + 396 )
= (b0 − 18b1 + 396b2 ) + (b1 − 40b2 )x + b2 x 2
This needs to be the same as
8.125 x 2 − 324.75 x + 3237
Hence
b2 = 8.125

NKAY NKAY
NKAY STUDY NANA KWABENA

4. Velocity vs. time data for a body is approximated by a second order Newton’s divided
difference polynomial as

v(t ) = b0 + 39.622(t − 20 ) + 0.5540(t − 20 )(t − 15), 10 ≤ t ≤ 20

The acceleration in m/s2 at t = 15 is


(A) 0.55400

NKAY
(B) 39.622
(C) 36.852
(D) not obtainable with the given information

Solution
The correct answer is (C).

v(t ) = b0 + 39.622(t − 20 ) + 0.5540(t − 20 )(t − 15), 10 ≤ t ≤ 20

d
a(t ) = (v(t ))
dt
= 39.622(1) + 0.5540(t − 20) + 0.5540(t − 15)
= 39.622 + 0.5540(t − 20) + 0.5540(t − 15), 10 ≤ t ≤ 20
a(15) = 39.622 + 0.5540(15 − 20) + 0.5540(15 − 15)
= 39.622 − 2.7700
= 36.852 m/s 2

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The path that a robot is following on a x-y plane is found by interpolating four data points as

x 2 4.5 5.5 7
y 7.5 7.5 6 5
y ( x ) = 0.15238 x − 2.2571x + 9.6048 x − 3.9000
3 2

The length of the path from x = 2 to x = 7 is


(A) (7.5 − 7.5)2 + (4.5 − 2)2 + (6 − 7.5)2 + (5.5 − 4.5)2 + (5 − 6)2 + (7 − 5.5)2
7
(B) ∫
2
1 + (0.15238 x 3 − 2.2571x 2 + 9.6048 x − 3.9000) 2 dx
7
(C) ∫
2
1 + (0.45714 x 2 − 4.5142 x + 9.6048) 2 dx
7
(D) ∫ (0.15238 x 3 − 2.2571x 2 + 9.6048 x − 3.9000)dx
2

NKAY
Solution
The correct answer is (C).

The length S of the curve y ( x ) from a to b is given by


b 2
⎛ dy ⎞
S=∫ 1 + ⎜ ⎟ dx
a ⎝ dx ⎠
where
a=2
b=7
giving
7 2
⎛ dy ⎞
S = ∫ 1 + ⎜ ⎟ dx
2 ⎝ dx ⎠
y ( x ) = 0.15238 x 3 − 2.2571x 2 + 9.6048 x − 3.9000
dy
= 0.45714 x 2 − 4.5142 x + 9.6048
dx
Thus,
7
(
S = ∫ 1 + 0.45714 x 2 − 4.5142 x + 9.6048 dx )2

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The following data of the velocity of a body is given as a function of time.


Time (s) 0 15 18 22 24
Velocity (m/s) 22 24 37 25 123
If you were going to use quadratic interpolation to find the value of the velocity at t = 14.9
seconds, the three data points of time you would choose for interpolation are
(A) 0, 15, 18
(B) 15, 18, 22
(C) 0, 15, 22

NKAY
(D) 0, 18, 24

Solution
The correct answer is (A).

We need to choose the three points closest to t = 14.9 s that also bracket t = 14.9 s . Although the
data points in choice (B) are closest to 14.9, they do not bracket it. This would be performing
extrapolation, not interpolation. Choices (C) and (D) both bracket t = 14.9 s but they are not the
closest three data points.
Time (s) Velocity (m/s) How far is t = 14.9 s
0 22 14.9 − 0 = 14.9
15 24 14.9 − 15 = 0.1
18 37 14.9 − 18 = 3.1
22 25 14.9 − 22 = 7.1
24 123 14.9 − 24 = 9.1

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Spline Method

NKAY
Interpolation
COMPLETE SOLUTION SET

1. The following n data points, (x1 , y1 ) , (x 2 , y 2 ) , …….. ( xn , y n ) , are given. For conducting
quadratic spline interpolation the x-data needs to be
(A) equally spaced
(B) placed in ascending or descending order of x -values
(C) integers
(D) positive

Solution
The correct answer is (B).

The following n data points, (x1 , y1 ) , ( x 2 , y 2 ) , …….. ( x n , y n ) , are given. For conducting
quadratic spline interpolation the x-data needs to be arranged in ascending or descending order.

NKAY NKAY
NKAY STUDY NANA KWABENA

2. In cubic spline interpolation,


(A) the first derivatives of the splines are continuous at the interior data
points

NKAY
(B) the second derivatives of the splines are continuous at the interior data
points
(C) the first and the second derivatives of the splines are continuous at the
interior data points
(D) the third derivatives of the splines are continuous at the interior data
points

Solution
The correct answer is (C).

In cubic spline interpolation, the first and the second derivatives of the splines are continuous at
the interior data points. In quadratic spline interpolation, only the first derivatives of the splines
are continuous at the interior data points.

NKAY NKAY
NKAY STUDY NANA KWABENA

3. The following incomplete y vs. x data is given.

x
1 2 4 6 7
y
5 11 ???? ???? 32
The data is fit by quadratic spline interpolants given by
f ( x ) = ax − 1 , 1 ≤ x ≤ 2
f ( x ) = −2 x 2 + 14 x − 9, 2 ≤ x ≤ 4
f ( x ) = bx 2 + cx + d , 4 ≤ x ≤ 6
f (x ) = 25 x 2 − 303x + 928, 6 ≤ x ≤ 7
where a, b, c, and d are constants. The value of c is most nearly
(A) − 303.00
(B) − 144.50
(C) 0.0000
(D) 14.000

NKAY
Solution
The correct answer is (C).

Since the first derivatives of two quadratic splines are continuous at the interior points, at x = 4
d
dx
(bx 2 + cx − d ) =
d
dx
(
− 2 x 2 + 14 x − 9 )
x=4 x=4

2bx + c x = 4 = − 4 x + 14 x = 4
2(4)b + c = −4(4) + 14
8b + c = −2 (1)

and at x = 6
d
dx
(bx 2 + cx − d ) = (25 x 2 − 303 x + 928)
d
dx
x =6 x =6

2bx + c x =6 = 50 x − 303 x =6
2(6)b + c = 50(6) − 303
12b + c = −3 (2)

Equations (1) and (2) in matrix form


⎡ 8 1⎤ ⎡b⎤ ⎡− 2⎤
⎢12 1⎥ ⎢c ⎥ = ⎢ − 3⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
Solving these equations gives
b = −0.25
c=0

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The following incomplete y vs. x data is given.

x 1 2 4 6 7
y 5 11 ???? ???? 32
The data is fit by quadratic spline interpolants given by
f ( x ) = ax − 1, 1 ≤ x ≤ 2 ,
f ( x ) = −2 x 2 + 14 x − 9, 2 ≤ x ≤ 4
f ( x ) = bx 2 + cx + d , 4 ≤ x ≤ 6
f ( x ) = ex 2 + fx + g , 6 ≤ x ≤ 7

NKAY
df
where a, b, c, d , e, f , and g are constants. The value of at x = 2.6 most nearly is
dx
(A) − 144.50
(B) − 4.0000
(C) 3.6000
(D) 12.200

Solution
The correct answer is (C).

Since the spline


f ( x ) = −2 x 2 + 14 x − 9
is valid in the interval 2 ≤ x ≤ 4 , the derivative at x = 2.6 is
df
(x ) = −4 x + 14
dx
df
(2.6) = −4 × 2.6 + 14
dx
= −10.4 + 14
= 3.6000

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The following incomplete y vs. x data is given.

1 2 4 x 6 7
y
5 11 ???? ???? 32
The data is fit by quadratic spline interpolants given by
f ( x ) = ax − 1, 1 ≤ x ≤ 2 ,
f ( x ) = −2 x 2 + 14 x − 9, 2 ≤ x ≤ 4
f ( x ) = bx 2 + cx + d , 4 ≤ x ≤ 6
f (x ) = 25 x 2 − 303x + 928, 6 ≤ x ≤ 7
3.5
Where a, b, c, and d are constants. What is the value of ∫ f (x )dx ?
1.5

(A) 23.500
(B) 25.667
(C) 25.750
(D) 28.000

NKAY
Solution
The correct answer is (C).

3.5 2 3.5

∫ f ( x )dx we must take ∫ (ax − 1)dx + ∫ (− 2 x + 14 x − 9)dx


2
To find but first we have to find the
1.5 1.5 2

value of the constant a. Since at x = 2, y = 11


a × 2 − 1 = 11
11 + 1
a=
2
=6
Thus,
3.5 2 3.5

∫ f ( x )dx = ∫ (6 x − 1)dx + ∫ (− 2 x )
+ 14 x − 9 dx
2

1.5 1.5 2
2 3.5
⎡6 ⎤ ⎡ 2 14 ⎤
= ⎢ x 2 − x ⎥ + ⎢− x 3 + x 2 − 9 x ⎥
⎣2 ⎦1.5 ⎣ 3 2 ⎦2
[( ) (
= 3 × 2 2 − 2 − 3 × 1.52 − 1.5 + )]
⎡⎛ 2 ⎞ ⎛ 2 3 ⎞⎤
⎢⎜ − 3 × 3.5 + 7 × 3.5 − 9 × 3.5 ⎟ − ⎜ − 3 × 2 + 7 × 2 − 9 × 2 ⎟⎥
3 2 2

⎣⎝ ⎠ ⎝ ⎠⎦
= [(12 − 2 ) − (6.75 − 1.5)] +
[(− 28.583 + 85.75 − 31.5) − (− 5.3333 + 28 − 18)]
= [4.75] + [21]
= 25.75

NKAY NKAY
NKAY STUDY NANA KWABENA

6. A robot needs to follow a path that passes consecutively through six points as shown
in the figure. To find the shortest path that is also smooth you would recommend
which of the following?
(A) Pass a fifth order polynomial through the data
(B) Pass linear splines through the data
(C) Pass quadratic splines through the data
(D) Regress the data to a second order polynomial
Path of a Robot

NKAY
8
7
6
5
4
y

3
2
1
0
0 5 10 15
x

Solution
The correct answer is (C).

Using linear splines (Choice B) would create a straight-line path between consecutive points.
Although this will be the shortest path it will not be smooth. Regressing the data to a second
order polynomial (Choice D) will result in a smooth path but it will not pass through all the
points. As demonstrated in the following figure, using polynomial interpolation such as choice
(A) is a bad idea and will result in a long path. By using quadratic spline interpolation (choice
C), the path will be short as well as smooth.

NKAY NKAY
NKAY STUDY NANA KWABENA

10

NKAY
6
y

0
0 2 4 6 8 10 12
x

Cubic Spline Fifth Order Polynomial

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Background
Integration
COMPLETE SOLUTION SET
b
1. Physically, integrating ∫ f ( x)dx
a
means finding the

(A) area under the curve from a to b


(B) area to the left of point a

NKAY
(C) area to the right of point b
(D) area above the curve from a to b
Solution
The correct answer is (A).

b
Integrating ∫ f ( x)dx means finding the area under the curve of the function f ( x ) from a to b.
a

NKAY NKAY
NKAY STUDY NANA KWABENA

2. The mean value of a function f (x) from a to b is given by


f (a ) + f (b)
(A)
2
⎛a + b⎞
f (a ) + 2 f ⎜ ⎟ + f ( b)
⎝ 2 ⎠
(B)
4

NKAY
b
(C) ∫ f ( x)dx
a
b

∫ f ( x)dx
(D) a
b−a
Solution
The correct answer is (D).
The mean value of a function f ( x) from a to b is given by
Area under the curve from a to b
f =
Width of the interval from a to b
b

∫ f ( x)dx
= a
b−a

NKAY NKAY
NKAY STUDY NANA KWABENA

2.2

∫ xe
x
3. The exact value of dx is most nearly
0.2

(A) 7.8036
(B) 11.807
(C) 14.034
(D) 19.611

Solution
The correct answer is (B).

NKAY
To solve this integral we must integrate by parts.
∫ u dv = uv − ∫ v du
where
u=x
du = dx
and
dv = e x dx
v = ex
2.2 2.2

∫ xe dx = ∫ xd (e )
x x

0.2 0.2

[ ]
2.2
x 2.2
= xe 0.2 − ∫ e x dx
0.2

[
= xe − e ]x x 2.2
0.2

= (2.2e − e ) − (0.2e
2.2 2.2 0.2
− e 0.2 )
= 10.83 − (− 0.9771)
= 11.807

NKAY NKAY
NKAY STUDY NANA KWABENA

2
4. ∫ f ( x)dx for
0.2

f ( x ) = x, 0 ≤ x ≤ 1.2
= x , 1.2 < x ≤ 2.4
2

is most nearly
(A) 1.9800

NKAY
(B) 2.6640
(C) 2.7907
(D) 4.7520
Solution
The correct answer is (C).

2 1.2 2

∫ f ( x)dx = ∫ x dx + ∫ x dx
2

0.2 0.2 1.2


1.2 2
⎡1 ⎤ ⎡1 ⎤
= ⎢ x 2 ⎥ + ⎢ x3 ⎥
⎣ 2 ⎦ 0.2 ⎣ 3 ⎦1.2
⎛ 1.2 2 0.2 2 ⎞ ⎛ 23 1.23 ⎞
= ⎜⎜ − ⎟+⎜ − ⎟
⎝ 2 2 ⎟⎠ ⎜⎝ 3 3 ⎟⎠
= 0.7 + 2.0907
= 2.7907

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The area of a circle of radius a can be found by the following integral


a

∫ (a )
− x 2 dx
2
(A)
0

(B) ∫
0
a 2 − x 2 dx

a
(C) 4 ∫ a 2 − x 2 dx
0
a
(D) ∫
0
a 2 − x 2 dx

Solution
The correct answer is (C).

The equation for a circle of radius a is

NKAY
y2 + x2 = a2
y = a2 − x2

y
(0, a)

0 (a, 0)
x

To find the area of the shaded quarter circle shown, we can find the area under the curve of the
integral of y = a 2 − x 2 from 0 to a.
a
A = ∫ a 2 − x 2 dx
0

Thus, the area of the full circle is four times the quarter circle
a
A = 4∫ a 2 − x 2 dx
0

NKAY NKAY
NKAY STUDY NANA KWABENA

6. Velocity distribution of a fluid flow through a pipe varies along the radius and is
given by v(r ) . The flow rate through the pipe of radius a is given by
(A) πv(a )a 2
v(0) + v(a) 2
(B) π a
2
a
(C) ∫ v(r )dr
0
a
(D) 2π ∫ v(r )rdr
0

Solution
The correct answer is (D).

NKAY
a

r + dr

The differential area is the area bound by the concentric circles and is given by
dA = π (r + dr ) − πr 2
2

= πr 2 + π (dr ) + 2πr dr − πr 2
2

= 2πr dr + π (dr )
2

Since
(dr )2 << dr
we have
dA ≈ 2πr dr

The flow rate dQ through the differential element of the pipe is

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
dQ = (velocity ) × (differential area )
= (v(r )) × (2πr dr )
a
Q = ∫ v(r )2πr dr
0
a
= 2π ∫ v(r )r dr
0

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Simpson’s 1/3 Rule
Integration
COMPLETE SOLUTION SET

1. The highest order of polynomial integrand for which Simpson’s 1/3 rule of integration is

NKAY
exact is
(A) first
(B) second
(C) third
(D) fourth

Solution
The correct answer is (C).

Simpson’s 1/3 rule of integration is exact for integrating polynomials of third order or less.
Although Simpson’s 1/3 rule is derived by approximating the integrand by a second order
polynomial, the area under the curve is exact for a third order polynomial. Without proof it can
(b − a ) 5 ( 4)
be shown that the truncation error in Simpson’s 1/3 rule is E t = − f (ζ ), a < ζ < b .
2880
Since the fourth derivative of a third order polynomial is zero, the truncation error would be zero.
Hence Simpson’s 1/3 rule is exact for integrating polynomials of third order or less.

NKAY NKAY
NKAY STUDY NANA KWABENA

2.2

∫e
x
2. The value of dx by using 2-segment Simpson’s 1/3 rule most nearly is
0.2

(A) 7.8036
(B) 7.8423
(C) 8.4433
(D) 10.246

Solution
The correct answer is (B).

NKAY
The multiple segment equation for Simpson’s 1/3 rule is
b ⎡ ⎤
b−a⎢ n −1 n−2

∫a f ( x)dx ≈ 3n ⎢ f ( x0 ) + 4 ∑ f ( xi ) + 2 ∑ f ( x i ) + f ( x n ) ⎥
i =1 i =2

⎣⎢ i = odd i = even ⎦⎥
Using two-segments gives

a = 0.2
b = 2.2
n=2
b−a
h=
n
2.2 − 0.2
=
2
=1
x0 = 0.2
x1 = x0 + h
= 0.2 + 1
= 1.2
x2 = 1.2 + 1
= 2.2

NKAY NKAY
NKAY STUDY NANA KWABENA

2.2 ⎡ ⎤
2.2 − 0.2 ⎢ 2 −1 2−2

∫0.2e dx ≈ 3 × 2 ⎢ f (0.2) + 4 ∑
x
f ( xi ) + 2 ∑ f ( xi ) + f (2.2)⎥

NKAY
i =1 i =2

⎢⎣ i =odd i =even ⎥⎦
⎡ ⎤
2.2 − 0.2 ⎢ 1 0
= f (0.2) + 4 ∑ f ( xi ) + 2 ∑ f ( xi ) + f (2.2)⎥
3× 2 ⎢ i =1 i =2

⎣⎢ i =odd i =even ⎦⎥
2.2 − 0.2
= [ f (0.2) + 4 f (1.2) + f (2.2)]
3× 2
[
= 0.33333 e 0.2 + 4 × e1.2 + e 2.2 ]
= 0.33333[23.527]
= 7.8423

NKAY NKAY
NKAY STUDY NANA KWABENA

2.2

∫e
x
3. The value of dx by using 4-segment Simpson’s 1/3 rule most nearly is
0.2

(A) 7.8036
(B) 7.8062
(C) 7.8423
(D) 7.9655

Solution
The correct answer is (B).

The multiple segment equation for Simpson’s 1/3 rule is


b ⎡ ⎤
b−a ⎢

NKAY
n −1 n−2

∫a f ( x)dx ≈ 3n ⎢ f ( x0 ) + 4 ∑ f ( xi ) + 2 ∑ f ( xi ) + f ( xn )⎥
i =1 i =2

⎢⎣ i =odd i =even ⎥⎦

Using 4 segments gives


a = 0.2
b = 2.2
n=4
b−a
h=
n
2.2 − 0.2
=
4
= 0.5
2.2 ⎡ ⎤
2.2 − 0.2 ⎢ 4−1 4−2

∫0.2e dx ≈ 3 × 4 ⎢ f ( x0 ) + 4 ∑
x
f ( xi ) + 2 ∑ f ( xi ) + f ( x4 )⎥
i =1 i =2

⎢⎣ i =odd i =even ⎥⎦
⎡ ⎤
2.2 − 0.2 ⎢ 3 2
= f ( x0 ) + 4 ∑ f ( xi ) + 2 ∑ f ( xi ) + f ( x4 )⎥
3× 4 ⎢ i =1 i =2

⎣⎢ i =odd i =even ⎦⎥
2.2 − 0.2
= [ f ( x0 ) + 4( f (x1 ) + f (x3 )) + 2( f (x2 )) + f ( x4 )]
3× 4
So

NKAY NKAY
NKAY STUDY NANA KWABENA

f (x ) = e x
f ( x0 ) = f (0.2) = e 0.2 = 1.2214

f ( x1 ) = f (0.2 + 0.5) = f (0.7 )


f (0.7 ) = e 0.7 = 2.0138

NKAY
f ( x2 ) = f (0.7 + 0.5) = f (1.2)
f (1.2) = e1.2 = 3.3201

f ( x3 ) = f (1.2 + 0.5) = f (1.7 )


f (1.7 ) = e1.7 = 5.4739

f ( x4 ) = f (2.2) = e 2.2 = 9.0250

2.2
2.2 − 0.2
∫ e dx ≈
x
[ f ( x0 ) + 4( f (x1 ) + f (x3 )) + 2( f (x2 )) + f ( x4 )]
0.2
3× 4
2.2 − 0.2
= [1.2214 + 4(2.0138 + 5.4739) + 2(3.3201) + 9.0250]
3× 4
= 0.16667[1.2214 + 29.951 + 6.6402 + 9.0250]
= 7.8062

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The velocity of a body is given by


v(t ) = 2t , 1≤ t ≤ 5
= 5t 2 + 3, 5 < t ≤ 14
where t is given in seconds, and v is given in m/s. Using two-segment Simpson’s
1/3 rule, the distance in meters covered by the body from t = 2 to t = 9 seconds most
nearly is
(A) 949.33
(B) 1039.7
(C) 1200.5
(D) 1442.0

Solution
The correct answer is (C).

NKAY
The multiple segment equation for Simpson’s 1/3 rule is
b ⎡ ⎤
b−a ⎢ n −1 n−2

∫a f ( x)dx ≈ 3n ⎢ f ( x0 ) + 4 ∑ f ( xi ) + 2 ∑ f ( xi ) + f ( xn )⎥
i =1 i =2

⎢⎣ i =odd i =even ⎥⎦

a=2
b=9
n=2
b−a
h=
n
9−2
=
2
= 3.5
9 ⎡ ⎤
9−2⎢ 2−1 2− 2

∫2 v(t )dt ≈ 3 × 2 ⎢v(t0 ) + 4 ∑ v(ti ) + 2 ∑ v(ti ) + v(t 2 )⎥


i =1 i =2

⎢⎣ i =odd i =even ⎥⎦
⎡ ⎤
9−2⎢ 1 0
= v(t0 ) + 4 ∑ v(ti ) + 2 ∑ v(ti ) + v(t 2 )⎥
3× 2 ⎢ i =1 i =2

⎣⎢ i =odd i =even ⎦⎥
9−2
= [v(t0 ) + 4(v(t1 )) + v(t2 )]
3× 2

NKAY NKAY
NKAY STUDY NANA KWABENA

So
v(t ) = 2t , 1≤ t ≤ 5
= 5t 2 + 3, 5 < t ≤ 14

v(t0 ) = v(2) = 2 × 2 = 4 m/s

NKAY
v(t1 ) = v(2 + 3.5) = v(5.5)
v(5.5) = 5 × 5.52 + 3 = 154.25 m/s

v(t 2 ) = v(9) = 5 × 9 2 + 3 = 408 m/s

9
9−2
∫ v(t )dt ≈ 3 × 2 [v(t ) + 4 × v(t ) + v(t )]
2
0 1 2

9−2
= [v(2) + 4 × v(5.5) + v(9)]
3× 2
= 1.1667[4 + 4 × 154.25 + 408]
= 1200.5 m

NKAY NKAY
NKAY STUDY NANA KWABENA

19
5. The value of ∫ f ( x)dx by using 2-segment Simpson’s 1/3 rule is estimated as
3

702.039. The estimate of the same integral using 4-segment Simpson’s 1/3 rule most
nearly is
8
(A) 702.039 + [2 f (7 ) − f (11) + 2 f (15)]
3
702.039 8
(B) + [2 f (7 ) − f (11) + 2 f (15)]
2 3
8
(C) 702.039 + [2 f (7 ) + 2 f (15)]
3
702.039 8
(D) + [2 f (7 )2 f (15)]
2 3
Solution
The correct answer is (B).

NKAY
Using 2-segment Simpson’s 1/3 rule gives
19 ⎡ ⎤
19 − 3 ⎢ 2−1 2− 2

∫3 f ( x)dx ≈ 3 × 2 ⎢ f ( x0 ) + 4 ∑ f ( xi ) + 2 ∑ f ( xi ) + f ( x2 )⎥
i =1 i =2

⎣⎢ i =odd i =even ⎦⎥
⎡ ⎤
19 − 3 ⎢ 1
= f ( x0 ) + 4 ∑ f ( xi ) + f ( x2 )⎥
3× 2 ⎢ i =1

⎢⎣ i =odd ⎥⎦
19 − 3
= [ f ( x0 ) + 4 f (x1 ) + f ( x2 )]
3× 2
19 − 3
702.039 ≈ [ f (3) + 4 f (11) + f (19)]
3× 2
Using 4-segment Simpson’s 1/3 rule gives
19 ⎡ ⎤
19 − 3 ⎢ 4−1 4− 2

∫3 f ( x)dx ≈ 3 × 4 ⎢ f ( x0 ) + 4 ∑ f ( xi ) + 2 ∑ f ( xi ) + f ( x4 )⎥
i =1 i =2

⎣⎢ i =odd i =even ⎦⎥
⎡ ⎤
19 − 3 ⎢ 3 2
= f ( x0 ) + 4 ∑ f ( xi ) + 2 ∑ f ( xi ) + f ( x4 )⎥
3× 4 ⎢ i =1 i =2

⎢⎣ i =odd i =even ⎥⎦
19 − 3
= [ f ( x0 ) + 4( f (x1 ) + f (x3 )) + 2( f (x2 )) + f ( x4 )]
3× 4
19 − 3
= [ f (3) + 4( f (7 ) + f (15)) + 2( f (11)) + f (19)]
3× 4

NKAY NKAY
NKAY STUDY NANA KWABENA

19 − 3

NKAY
= [ f (3) + 4 f (7 ) + 4 f (11) + 4 f (15) − 2 f (11) + f (19)]
3× 4
19 − 3
= [ f (3) + 4 f (11) + f (19)] + 19 − 3 [4 f (7 ) + 4 f (15) − 2 f (11)]
3× 4 3× 4
702.039 19 − 3
= + [4 f (7 ) + 4 f (15) − 2 f (11)]
2 3× 4
702.039 2(19 − 3)
= + [2 f (7 ) + 2 f (15) − f (11)]
2 3× 4
702.039 8
= + [2 f (7 ) + 2 f (15) − f (11)]
2 3

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The following data of the velocity of a body is given as a function of time.


Time (s) 4 7 10 15
Velocity (m/s) 22 24 37 46
The best estimate of the distance in meters covered by the body from t = 4 to t = 15
using combined Simpson’s 1/3 rule and the trapezoidal rule would be
(A) 354.70
(B) 362.50
(C) 368.00
(D) 378.80

Solution
The correct answer is (B).

t0 = 4, t1 = 7, t2 = 10, t3 = 15

NKAY
We can use Simpson’s 1/3 rule from t = 4 to t = 10 as we have three equidistant points,
t = 4,7,10.
b ⎡ ⎤
b−a ⎢ n −1 n−2

∫a v(t )dt ≈ 3n ⎢v(t0 ) + 4 ∑ v(ti ) + 2 ∑ v(ti ) + v(t n )⎥


i =1 i =2

⎣⎢ i =odd i =even ⎦⎥
where
a = t0
b = t2
h = t 2 − t1
= t1 − t0
=3
b−a
h=
n
10 − 4
3=
n
n=2
Thus, using 2-segment Simpson’s 1/3 rule
t2
t −t
∫t v(t )dt ≈ 32 × 20 [v(t0 ) + 4v(t1 ) + v(t2 )]
0

Using the trapezoidal rule with unequal segments from t = 10 to t = 15


⎡ v(t ) + v(t )⎤
t3

∫t v(t )dt ≈ (t3 − t2 )⎢⎣ 2 2 3 ⎥⎦


2

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
Thus,
t3

∫ v(t )dt ≈
t 2 − t0
[v(t0 ) + 4v(t1 ) + v(t2 )] + (t3 − t2 ) ⎡⎢ v(t2 ) + v(t3 ) ⎤⎥
t0
3× 2 ⎣ 2 ⎦
14

∫ v(t )dt ≈
10 − 4
[v(4) + 4v(7 ) + v(10)] + (15 − 10) ⎡⎢ v(10) + v(15) ⎤⎥
4
3× 2 ⎣ 2 ⎦

=
10 − 4
[22 + 4 × 24 + 37] + (15 − 10) ⎡⎢ 37 + 46 ⎤⎥
3× 2 ⎣ 2 ⎦
= (6)[25.833] + (5)[41.5]
= 362.5 m

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Trapezoidal Rule
Integration
COMPLETE SOLUTION SET

1. The two-segment trapezoidal rule of integration is exact for integrating at most


________ order polynomials.
(A) first

NKAY
(B) second
(C) third
(D) fourth
Solution
The correct answer is (A).

The single segment trapezoidal rule is exact for at most a first order polynomial. The two
segment trapezoidal rule is also exact only for the same order of polynomial, that is, a first order
polynomial.

NKAY NKAY
NKAY STUDY NANA KWABENA

2.2

∫ xe
x
2. The value of dx by the using one-segment trapezoidal rule is most nearly
0.2

(A) 11.672
(B) 11.807
(C) 20.099
(D) 24.119
Solution
The correct answer is (C).

NKAY
b
⎡ f (a ) + f (b) ⎤
∫ f (x )dx ≈ (b − a)⎢⎣
a
2 ⎥⎦
where
a = 0 .2
b = 0 .2
f ( x ) = xe x
f (0.2) = 0.2e 0.2
= 0.24428
f (2.2 ) = 2.2e 2.2
= 19.855
2.2
⎡ 0.24428 + 19.855 ⎤
∫ xe dx ≈ (2.2 − 0.2)⎢⎣
x

2 ⎥⎦
0.2

= 2 × 10.050
= 20.099

NKAY NKAY
NKAY STUDY NANA KWABENA

2.2

∫ xe dx by using the three-segment trapezoidal rule is most nearly


x
3. The value of
0.2

(A) 11.672
(B) 11.807
(C) 12.811
(D) 14.633
Solution
The correct answer is (C).

b
b−a ⎡ ⎧ n−1 ⎫ ⎤
∫ f ( x )dx ≈ f ( a ) + 2 ⎨∑ f (a + ih)⎬ + f (b)⎥

NKAY

a
2n ⎣ ⎩ i=1 ⎭ ⎦
where
a = 0.2
b = 2.2
n=3
b−a
h=
n
2.2 − 0.2
=
3
= 0.66667
f ( x) = xe x
Thus
b
2.2 − 0.2 ⎡ ⎧ 3−1 ⎫ ⎤
∫ f ( x )dx ≈ ⎢ f ( 0.2) + 2 ⎨∑ f (0.2 + i × 0.66667)⎬ + f (2.2)⎥
a
2×3 ⎣ ⎩ i=1 ⎭ ⎦
2⎡ ⎧2 ⎫ ⎤
= ⎢ f ( 0.2) + 2 ⎨∑ f (0.2 + i × 0.66667)⎬ + f (2.2)⎥
6⎣ ⎩ i=1 ⎭ ⎦
1
= [ f (0.2) + 2 f (0.86667) + 2 f (1.5333) + f (2.2)]
3
where

NKAY NKAY
NKAY STUDY NANA KWABENA

f (0.2) = 0.2e 0.2


= 0.24428
f (0.86667 ) = 0.86667e0.86667

NKAY
= 2.0618
f (1.5333) = 1.5333e1.5333
= 7.1048
f (2.2) = 2.2e 2.2
= 19.855
Hence
2.2

∫ xe dx ≈ 0.33333[0.24428 + 2 × 2.0618 + 2 × 7.1048 + 19.855]


x

0.2

= 0.33333[38.433]
= 12.811

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The velocity of a body is given by


v(t ) = 2t , 1≤ t ≤ 5
= 5t + 3, 5 < t ≤ 14
2

where t is given in seconds, and v is given in m/s. Use the two-segment trapezoidal
rule to find the distance covered by the body from t = 2 to t = 9 seconds.
(A) 935.0 m
(B) 1039.7 m
(C) 1260.9 m
(D) 5048.9 m
Solution
The correct answer is (C).

b
b−a ⎡ ⎧ n −1 ⎫ ⎤
∫ v(t )dt ≈ ⎢
2n ⎣
v ( a ) + 2 ⎨∑ v(a + ih)⎬ + v(b)⎥

NKAY
a ⎩ i =1 ⎭ ⎦
where
a=2
b=9
n=2
b−a
h=
n
9−2
=
2
= 3.5
v(t ) = 2t , 1≤ t ≤ 5
= 5t 2 + 3, 5 < t ≤ 14
Thus
9−2 ⎡ ⎤
9
⎧ 2−1 ⎫
∫ v(t )dt ≈
2

2× 2 ⎣
v ( 2 ) + 2 ⎨∑ v(2 + i × 3.5)⎬ + v(9)⎥
⎩ i=1 ⎭ ⎦
7
= [v(2) + 2v(5.5) + v(9)]
4
v(2 ) = 2 × 2
= 4 m/s
v(5.5) = 5 × 5.52 + 3
= 154.25 m/s
v(9 ) = 5 × 9 2 + 3
= 408 m/s

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
9

∫ v(t )dt ≈ 1.75[4 + 2 ×154.25 + 408]


2

= 1.75[720.5]
= 1260.9 m

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The shaded area shows a plot of land available for sale. Your best estimate of the
area of the land is most nearly
(A) 2500 m2
(B) 4775 m2
(C) 5250 m2
(D) 6000 m2

60

45

NKAY
25

60 75 100

Solution
The correct answer is (B).

60

45
A C
25 B

60 75 100

NKAY NKAY
NKAY STUDY NANA KWABENA

A = 60 × 60

NKAY
= 3600 m 2
B = 45 × 15
= 675 m 2
C = 20 × 25
= 500 m 2
Area ≈ A + B + C
= 3600 + 675 + 500
= 4775 m 2

NKAY NKAY
NKAY STUDY NANA KWABENA

6. The following data of the velocity of a body is given as a function of time.


Time (s) 0 15 18 22 24
Velocity (m/s) 22 24 37 25 123
The distance in meters covered by the body from t = 12 s to t = 18 s calculated using
the trapezoidal rule with unequal segments is
(A) 162.90
(B) 166.00
(C) 181.70
(D) 436.50
Solution
The correct answer is (A).

Use the trapezoidal rule with unequal segments.


18 15 18

∫ v(t )dt = ∫ v(t )dt + ∫ v(t )dt

NKAY
12 12 15

v(15) = 24 m/s
v(18) = 37 m/s

To find the value of the velocity at 12 s, we will use linear interpolation.


v(t ) = a 0 + a1t , 0 ≤ t ≤ 15
At t = 0 s
22 = a0 + a1 0
At t = 15 s
24 = a 0 + a115
which gives
a0 = 22
a1 = 0.13333
Hence,
v(t ) = 22 + 0.13333t , 0 ≤ t ≤ 15
v(12) = 22 + 0.13333 × 12
= 23.600 m/s
⎡ v(12) + v(15) ⎤ ⎡ v(15) + v(18) ⎤
18

∫ v(t )dt ≈ (15 − 12)⎢⎣


12
2 ⎥⎦ + (18 − 15) ⎢⎣ 2 ⎥⎦

⎡ 23.6 + 24 ⎤ ⎡ 24 + 37 ⎤
= (15 − 12) ⎢ ⎥ + (18 − 15) ⎢
⎣ 2 ⎦ ⎣ 2 ⎥⎦
= 162.90 m

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Background
Ordinary Differential Equations
COMPLETE SOLUTION SET

dy
1. The differential equation 2 + x 2 y = 2 x + 3, y (0 ) = 5 is
dx

NKAY
(A) linear
(B) nonlinear
(C) linear with fixed constants
(D) undeterminable to be linear or nonlinear

Solution
The correct answer is (A).

A differential equation is linear if the coefficients of the dependent variable and all the
derivatives of the dependent variable in the ordinary differential equation are only functions of
the independent variable. The general form of a linear ordinary differential equation is
d n y (x ) d n −1 y ( x ) dy
a n (x ) n
+ a n −1 ( x ) n −1
+ ....... + a1 ( x ) + a 0 = f ( x )
dx dx dx
For example
dy
2 + x 2 y 2 = 2 x + 3, y (0 ) = 5
dx
is a nonlinear differential equation as the form is
2 + (x 2 y )y = 2 x + 3, y (0 ) = 5
dy
dx
( )
and in this case, the coefficient of the y term is x 2 y .

NKAY NKAY
NKAY STUDY NANA KWABENA

2. A differential equation is considered to be ordinary if it has


(A) one dependent variable
(B) more than one dependent variable

NKAY
(C) one independent variable
(D) more than one independent variable

Solution
The correct answer is (C).

A differential equation is considered to be ordinary if it has one independent variable. Ordinary


differential equations can have as many dependent variables as needed. For example the
ordinary differential equations
dy
2 + y + z = e x , y (0) = 6
dx
d 2z dz dz
3 2 + 3y + = sin x, z (0) = 5, (0) = 7
dx dx dx
have two dependent variables y and z, and one independent variable, x.

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Given
dy
2 + 3 y = sin 2 x, y (0 ) = 6
dx
y (2) most nearly is
(A) 0.17643
(B) 0.29872
(C) 0.32046
(D) 0.58024

Solution
The correct answer is (C).

The homogenous solution for the above ordinary differential equation is given by
(2D + 3) y = 0
The characteristic equation for the above equation is given by

NKAY
2r + 3 = 0
The solution to this equation is
r = −1.5
y H = Ce −1.5 x
The particular part of the solution is of the form
yP = A sin 2 x + B cos 2 x
To find A and B, we substitute the particular solution into the ordinary differential equation as
d
2 ( A sin 2 x + B cos 2 x ) + 3( A sin 2 x + B cos 2 x ) = sin 2 x
dx
2(2 A cos 2 x − 2 B sin 2 x ) + 3( A sin 2 x + B cos 2 x ) = sin 2 x
(4 A + 3B )cos 2 x + (− 4 B + 3 A)sin 2 x = sin 2 x
Equating coefficients of sin 2 x and cos 2 x on both sides we get
− 4B + 3 A = 1
3B + 4 A = 0
Solving the above two simultaneous linear equations we get
A = 0.12
B = −0.16
Hence
yP = 0.12 sin 2 x − 0.16 cos 2 x
The complete solution is
y = yH + yP
= Ce −1.5 x + 0.12 sin 2 x − 0.16 cos 2 x
Find the value of C by setting
y(0) = 6

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
6 = Ce −1.5×0 + 0.12 sin (2 × 0) − 0.16 cos(2 × 0)
6 = C − 0.16
C = 6.16

Thus
y = 6.16e −1.5 x + 0.12 sin 2 x − 0.16 cos 2 x
y (2 ) = 6.16e −1.5×2 + 0.12 sin (2 × 2 ) − 0.16 cos(2 × 2 )
= 0.32046

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The form of the exact solution to


dy
2 + 3 y = e − x , y (0 ) = 5
dx
is
(A) Ae−1.5 x + Be− x
(B) Ae−1.5 x + Bxe− x
(C) Ae1.5 x + Be − x
(D) Ae1.5 x + Bxe− x

NKAY
Solution
The correct answer is (A).

The homogeneous solution for the above ordinary differential equation is given by
(2D + 3) y = 0
The characteristic equation for the above equation is given by
2r + 3 = 0
The solution to this equation is
r = −1.5
giving the homogeneous part of the solution as
yH = Ae−1.5 x
Based on the forcing function of the ordinary differential equations, the particular part of the
solution is of the form Be − x , that is,
yP = Be − x
The exact solution is of the form
y = Ae −1.5 x + Be − x

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The following nonlinear differential equation can be solved exactly by separation of variables.

= −10 −6 (θ 2 − 81), θ (0 ) = 1000
dt
The value of θ (100) most nearly is
(A) −99.99
(B) 909.10
(C) 1000.32
(D) 1111.10

Solution
The correct answer is (B).


dt
(
= −10 −6 θ 2 − 81 )

∫ θ 2 − 81 = −∫10 dt
−6

NKAY
∫ (θ − 9)(θ + 9) = −∫10 dt
−6

1 A B
= +
(θ − 9)(θ + 9) θ − 9 θ + 9
1 = A(θ + 9) + B(θ − 9 )
1 = ( A + B )θ + (9 A − 9 B )
A+ B = 0
9 A − 9B = 1
1
A=
18
1
B=−
18
⎛ 1 ⎞⎛ 1 ⎞ ⎛ 1 ⎞⎛ 1 ⎞
∫ ⎜⎝ 18 ⎟⎠⎜⎝ θ − 9 ⎟⎠dθ − ∫ ⎜⎝ 18 ⎟⎠⎜⎝ θ + 9 ⎟⎠dθ = − ∫10 dt
−6

1 1
ln (θ − 9 ) − ln (θ + 9 ) = −10−6 t + c
18 18
1 ⎛θ −9 ⎞ −6
ln⎜ ⎟ = −10 t + c
18 ⎝ θ + 9 ⎠
To find the value of c, θ (0) = 1000
1 ⎛ 1000 − 9 ⎞ −6
ln⎜ ⎟ = −10 × 0 + c
18 ⎝ 1000 + 9 ⎠
c = −0.0010000

NKAY NKAY
NKAY STUDY NANA KWABENA

Substituting the value of c , we get


1 ⎛θ −9 ⎞ −6
ln⎜ ⎟ = −10 t − 0.0010000

NKAY
18 ⎝ θ + 9 ⎠
To find the value of θ at t = 100 ,
1 ⎛θ −9 ⎞
⎟ = −10 (100) − 0.0010000
−6
ln⎜
18 ⎝ θ + 9 ⎠
⎛θ −9 ⎞
ln⎜ ⎟ = −0.0198
⎝θ + 9 ⎠
⎛ θ −9 ⎞
ln ⎜ ⎟
⎝ θ +9 ⎠
e = e −0.0198
θ −9
= 0.98039
θ +9
θ = 909.10

NKAY NKAY
NKAY STUDY NANA KWABENA

6. A solid spherical ball taken out of a furnace at 1200 K is allowed to cool in air. Given the
following,
radius of the ball = 2 cm
kg
density of the ball = 7800 3
m
J
specific heat of the ball = 420
kg - K
emmittance = 0.85
J
Stefan-Boltzman constant = 5.67 × 10 −8
s - m2 - K 4
ambient temperature = 300 K
J
convection coefficient to air = 350
s - m2 - K
the differential equation governing the temperature θ of the ball as a function of time t is given
by

(A) = −2.2067 × 10 −12 (θ 4 − 81× 108 )
dt

NKAY

(B) = −1.6026 × 10 −2 (θ − 300 )
dt

(C) = 2.2067 × 10 −12 (θ 4 − 81× 108 ) + 1.6026 × 10 −12 (θ − 300 )
dt

(D) = −2.2067 × 10 −12 (θ 4 − 81× 108 ) − 1.6026 × 10 −2 (θ − 300 )
dt

Solution
The correct answer is (D).

(
The rate of heat loss due to radiation = A ∈ σ θ 4 − θ a
4
)
where
A = surface area of the ball, m 2
∈= emittance
J
σ = Stefan-Boltzman constant, 5.67 × 10 −8
s - m2 - K 4
θ = temperature of the ball at a given time, K
θ a = ambient temperature, K
The rate of heat loss due to convection = hA(θ − θ a )
where
J
h = convection coefficient to air, 350
s - m2 - K
The energy stored in the mass is given by
energy stored in the mass = mCθ
where
m = mass of the ball, kg

NKAY NKAY
NKAY STUDY NANA KWABENA

J
C = specific heat of the ball,
kg - K
The surface area of the ball
A = 4πr 2
= 4π (0.02 )
2

= 5.0265 ×10 −3 m 2
The mass of the ball
m = ρV

NKAY
⎡4 ⎤
= ρ ⎢ πr 3 ⎥
⎣3 ⎦
⎛4⎞
= 7800 × ⎜ ⎟π (0.02 )
3

⎝ 3⎠
= 0.261380 kg

From an energy balance,


Rate at which heat is gained – Rate at which heat is lost = Rate at which heat is stored
gives

( )
− A ∈ σ θ 4 − θ a4 − hA(θ − θ a ) = mC
dt
( ) ( )(
− 5.0265 × 10 (0.85) 5.67 × 10 θ − 300 4
−3 −8 4
)
(
− (350 ) − 5.0265 ×10 −3)(θ − 300) = (0.26138)(420) ddtθ

dt
( )
= −2.2067 × 10 −12 θ 4 − 81×108 − 1.6026 ×10 −2 (θ − 300 )

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Euler’s Method
Ordinary Differential Equations
COMPLETE SOLUTION SET
1. To solve the ordinary differential equation
dy
3 + 5 y 2 = sin x, y (0) = 5
dx
by Euler’s method, you need to rewrite the equation as
dy
(A) = sin x − 5 y 2 , y (0) = 5

NKAY
dx
(B)
dy 1
( )
= sin x − 5 y 2 , y (0) = 5
dx 3
dy 1 ⎛ 5 y3 ⎞
(C) = ⎜⎜ − cos x − ⎟, y (0 ) = 5
dx 3 ⎝ 3 ⎟⎠
dy 1
(D) = sin x, y (0) = 5
dx 3

Solution
The correct answer is (B).

To solve ordinary differential equations by Euler’s method, you need to rewrite the equation in
the following form
dy
= f ( x, y ), y (0) = y0
dx
Thus,
dy
3 + 5 y 2 = sin x, y (0) = 5
dx
dy
3 = sin x − 5 y 2 , y (0) = 5
dx
dy 1
( )
= sin x − 5 y 2 , y (0) = 5
dx 3

NKAY NKAY
NKAY STUDY NANA KWABENA

2. Given
dy
3 + 5 y 2 = sin x, y (0.3) = 5
dx
and using a step size of h = 0.3 , the value of y (0.9 ) using Euler’s method is most nearly
(A) − 35.318
(B) − 36.458
(C) − 658.91
(D) − 669.05

Solution
The correct answer is (A).

First rewrite the differential equation in the proper form.


dy 1
dx 3
(
= sin x − 5 y 2 )
1
(
f ( x, y ) = sin x − 5 y 2
3
)

NKAY
Euler’s method is given by
y i +1 = y i + f ( xi , y i )h
where
h = 0 .3
For i = 0 , x0 = 0.3 , y 0 = 5
y1 = y0 + f ( x0 , y0 )h
= 5 + f (0.3,5)× 0.3
1
(
= 5 + sin (0.3) − 5(5) × 0.3
3
2
)
= 5 + (− 12.470)
= −7.4704
y1 is the approximate value of y at
x = x1 = x0 + h = 0.3 + 0.3 = 0.6
For i = 1 , x1 = 0.6 , y1 = −7.4704
y2 = y1 + f (x1 , y1 )h
= −7.4704 + f (0.6,−7.4704)× 0.3
1
( )
= −7.4704 + sin (0.6) − 5(− 7.4704) × 0.3
3
2

= −7.4704 − 27.847
= −35.318
y2 is the approximate value of y at
x = x2 = x1 + h = 0.6 + 0.3 = 0.9
y (0.9) ≈ −35.318

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Given
dy
3 + y = e 0.1x , y (0.3) = 5
dx
dy
and using a step size of h = 0.3 , the best estimate of (0.9) using Euler’s method is most
dx
nearly
(A) − 0.37319
(B) − 0.36288
(C) − 0.35381
(D) − 0.34341

Solution
The correct answer is (B).

First rewrite the differential equation in the proper form.


dy 1 0.1x
dx 3
(
= e − y )

NKAY
1
(
f ( x, y ) = e0.1x − y
3
)
Euler’s method is given by
y i +1 = y i + f ( xi , y i )h
where
h = 0.3
For i = 0 , x0 = 0.3 , y 0 = 5
y1 = y0 + f (x0 , y0 )h
= 5 + f (0.3,5) × 0.3
1
(
= 5 + e 0.1×0.3 − 5 × 0.3
3
)
= 5 + (− 0.12056 )
= 4.8794
y1 is the approximate value of y at
x = x1 = x0 + h = 0.3 + 0.3 = 0.6
For i = 1 , x1 = 0.6 , y1 = 4.8794
y2 = y1 + f ( x1 , y1 )h
= 4.8794 + f (0.6,4.8794 )× 0.3
1
( )
= 4.8794 + e 0.1×0.6 − 4.8794 × 0.3
3
= 4.8794 + (− 0.11471)
y2 is the approximate value of y at
x = x2 = x1 + h = 0.6 + 0.3 = 0.9

NKAY NKAY
NKAY STUDY NANA KWABENA

y (0.9) ≈ 4.7647

NKAY
Thus
(
dy 1 0.1x
dx 3
= e − y )
dy
dx
(
(0.9) ≈ 1 e0.1×0.9 − 4.7647
3
)
= −0.36288

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The velocity (m/s) of a body is given as a function of time (seconds) by


v(t ) = 200 ln(1 + t ) − t , t ≥ 0
Using Euler’s method with a step size of 5 seconds, the distance traveled in meters by the body
from t = 2 to t = 12 seconds is most nearly
(A) 3133.1
(B) 3939.7
(C) 5638.0
(D) 39397

Solution
The correct answer is (A).

v(t ) = 200 ln (1 + t ) − t
dS
= 200 ln (1 + t ) − t
dt
f (t , S ) = 200 ln (1 + t ) − t

NKAY
Euler’s method is given by
Si +1 = Si + f (ti , Si )h
where
h = 0.5
For i = 0 , t0 = 2 s , S0 = 0 m (assuming S 0 = 0 m would make S 2 the value of the distance
covered, as the distance covered is S 2 − S 0 )
S1 = S 0 + f (t0 , S 0 )× h
= 0 + f (2,0)× 5
= 0 + (200 ln (1 + 2) − 2 )× 5
= 1088.6 m
t1 = t0 + h
= 2+5
=7
For i = 1 , t1 = 7 s , S1 = 1088.61 m
S 2 = S1 + f (t1 , S1 )× h
= 1088.6 + f (7,1088.6) × 5
= 1088.6 + (200 ln (1 + 7 ) − 7 )× 5
= 1088.6 + 2044.4
= 3133.1 m
S (12) − S (2) ≈ S 2 − S 0
= 3133.1 m

NKAY NKAY
NKAY STUDY NANA KWABENA

5. Euler’s method can be derived by using the first two terms of the Taylor series of writing the
value of yi +1 , that is the value of y at xi +1 , in terms of yi and all the derivatives of y at xi . If
h = x i +1 − x i , the explicit expression for yi +1 if the first three terms of the Taylor series are
chosen for the ordinary differential equation
dy
2 + 3 y = e −5 x , y (0) = 7
dx
would be
1
(
(A) yi +1 = yi + e − 5 xi − 3 yi h
2
)
1
( 1⎛5
) ⎞
(B) yi+1 = yi + e −5 xi − 3 yi h − ⎜ e −5 xi ⎟h 2
2 2⎝2 ⎠
1
( )
1 ⎛ 13 9 ⎞
(C) yi+1 = yi + e −5 xi − 3 yi h + ⎜ − e −5 xi + yi ⎟h 2
2 2⎝ 4 4 ⎠
1
2
( 3
)
(D) yi+1 = yi + e −5 xi − 3 yi h − yi h 2
2

NKAY
Solution
The correct answer is (C).

The differential equation


dy
2 + 3 y = e −5 x , y (0) = 7
dx
is rewritten as
dy 1 −5 x
dx 2
( )
= e − 3 y , y (0) = 7

1
(
f ( x, y ) = e −5 x − 3 y
2
)
The Taylor series is given by
2 3
y i +1 = y i +
dy
(xi +1 − xi ) + 1 d 2y (xi +1 − xi )2 + 1 d y
3
(xi +1 − xi )3 + ...
dx xi , yi 2! dx xi , y i
3! dx xi , yi

1 1
y i +1 = y i + f ( xi , yi )( xi +1 − xi ) +
f ' ( xi , yi )( xi +1 − xi ) + f ' ' ( xi , y i )( xi +1 − xi ) + ...
2 3

2! 3!
If we look at the first three terms of the Taylor series
1
yi+1 = yi + f ( xi , yi )( xi+1 − xi ) + f ' ( xi , yi )( xi+1 − xi )
2

2!
1
= yi + f ( xi , yi )h + f ' ( xi , yi )h 2
2!
where
h = xi+1 − xi

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
∂f ∂f dy
f ′( x, y ) = +
∂x ∂y dx
1
2
= ( )
⎛ 3 ⎞⎛ 1
( )

− 5e −5 x + ⎜ − ⎟⎜ e −5 x − 3 y ⎟
⎝ 2 ⎠⎝ 2 ⎠
13 9
= − e −5 x + y
4 4
then the value of yi+1 is given by

yi+1 = yi +
2
(
1 −5 xi
)1 ⎛ 13 9 ⎞
e − 3 yi h + ⎜ − e −5 xi + yi ⎟h 2
2⎝ 4 4 ⎠

NKAY NKAY
NKAY STUDY NANA KWABENA

6. A homicide victim is found at 6:00 PM in an office building that is maintained at 72 °F.


When the victim was found, his body temperature was at 85 °F. Three hours later at 9:00 PM,
his body temperature was recorded at 78 °F. Assume the temperature of the body at the time
of death is the normal human body temperature of 98.6 °F.
The governing equation for the temperature θ of the body is

= −k (θ − θ a )
dt
where
θ = temperature of the body, °F
θa = ambient temperature, °F
t = time, hours
k = constant based on thermal properties of the body and air
The estimated time of death most nearly is
(A) 2:11 PM
(B) 3:13 PM
(C) 4:34 PM
(D) 5:12 PM

NKAY
Solution
The correct answer is (B).


= −k (θ − θ a )
dt

+ kθ = kθ a
dt
The characteristic equation of the above ordinary differential equations is
r+k = 0
The solution to this equation is
r = −k
θ H = Ae −kt
(D + k )θ = kθ a
The particular solution is of the form
θP = B
Substituting this solution in the ordinary differential equation,
0 + kB = kθ a
B = θa
The complete solution is
θ = θH + θP
= Ae −kt + θ a
Given
θ a = 72
and using 12 noon as the reference time of t = 0 ,

NKAY NKAY
NKAY STUDY NANA KWABENA

θ (6 ) = 85
θ (9) = 78
θ (B ) = 98.6
where
B = time of death
we get
85 = Ae −k×6 + 72 (1)
78 = Ae −k×9 + 72 (2)
98.6 = Ae − k ×B + 72 (3)
Use Equations (1) and (2) to find A and k.

85 = Ae − k×6 + 72
(4)
Ae −k×6 = 13
78 = Ae − k×9 + 72
(5)
Ae −k×9 = 6

NKAY
Dividing Equation (4) by Equation (5) gives
Ae − k 6 13
=
Ae −k 9 6
e = 2.1667
3k

1
k = (ln (2.1667 ))
3
1
= 0.25773
hours
Knowing the value of k, from Equation (5)
A = 61.028 °F
Substitute k and A into Equation (3) to find B.
98.6 = Ae − k×B + 72
98.6 = 61.028e −0.25773×B + 72
26.6 = 61.028e −0.25773×B
ln 26.6 = ln 61.028 + (− 0.25773B )
0.25773B = 0.83042
B = 3.2220 hours
Note to the student:
You can also do the problem by assuming that the initial time reference is zero, and that the
temperature then is θ (0) = 98.6 . Then the temperature is given at the time the body was found
as θ (C ) = 85 °F, and that θ (C + 3) = 78 °F. You can now find k, A and C just like as given
above. The value of C in fact is the time between the body was found and the time of death.
You will get C = 2.7780 hrs.

The time of death is 3.2220 hrs from 12 noon, that is 3 : (0.2220 × 60) PM = 3:13 PM.

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Runge-Kutta 2nd Order Method
Ordinary Differential Equations
COMPLETE SOLUTION SET
1. To solve the ordinary differential equation
dy
3 + xy 2 = sin x, y (0) = 5
dx
by the Runge-Kutta 2nd order method, you need to rewrite the equation as
dy
(A) = sin x − xy 2 , y (0 ) = 5
dx

NKAY
(B)
dy 1
( )
= sin x − xy 2 , y (0) = 5
dx 3
dy 1 ⎛ xy 3 ⎞
(C) = ⎜⎜ − cos x − ⎟, y (0) = 5
dx 3 ⎝ 3 ⎟⎠
dy 1
(D) = sin x, y (0) = 5
dx 3
Solution
The correct answer is (B).

To solve ordinary differential equations by the Runge-Kutta 2nd order method, you need to
rewrite the equation in the following form
dy
= f (x, y ), y (0) = y 0
dx
Thus,
dy
3 + xy 2 = sin x, y (0) = 5
dx
dy
3 = sin x − xy 2 , y (0) = 5
dx
dy 1
( )
= sin x − xy 2 , y (0) = 5
dx 3

NKAY NKAY
NKAY STUDY NANA KWABENA

2. Given
dy
3 + 5 y 2 = sin x, y (0.3) = 5
dx
and using a step size of h = 0.3 , the value of y (0.9 ) using the Runge-Kutta 2nd order Heun
method is most nearly
(A) –4297.4
(B) –4936.7
(C) –0.21336 × 1014
(D) –0.24489 × 1014

Solution
The correct answer (A).

dy
3 + 5 y 2 = sin x, y (0.3) = 5
dx
is rewritten as

NKAY
dy 1
dx 3
( )
= sin x − 5 y 2 = f ( x, y )

1
(
f ( x, y ) = sin x − 5 y 2
3
)
1
In Huen’s method a2 = is chosen, giving
2
1
a1 =
2
p1 = 1
q11 = 1
resulting in
⎛1 1 ⎞
yi +1 = yi + ⎜ k1 + k 2 ⎟h
⎝2 2 ⎠
where
k1 = f ( x i , y i )
k 2 = f (xi + h, yi + k1h )
h = 0 .3

for i = 0, x0 = 0.3, y0 = 5
k1 = f ( x0 , y 0 )
= f (0.3,5)
1
(
= sin (0.3) − 5(5)
3
2
)
= −41.5682

NKAY NKAY
NKAY STUDY NANA KWABENA

k 2 = f ( x0 + h, y 0 + k1h )
= f (0.3 + 0.3,5 + (− 41.5682 × 0.3))
= f (0.6,−7.4704)
1
(
= sin(0.6) − 5(− 7.4704 )
3
2
)
1
= (0.56464 − 279.04 )
3
= −92.824
⎛1 1 ⎞
y1 = y 0 + ⎜ (k1 ) + (k 2 )⎟h
⎝2 2 ⎠
⎛1 1 ⎞
= 5 + ⎜ (− 41.5682) + (− 92.824)⎟0.3
⎝2 2 ⎠

NKAY
= 5 + (− 67.196) × 0.3
= −15.159
x1 = x0 + h
= 0.3 + 0.3
= 0.6
y (0.6 ) ≈ y1 = −15.159
for i = 1, x1 = 0.6, y1 = −15.159
k1 = f ( x1 , y1 )
= f (0.6,−15.159 )
1
(
= sin (0.6) − 5(− 15.159 )
3
2
)
= −382.80
k 2 = f ( x1 + h, y1 + k1h )
= f (0.6 + 0.3,−15.159 + (− 382.80 × 0.3))
= f (0.9,−130.00)
1
(
= sin(0.9) − 5(− 130.00)
3
2
)
1
= (0.78333 − 84500)
3
= −28166

NKAY NKAY
NKAY STUDY NANA KWABENA

⎛1 1 ⎞
y 2 = y1 + ⎜ (k1 ) + (k 2 )⎟h

NKAY
⎝2 2 ⎠
⎛1 1 ⎞
= −15.159 + ⎜ (− 382.80) + (− 28166)⎟0.3
⎝2 2 ⎠
= −15.159 + (− 14274) × 0.3
= −4297.4
x2 = x1 + h
= 0.6 + 0.3
= 0.9
y (0.9 ) ≈ y 2 = −4297.4

NKAY NKAY
NKAY STUDY NANA KWABENA

3. Given
dy
3 + 5 y = e 0.1x , y (0.3) = 5
dx
dy
and using a step size of h = 0.3 , the best estimate of (0.9) using the Runge-Kutta 2nd order
dx
midpoint method most nearly is
(A) –2.2473
(B) –2.2543
(C) –2.6188
(D) –3.2045

Solution
The correct answer is (C).

dy

NKAY
3 + 5 y = e 0.1x
dx
is rewritten as
dy 1 0.1x
dx 3
( )
= e − 5 y = f ( x, y )

1
(
f ( x, y ) = e 0.1x − 5 y
3
)
In the midpoint method a 2 = 1 is chosen, giving
a1 = 0
1
p1 =
2
1
q11 =
2
resulting in
y i +1 = y i + k 2 h
where
k1 = f ( x i , y i )
⎛ 1 1 ⎞
k 2 = f ⎜ xi + h, y i + k1 h ⎟
⎝ 2 2 ⎠
h = 0 .3

for i = 0, x0 = 0.3, y0 = 5

NKAY NKAY
NKAY STUDY NANA KWABENA

k1 = f ( x0 , y 0 )
= f (0.3,5)
1
(
= e 0.1×0.3 − 5 5
3
)
1
= (1.0305 − 11.180)
3
= −3.3833
⎛ 1 1 ⎞
k 2 = f ⎜ x0 + h, y 0 + k1h ⎟
⎝ 2 2 ⎠
⎛ 0.3 1 ⎞
= f ⎜ 0.3 + ,5 + (− 3.3833 × 0.3)⎟
⎝ 2 2 ⎠
= f (0.45,4.4925)

NKAY
1
(
= e 0.1×0.45 − 5 4.4925
3
)
1
= (1.0460 − 10.598)
3
= −3.1839
y1 = y0 + k 2 h
= 5 + (− 3.1839) × 0.3
= 4.0448
x1 = x0 + h
= 0.3 + 0.3
= 0.6
y (0.6 ) ≈ y1 = −3.1839
for i = 1, x1 = 0.6, y1 = 4.0448
k1 = f ( x1 , y1 )
= f (0.6,4.0448)
1
(
= e 0.1×0.6 − 5 4.0448
3
)
1
= (1.0618 − 10.056)
3
= −2.9980

NKAY NKAY
NKAY STUDY NANA KWABENA

⎛ 1 1 ⎞
k2 = f ⎜ x1 + h, y1 + k1h ⎟
⎝ 2 2 ⎠
⎛ 0.3 1 ⎞
= f ⎜ 0.6 + ,4.0448 + (− 2.9980 × 0.3)⎟
⎝ 2 2 ⎠
= f (0.75,3.5951)

=
3
(
1 0.075
e − 5 3.5951 )
= −2.8008

NKAY
y 2 = y1 + k 2 h
= 4.04483 + (− 2.8008) × 0.3
= 3.2046
x2 = x1 + h
= 0.6 + 0.3
= 0.9
y (0.9 ) ≈ y 2 = 3.2046
Thus
dy
(0.9) = f (x, y )
dx x = 0.9

≈ f ( x2 , y2 )
= f (0.9,3.2046)
1
(
= e0.1×0.9 − 5 3.2046
3
)
1
= (1.0942 − 8.9507 )
3
= −2.6188

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The velocity (m/s) of a body is given as a function of time (seconds) by


v(t ) = 200 ln (1 + t ) − t , t ≥ 0
Using the Runge-Kutta 2nd order Ralston method with a step size of 5 seconds, the distance in
meters traveled by the body from t = 2 to t = 12 seconds is estimated most nearly as
(A) 3904.9
(B) 3939.7
(C) 6556.3
(D) 39397

Solution
The correct answer is (A).

dS
= f (t , S ) = 200 ln (1 + t ) − t , t ≥ 0
dt

NKAY
2
In the Ralston method a2 = is chosen, giving
3
1
a1 =
3
3
p1 =
4
3
q11 =
4
resulting in
⎛1 2 ⎞
Si +1 = Si + ⎜ k1 + k2 ⎟h
⎝3 3 ⎠
where
k1 = f (t i , S i )
⎛ 3 3 ⎞
k 2 = f ⎜ t i + h, S i + k 1 h ⎟
⎝ 4 4 ⎠
h=5
for i = 0, t0 = 2 s, S0 = 0 m, we are assuming S (2 ) = 0
k1 = f (t0 , S0 )
= f (2,0)
= 200 ln (1 + 2) − 2
= 217.72

NKAY NKAY
NKAY STUDY NANA KWABENA

⎛ 3 3 ⎞
k2 = f ⎜ t0 + h, S0 + k1h ⎟
⎝ 4 4 ⎠
⎛ 3 3 ⎞
= f ⎜ 2 + × 5,0 + (217.72 )5 ⎟
⎝ 4 4 ⎠
= f (5.75,816.46 )
= 200 ln(1 + 5.75) − (5.75)
= 381.91 − 5.75
= 376.16
⎛1 2 ⎞
S1 = S0 + ⎜ k1 + k2 ⎟h
⎝3 3 ⎠
⎛1 2 ⎞
= 0 + ⎜ (217.72 ) + (376.16 )⎟ × 5
⎝3 3 ⎠
= 1616.7 m
t1 = t 0 + h

NKAY
= 2+5
=7
S (7 ) ≈ S1 = 1616.7 m
for i = 1, t1 = 7 s, S1 = 1616.7 m
k1 = f (t1 , S1 )
= f (7,1616.7 )
= 200 ln(1 + 7 ) − 7
= 408.89
⎛ 3 3 ⎞
k2 = f ⎜ t1 + h, S1 + k1h ⎟
⎝ 4 4 ⎠
⎛ 3 3 ⎞
= f ⎜ 7 + × 5,1616.7 + (408.89)5 ⎟
⎝ 4 4 ⎠
= f (10.75,3150.1)
= 200 ln (1 + 10.75) − (10.75)
= 492.77 − 10.75
= 482.02
⎛1 2 ⎞
S 2 = S1 + ⎜ k1 + k2 ⎟h
⎝3 3 ⎠
⎛1 2 ⎞
= 1616.7 + ⎜ (408.89 ) + (482.02 )⎟ × 5
⎝3 3 ⎠
=1616.7 + (457.64 ) × 5
= 3904.9 m

NKAY NKAY
NKAY STUDY NANA KWABENA

t 2 = t1 + h

NKAY
= 7+5
= 12
S (12 ) ≈ S 2 = 3904.9 m
Hence the distance covered between t = 2 and t = 12 seconds is
d = S (12) − S (2)
≈ S 2 − S0
= 3904.9 − 0
= 3904.9 m

NKAY NKAY
NKAY STUDY NANA KWABENA

5. The Runge-Kutta 2nd order method can be derived by using the first three terms of the Taylor
series of writing the value of yi +1 (that is the value of y at xi +1 ) in terms of yi (that is the value
of y at xi ) and all the derivatives of y at xi . If h = xi +1 − xi , the explicit expression for yi +1 if
the first three terms of the Taylor series are chosen for solving the ordinary differential equation
dy
+ 5 y = 3e − 2 x , y (0 ) = 7
dx
would be
( )
(A) yi +1 = yi + 3e − 2 xi − 5 yi h + 5
h2
2
( ) (
(B) yi+1 = yi + 3e −2 xi − 5 yi h + − 21e −2 xi + 25yi ) h2
2
( ) ( )
2
h
(C) y i +1 = y i + 3e − 2 xi − 5 y i h + − 6e −2 xi
2
( ) ( )
(D) y i +1 = y i + 3e −2 xi − 5 y i h + − 6e − 2 xi + 5
h2

NKAY
2
Solution
The correct answer is (B).

The first three terms of the Taylor series are as follows


1
yi +1 = yi + f ( xi , yi )h + f ′( xi , yi )h 2
2!
Our ordinary differential equation is rewritten as
dy
+ 5 y = 3e − 2 x , y (0 ) = 7
dx
f ( x, y ) = 3e −2 x − 5 y, y (0) = 7
Now since y is a function of x,
∂f ( x, y ) ∂f ( x, y ) dy
f ′( x, y ) = +
∂x ∂y dx
=

(
∂x
) [(
3e − 2 x − 5 y +

∂y
)]( )
3e − 2 x − 5 y 3e − 2 x − 5 y
−2 x
(
= −6e + (−5) 3e − 5 y −2 x
)
= −21e −2 x + 25 y
The 2nd order formula for the above ordinary differential equation would be
1
y i +1 = y i + f (xi , y i )h + f ′( xi , y i )h 2
2!
( ) ( 1
)
= yi + 3e − 2 xi − 5 yi h + − 21e − 2 xi + 25 yi h 2
2

NKAY NKAY
NKAY STUDY NANA KWABENA

6. A spherical ball is taken out of a furnace at 1200 K and is allowed to cool in air. You are given
the following

radius of ball = 2 cm
J
specific heat of ball = 420
kg ⋅ K
kg
density of ball = 7800
m3
J
convection coefficient = 350
s ⋅ m2 ⋅ K
ambient temperature = 300 K

The ordinary differential equation that is given for the temperature θ of the ball is

= −2.20673 × 10 −13 (θ 4 − 81 × 10 8 )
dt
if only radiation is accounted for. The ordinary differential equation if convection is accounted

NKAY
for in addition to radiation is

(A)
dt
( )
= −2.20673 × 10−13 θ 4 − 81 × 108 − 1.6026 × 10− 2 (θ − 300)

(B) = −2.20673 × 10−13 (θ 4 − 81 × 108 ) − 4.3982 × 10− 2 (θ − 300)
dt

(C) = −1.6026 × 10− 2 (θ − 300 )
dt

(D) = −4.3982 × 10 − 2 (θ − 300)
dt
Solution
The correct answer is (A).

The rate of heat loss due to convection


Rate of heat loss due to convection = hA(θ − θ a ) `
where
J
h = convection coefficient = 350
s ⋅ m2 ⋅ K
2
A = surface area of the ball, m
The energy stored by mass is
Energy stored by mass = mCθ
where

m = mass of the ball , kg


J
C = specific heat of the ball,
kg ⋅ K

NKAY NKAY
NKAY STUDY NANA KWABENA

A = 4πr 2
= 4π × 0.022
= 0.0050265 m 2
m = ρV
⎛4 ⎞
= ρ ⎜ πr 3 ⎟
⎝3 ⎠

NKAY
⎛4 ⎞
= 7800⎜ π × 0.023 ⎟
⎝3 ⎠
= 0.26138 kg
From the energy balance
(Rate at which heat is gained) – (Rate at which heat is lost) = (Rate at which heat is stored)
we get

mC
dt
( ( ))
= mC − 2.20673 × 10−13 θ 4 − 81 × 108 − hA(θ − θ a )

dθ hA(θ − θ a )
dt
( (
= − 2.20673 × 10−13 θ 4 − 81 × 108 −
mC
))
( (
= − 2.20673 × 10−13 θ 4 − 81 × 108 −
(350 )(0.0050265)(θ − 300)
))
0.26138 × 420
−13 4
( 8
)
= −2.20673 × 10 θ − 81 × 10 − 0.016026(θ − 300 )
= −2.20673 × 10 −13
(θ 4
− 81 × 10 ) − 1.6026 × 10 (θ − 300)
8 −2

NKAY NKAY
NKAY STUDY NANA KWABENA

Multiple-Choice Test
Runge-Kutta 4th Order Method
Ordinary Differential Equations
COMPLETE SOLUTION SET
1. To solve the ordinary differential equation
dy
3 + xy 2 = sin x, y (0 ) = 5 ,
dx

NKAY
by Runge-Kutta 4th order method, you need to rewrite the equation as
dy
(A) = sin x − xy 2 , y (0 ) = 5
dx
= (sin x − xy 2 ), y (0 ) = 5
dy 1
(B)
dx 3
dy 1 ⎛ xy 3 ⎞
(C) ⎜
= − cos x − ⎟, y (0) = 5
dx 3 ⎜⎝ 3 ⎟⎠
dy 1
(D) = sin x, y (0) = 5
dx 3

Solution
The correct answer is (B)

dy
3 + xy 2 = sin x, y (0 ) = 5
dx
is rewritten as
dy
3 = sin x − xy 2 , y (0 ) = 5
dx
dy 1
dx 3
( )
= sin x − xy 2 , y (0 ) = 5

NKAY NKAY
NKAY STUDY NANA KWABENA

dy
2. Given 3 + 5 y 2 = sin x, y (0.3) = 5 and using a step size of h = 0.3 , the value of y(0.9) using
dx
Runge-Kutta 4th order method is most nearly
(A) –0.25011 × 10 40
(B) –4297.4
(C) –1261.5
(D) 0.88498

Solution
The correct answer is (C)

dy
3 + 5 y 2 = sin x, y (0.3) = 5
dx
is rewritten as
dy 1
dx 3
( )
= sin x − 5 y 2 , y (0.3) = 5

NKAY
the Runge-Kutta 4th order method is
1
yi +1 = yi + (k1 + 2k 2 + 2k3 + k 4 )h
6
where
k1 = f ( xi , yi )
⎛ 1 1 ⎞
k 2 = f ⎜ xi + h, yi + k1h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
k3 = f ⎜ xi + h, yi + k 2 h ⎟
⎝ 2 2 ⎠
k4 = f ( xi + h, yi + k3h )
for i = 0, x0 = 0.3, y 0 = 5
k1 = f ( x0 , y 0 )
= f (0.3,5)

=
1
3
(
sin 0.3 − 5(5)
2
)
= −41.5682
⎛ 1 1 ⎞
k 2 = f ⎜ x0 + h, y 0 + k1 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.3 + × 0.3,5 + × −41.5682 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.45,−1.23523)
1
(
= sin 0.45 − 5(− 1.23523)
3
2
)

NKAY NKAY
NKAY STUDY NANA KWABENA

= −2.398
⎛ 1 1 ⎞
k 3 = f ⎜ x 0 + h, y 0 + k 2 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.3 + × 0.3,5 + × −2.398 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.45,4.6403)
1
(
= sin 0.45 − 5(4.6403)
3
) 2

= −35.7423
k 4 = f ( x0 + h, y 0 + k 3 h )
= f (0.3 + 0.3,5 + −35.7423 × 0.3)
= f (0.6,−5.72269)
1
= (sin 0.6 − 5(− 5.72269))
3
= −54.3938

NKAY
1
y1 = y 0 + (k1 + 2k 2 + 2k 3 + k 4 )h
6
1
= 5 + (− 41.5682 − 2 × 2.398 − 2 × 35.7423 − 54.3938) × 0.3
6
= −3.61213
x1 = x0 + h
= 0.3 + 0.3
= 0.6

for i = 1, x1 = 0.6, y1 = −3.61213


k1 = f ( x1 , y1 )
= f (0.6,−3.61213)

=
1
3
(
sin 0.6 − 5(− 3.61213)
2
)
= −21.5576
⎛ 1 1 ⎞
k 2 = f ⎜ x1 + h, y1 + k1 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.6 + × 0.3,−3.61213 + × −21.5576 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.75,−6.84577 )
1
(
= sin 0.75 − 5(− 6.84577 )
3
2
)
= −77.8804

NKAY NKAY
NKAY STUDY NANA KWABENA

⎛ 1 1 ⎞
k 3 = f ⎜ x1 + h, y1 + k 2 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.6 + × 0.3,−3.61213 + × −77.8804 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.75,−15.2942 )
1
(
= sin 0.75 − 5(− 15.2942 )
3
) 2

= −389.627

NKAY
k 4 = f ( x0 + h, y 0 + k 3 h )
= f (0.6 + 0.3,−3.61213 + −389.627 × 0.3)
= f (0.9,−120.5)
1
= (sin 0.9 − 5(− 120.5))
3
= −24200.2
1
y 2 = y1 + (k1 + 2k 2 + 2k 3 + k 4 )h
6
1
= − 3.61213 + (− 21.5576 − 2 × 77.8804 − 2 × 389.627 − 24200.2 ) × 0.3
6
= −1261.45
x 2 = x1 + h
= 0.6 + 0.3
= 0.9
y ( x 2 ) ≅ −1261.45
y (0.9) ≅ −1261.45

NKAY NKAY
NKAY STUDY NANA KWABENA

dy dy
3. Given 3 + y 2 = e x , y (0.3) = 5 , and using a step size of h = 0.3 , the best estimate of (0.9)
dx dx
Runge-Kutta 4th order method is most nearly
(A) -1.6604
(B) -1.1785
(C) -0.45831
(D) 2.7270

Solution
The correct answer is (A)

dy
3 + y 2 = e x , y (0.3) = 5
dx
is rewritten as
= (e − y 2 ), y (0.3) = 5
dy 1 x
dx 3
the Runge-Kutta 4th order method is

NKAY
1
yi +1 = yi + (k1 + 2k 2 + 2k3 + k 4 )h
6
where
k1 = f ( xi , yi )
⎛ 1 1 ⎞
k 2 = f ⎜ xi + h, yi + k1h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
k3 = f ⎜ xi + h, yi + k 2 h ⎟
⎝ 2 2 ⎠
k4 = f ( xi + h, yi + k3h )
for i = 0, x0 = 0.3, y 0 = 5
k1 = f ( x 0 , y 0 )
= f (0.3,5)

=
3
(
1 0.3
e − (5)
2
)
= −7.8833
⎛ 1 1 ⎞
k 2 = f ⎜ x0 + h, y 0 + k1 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.3 + × 0.3,5 + × −7.8833 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.45,3.81751)
1
(
= e 0.45 − (3.81751)
3
2
)
= −4.33502

NKAY NKAY
NKAY STUDY NANA KWABENA

⎛ 1 1 ⎞
k 3 = f ⎜ x0 + h, y 0 + k 2 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.3 + × 0.3,5 + × −4.33502 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.45,4.34975)
1
(
= e 0.45 − 4.34975 2
3
)
= −5.784
k 4 = f ( x0 + h, y 0 + k 3 h )
= f (0.3 + 0.3,5 + −5.784 × 0.3)
= f (0.6,3.2648)

= (
1 0.6
e − 3.2648 2 )

NKAY
3
= −2.9456
1
y1 = y 0 + (k1 + 2k 2 + 2k 3 + k 4 )h
6
1
= 5 + (− 7.88338 − 2 × 4.33502 − 2 × 5.784 − 2.9456 ) × 0.3
6
= 3.44665

for i = 1, x1 = 0.6, y1 = 3.44665


k1 = f (x1 , y1 )
= f (0.6,3.44665)

=
3
(
1 0.6
e − 3.44665 2 )
= −3.35243
⎛ 1 1 ⎞
k 2 = f ⎜ x1 + h, y1 + k1 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.6 + × 0.3,3.44665 + × −3.35243 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.75,2.94378)
1
(
= e 0.75 − (2.94378)
3
2
)
= −2.18295

NKAY NKAY
NKAY STUDY NANA KWABENA

⎛ 1 1 ⎞
k 3 = f ⎜ x1 + h, y1 + k 2 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 0.6 + × 0.3,3.44665 + × −2.18295 × 0.3 ⎟
⎝ 2 2 ⎠
= f (0.75,3.11921)
1
(
= e 0.75 − (3.11921)
3
)
2

= −2.53749
k 4 = f ( x0 + h, y 0 + k 3 h )
= f (0.6 + 0.3,3.44665 − 2.53749 × 0.3)

NKAY
= f (0.9,2.6854 )

=
3
(
1 0.9
e − (2.6854)
2
)
= −1.58392
1
y 2 = y1 + (k1 + 2k 2 + 2k 3 + k 4 )h
6
1
= 3.44665 + (− 3.35243 − 2 × 2.18295 − 2 × 2.53749 − 1.58392) × 0.3
6
= 2.72779
x 2 = x1 + h
= 0.6 + 0.3
= 0.9

= (e − y 2 )
dy 1 x
dx 3
dy
dx 3
(
(0.9) ≅ 1 e 0.9 − ( y (0.9))2 )
1
(
≅ e 0.9 − (2.72779)
3
2
)
≅ −1.6604

NKAY NKAY
NKAY STUDY NANA KWABENA

4. The velocity (m/s) of a parachutist is given as a function of time (seconds) by


ν (t ) = 55.8 tanh(0.17t ), t ≥ 0
Using Runge-Kutta 4th order method with a step size of 5 seconds, the distance traveled by the
body from t = 2 to t = 12 seconds is estimated most nearly as
(A) 341.43 m
(B) 428.97 m
(C) 429.05 m
(D) 703.50 m

Solution
The correct answer is (C)

ν (t ) = 55.8 tanh(0.17t ), t ≥ 0
the Runge-Kutta 4th order method is
1
S i +1 = S i + (k1 + 2k 2 + 2k 3 + k 4 )h
6
where

NKAY
k1 = f (t i , S i )
⎛ 1 1 ⎞
k 2 = f ⎜ t i + h, S i + k1 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
k 3 = f ⎜ t i + h, S i + k 2 h ⎟
⎝ 2 2 ⎠
k 4 = f (t i + h, S i + k 3 h )
for i = 0, t 0 = 2, S 0 = 0
k1 = f (t 0 , S 0 )
= f (2,0 )
= 55.8 tanh(0.17 × 2)
= 18.2732
⎛ 1 1 ⎞
k 2 = f ⎜ t 0 + h, S 0 + k 1 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 2 + × 5,0 + × 18.2732 × 5 ⎟
⎝ 2 2 ⎠
= f (4.5,45.683)
= 55.8 tanh (0.17 × 4.5)
= 35.9359
⎛ 1 1 ⎞
k 3 = f ⎜ t 0 + h, S 0 + k 2 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 2 + × 5,0 + × 35.9359 × 5 ⎟
⎝ 2 2 ⎠

NKAY NKAY
NKAY STUDY NANA KWABENA

= f (4.5,89.8398)
= 55.8 tanh (0.17 × 4.5)
= 35.9359
k 4 = f (t 0 + h, S 0 + k 3 h )
= f (2 + 5,0 + 35.9359 × 5)
= f (7,179.68)
= 55.8 tanh (0.17 × 7 )
= 46.3463
1
S1 = S 0 + (k1 + 2k 2 + 2k 3 + k 4 )h
6
1
= 0 + (18.2732 + 2 × 35.9359 + 2 × 35.9359 + 46.3463) × 5
6
= 173.636
t1 = t 0 + h

NKAY
= 2+5
=7
for i = 1, t1 = 7, S1 = 173.636
k1 = f (t1 , S1 )
= f (7,173.636)
= 55.8 tanh(0.17 × 7)
= 46.3463
⎛ 1 1 ⎞
k 2 = f ⎜ t 1 + h, S 1 + k 1 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 7 + × 5,173.636 + × 46.3463 × 5 ⎟
⎝ 2 2 ⎠
= f (9.5,289.502 )
= 55.8 tanh (0.17 × 9.5)
= 51.5534
⎛ 1 1 ⎞
k 3 = f ⎜ t1 + h, S 1 + k 2 h ⎟
⎝ 2 2 ⎠
⎛ 1 1 ⎞
= f ⎜ 7 + × 5,173.636 + × 51.5534 × 5 ⎟
⎝ 2 2 ⎠
= f (9.5,302.52)
= 55.8 tanh (0.17 × 9.5)
= 51.5534

NKAY NKAY
NKAY STUDY NANA KWABENA

k 4 = f (t1 + h, S1 + k 3 h )
= f (7 + 5,173.636 + 51.5534 × 5)
= f (12,431.403)
= 55.8 tanh (0.17 × 12)
= 53.9445

NKAY
1
S 2 = S1 + (k1 + 2k 2 + 2k 3 + k 4 )h
6
1
= 173.636 + (46.3463 + 2 × 51.5534 + 2 × 51.5534 + 53.9445) × 5
6
= 429.05 m
t 2 = t1 + h
= 7+5
= 12
The distance traveled from t = 2 to t = 12 is
Distance traveled = S 2 − S 0
= S (t 2 ) − S (t 0 )
= S (12) − S (2 )
= 429.05 − 0
= 429.05m

NKAY NKAY
NKAY STUDY NANA KWABENA

5. Runge-Kutta method can be derived from using first three terms of Taylor series of writing
the value of yi +1 , that is the value of y at xi +1 , in terms of yi and all the derivatives of y at xi .
If h = xi +1 − xi , the explicit expression for yi +1 if the first five terms of the Taylor series are
chosen for the ordinary differential equation
dy
+ 5 y = 3e − 2 x , y (0 ) = 7 ,
dx
would be
(A) ( )
y i +1 = y i + 3e − 2 xi − 5 y i h +
5h 2
2

( ) ( ) h2
2
y i +1 = y i + 3e − 2 xi − 5 y i h + − 21e − 2 xi + 25 y i
(B)
( ) h6 + (− 300909e ) h24
3 4
+ − 483e − 2 xi + 625 y i − 2 xi
+ 390625 y i

( ) ( ) h2 + (12e ) h6
2 3

NKAY
y i +1 = y i + 3e − 2 xi − 5 y i h + − 6e − 2 xi − 2 xi

(C)
( ) h24
4
+ − 24e − 2 xi

( ) ( ) h2 + (12e ) h6
2 3
y i +1 = y i + 3e −2 xi − 5 y i h + − 6e − 2 xi + 5 − 2 xi

(D)
( ) h24
4
+ − 24e − 2 xi

Solution
The correct answer is (B)

The first five terms of the Taylor series are as follows


1 1 1
yi +1 = yi + f ( xi , yi )h + f ' ( xi , yi )h 2 + f '' ( xi , yi )h3 + f ''' (xi , yi )h 4
2! 3! 4!

our ordinary differential equation


dy
+ 5 y = 3e − 2 x , y (0 ) = 7
dx
f ( x, y ) = 3e −2 x − 5 y
Now since y is a function of x,
∂f ( x, y ) ∂f ( x, y ) dy
f ′( x, y ) = +
∂x ∂y dx
=

∂x
(
3e − 2 x − 5 y +

∂y
) [( )](
3e − 2 x − 5 y 3e − 2 x − 5 y )

NKAY NKAY
NKAY STUDY NANA KWABENA

(
= −6e −2 x + (−5) 3e −2 x − 5 y )
= −21e −2 x + 25 y
∂f ′( x, y ) ∂f ′(x, y ) d 2 y
f ′′( x, y ) = +
∂x ∂y dx 2
=

∂x
( )
− 21e − 2 x + 25 y +

∂y
[( )](
− 21e − 2 x + 25 y − 21e −2 x + 25 y)
−2 x
(
= 42e + (25) − 21e + 25 y −2 x
)

NKAY
= −483e −2 x + 625 y
∂f ′′( x, y ) ∂f ′′( x, y ) d 3 y
′′′(
f x, y = ) +
∂x ∂y dx 3
=

∂x
(
− 483e − 2 x + 625 y + ) ∂y

[( )](
− 483e − 2 x + 625 y − 483e − 2 x + 625 y )
−2 x
(
= 966e + (625) − 483e + 625 y −2 x
)
= −3000909e −2 x + 390625 y

The 4th order formula for the above example would be


1 1 1
yi +1 = yi + f ( xi , yi )h + f ' ( xi , yi )h 2 + f '' ( xi , yi )h3 + f ''' (xi , yi )h 4
2! 3! 4!
( ) ( )
2
h
y i +1 = y i + 3e −2 xi − 5 y i h + − 21e − 2 xi + 25 y i
2

( ) ( )
3
h h4
+ − 483e − 2 xi + 625 y i + − 300909e − 2 xi + 390625 y i
6 24

NKAY NKAY
NKAY STUDY NANA KWABENA

6. A hot solid cylinder is immersed in an cool oil bath as part of a quenching process. This
process makes the temperature of the cylinder, θ c , and the bath, θ b , change with time. If the
initial temperature of the bar and the oil bath is given as 600° C and 27°C, respectively, and
Length of cylinder = 30 cm
Radius of cylinder = 3 cm
kg
Density of cylinder = 2700 3
m
J
Specific heat of cylinder = 895
kg ⋅ K
W
Convection heat transfer coefficient = 100 2
m ⋅K
J
Specific heat of oil = 1910
kg ⋅ K
Mass of oil = 2 kg
the coupled ordinary differential equation giving the heat transfer are given by

NKAY Oil

Cylinder

dθ c
(A) 362.4 + θc = θb
dt
dθ b
675.5 + θb = θc
dt
dθ c
(B) 362.4 − θc = θb
dt
dθ b
675.5 − θb = θc
dt
dθ c
(C) 675.5 + θc = θb
dt
dθ b
362.4 + θb = θc
dt
dθ c
(B) 675.5 − θc = θb
dt

NKAY NKAY
NKAY STUDY NANA KWABENA

Solution
The correct answer is (A)

For the cylinder the rate of heat lost due to convection = h(θ )A(θ c − θ b ) .
where
h( θ ) = the convective cooling coefficient, W/(m2-K) and is a function of temperature
A = surface area of the cylinder
The energy stored in the mass is given by
Energy stored by mass = m.C. θ
where
m = mass of the cylinder, kg
C = specific heat of the cylinder, J/(kg-K)
From an energy balance,
Rate at which heat is gained - Rate at which heat is lost =

NKAY
= Rate at which heat is stored
gives

− h(θ )A(θ c − θ b ) = mC
dt
where
W
h(θ ) = 100 2
m ⋅K

A = 2πr 2 + 2πrL
= 2π (0.03) + 2π × 0.03 × 0.3
2

= 0.062204 m 2
m = ρV

= 2700 3 × (πr 2 × L )m 3
kg
m
= 2700 × π (0.03) × 0.3
2

= 2.2902 kg
Thus
dθ c
− h(θ )A(θ c − θ b ) = mC
dt
dθ c
− 100 × 0.062204(θ c − θ b ) = 2.2902 × 895
dt
dθ c
329.517 + θc = θb
dt
Similarly for the oil

NKAY NKAY
NKAY STUDY NANA KWABENA

NKAY
dθ b
− h(θ )A(θ b − θ c ) = mC
dt
dθ b
− 100 × 0.062204(θ b − θ c ) = 2 × 1910
dt
dθ b
614.108 + θb = θc
dt

NKAY NKAY

You might also like