Worksheet II Prepared by Eyob S.
Date: January 3, 2026
Q.1. In the context of various mathematical and scientific operations, what are the types of errors that may
occur? How are these errors mathematically expressed for the calculation? Apparently, design a 13-bit
floating-point number format for a hypothetical architecture with a sign bit, exponent bits, and mantissa
bits. Determine the optimal allocation of bits to the sign, exponent, and mantissa. Do you think that the
relative true error and machine epsilon are always equivalent? If your answer is no, provide a proof or
counterexample to show your claim.
Q.2. An electrical circuit having a nonlinear amplifier given: 𝑓(𝑥) = −0.2𝑥 3 + 0.6𝑥 2 + 0.8𝑥 + 0.1
with: 𝑥0 = 1 and ∈𝑠 = 0.01. Hence, find the root until |∈𝑎 | ≤ |∈𝑠 | by using:
a) Fixed point iteration,
b) Newton-Raphson method.
Q.3. While training a machine learning model, assume you are going to do this using the unknown input
vector, [𝑥1 𝑥2 𝑥3 ]𝑇 with the corresponding weights (matrix A) and biases (vector B, the R.H.S.)
formulating a system of linear equations as given below. Determine the unknowns using the LU
factorization numerical technique using the following information.
𝑥1 + 𝑥2 − 𝑥3 = −3
2𝑥1 + 6𝑥2 + 2𝑥3 = 2
4𝑥1 − 3𝑥2 + 𝑥3 = 1
Q.4. Consider a look-up table to test out a developed machine functionality, proving the table of 𝑥 and 𝑓(𝑥)
such as the table in (Q.1.C). Perform the following tasks:
A. What is the numerical method called when a machine is used to determine the correct f(x) value after
“looking up” an intermediate value from the table? Moreover, what steps can be taken to help the
machine attain greater accuracy?
B. Assume the Ethiopian meteorological station has collected temperature data (𝐓) at four different time
slots (𝐭 𝐢 ). The following table contains the station's records to help with interpolations of the temperature
at any point in the time frame 1 through 6. Develop the cubic Newton’s divided difference polynomial
interpolation equation & solve for 𝐓(𝟑).
𝒕 1 2 4 6
𝑻(𝒕) 14.6 16.8 21.2 17.6
C. Write a MATLAB script for third-order Lagrange polynomial interpolation to solve for 𝐓(𝟓).
D. Use the approximate expression of 𝑻(𝒕) That is already calculated to solve these problems. Develop
the third-order equation of Lagrange polynomial interpolation and employ it to solve for 𝐓(𝟓).
E. Determine the value of the central difference for 𝒕 = [𝟎, 𝟔] and 𝒏 = 𝟔 utilizing all calculations above.
Worksheet II Prepared by Eyob S. Date: January 3, 2026
Q.5. During the fusion of speaking capability to a certain robot with a generative adversarial network
(GAN) technique, its training accuracy can be derived from the computation of numerical differentiation.
A. Solve 2𝑥 2 − sin(𝑥) = 0, employing the forward difference within the range 𝑥 = [−1, 1] and ℎ = 0.2.
B. Write a MATLAB script for solving an expression given here in (Q.2.A) using backward difference.
Q.6. For a current waveform, 𝐼(𝑡) = sin(3𝑡) + cos(10𝑡), solve the integration of 𝐼(𝑡) within 𝑡 = [0, 2𝜋]
A. Apply Simpson's 1/3 rule to calculate the integral of 𝐼(𝑡) and true error given 𝑛 = 8.
B. Apply also the Trapezoidal rule over 8 points and compare its true error with the one in (Q.3.A).
Worksheet II Prepared by Eyob S. Date: January 3, 2026
Q.1. Solution:
(a) True error (𝐸𝑡 ): the difference between the true value and the approximate value.
𝐸𝑡 = 𝑡𝑟𝑢𝑒𝑉𝑎𝑙𝑢𝑒 − 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒𝑉𝑎𝑙𝑢𝑒
(b) Approximate error (𝐸𝑎 ): the difference between the present and previous approximations.
𝐸𝑎 = 𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 − 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒
Designing part:
Sign bit = 1 bit exponent = 5 bits fraction/mantissa = 7 bits
(This answer is not always, but |∈𝑡 | ≤ |∈𝑚 |For example, let 259 be stored.
✓ The binary format for 258 is 100000011
✓ This can be written as: 1.00000011 × 28
✓ The sign bit is 0 since it is a positive number
✓ The biased exponent is 25−1 − 1 = 15 ⇒ 7 = 𝑒 ′ − 15 ⇒ 𝑒 ′ = 23
✓ The binary format for 23 is 10111
′ −15
129 = (−1)𝑠 × 1. 𝑓 × 2𝑒 = (−1)0 × 1.00000011 × 223−15
0 1 0 1 1 1 0 0 0 0 0 0 1
Recovering the number results in: 𝑣 = (−1)0 × 1.0000001 × 223−15 = 258
(259 − 258)⁄ −3
Thus, the absolute relative true error is: |∈𝑡 | = 259 = 3.8610 × 10
Machine epsilon is the interval between two subsequent representations (7 mantissa bits):
|∈𝑚 | = 27 = 7.8125 × 10−3
∴ |∈𝑡 | ≤ |∈𝑚 |
Worksheet II Prepared by Eyob S. Date: January 3, 2026
Q.2. Solution:
(a) Let’s rearrange a nonlinear amplifier 𝑓(𝑥) = −0.2𝑥 3 + 0.6𝑥 2 + 0.8𝑥 + 0.1 = 0 as 𝑔(𝑥) = 𝑥.
⇒ −0.2𝑥 3 + 0.6𝑥 2 + 0.8𝑥 = −0.1 ..moving 0.1 to the R.H.S
⇒ −𝑥(0.2𝑥 2 + 0.6𝑥 + 0.8) = −0.1 ..taking – 𝒙 as a common,
⇒ (−𝑥(0.2𝑥 2 + 0.6𝑥 + 0.8) = −0.1)⁄ ..making 𝒙 alone at L.H.S
−(0.2𝑥 2 + 0.6𝑥 + 0.8)
⇒ 𝑥 = 0.1⁄(0.2𝑥 2
+ 0.6𝑥 + 0.8)
⇒ 𝑥 = 1⁄(2𝑥 2 ..the R.H.S times by 10/10
+ 6𝑥 + 8)
∴ 𝒈(𝒙) = 𝟏⁄(𝟐𝒙𝟐
+ 𝟔𝒙 + 𝟖)
Therefore, the fixed-point iteration method become: 𝒙𝒏+𝟏 = 𝒈(𝒙𝒏 )
To continue with the fixed-point iteration method first let check if it’s convergent near 1:
|𝑔′ (𝑥)| = |−(4𝑥 + 6)⁄(2𝑥 2
+ 6𝑥 + 8)2 | < 1.0
Let’s plug in 𝑥 = 1,
⇒ |−(4(1) + 6)⁄(2(1)2 + 6(1) + 8)2 | = |− 10⁄256| < 1.0
First iteration, solving for the root 𝑥1 and absolute relative approximate error |∈1𝑎 |:
𝑥1 = 1⁄ 2 = 1⁄(2(1)2 + 6(1) + 8) = 1⁄16 = 0.0625
(2𝑥0 + 6𝑥0 + 8)
𝑥1 − 𝑥0 1⁄ − 1
|∈1𝑎 | =| | = | 16 | = |−15⁄1| = 15.0
𝑥1 1⁄
16
Second iteration, solving for the root 𝑥2 and absolute relative approximate error |∈2𝑎 |:
𝑥2 = 1⁄ 2 = 1⁄(2(0.0625)2 + 6(0.0625) + 8) = 1⁄8.382 = 0.1193
(2𝑥1 + 6𝑥1 + 8)
𝑥2 − 𝑥1 0.1193 − 0.0625
|∈2𝑎 | = | |=| | = |0.0568⁄0.1193| = 0.4761
𝑥2 0.1193
Worksheet II Prepared by Eyob S. Date: January 3, 2026
Third iteration, solving for the root 𝑥3 and absolute relative approximate error |∈3𝑎 |:
𝑥3 = 1⁄ 2 = 1⁄(2(0.1193)2 + 6(0.1193) + 8) = 1⁄8.744 = 0.1144
(2𝑥2 + 6𝑥2 + 8)
𝑥3 − 𝑥2 0.1144 − 0.1193
|∈3𝑎 | = | |=| | = |−0.0049⁄0.1144| = 0.043
𝑥3 0.1144
Fourth iteration, solving for the root 𝑥4 and absolute relative approximate error |∈4𝑎 |:
𝑥4 = 1⁄ 2 = 1⁄(2(0.1144)2 + 6(0.1144) + 8) = 0.1148
(2𝑥3 + 6𝑥3 + 8)
𝑥4 − 𝑥3 0.1148 − 0.1144
|∈4𝑎 | = | |=| | = |−0.0004⁄0.1148| = 0.0035
𝑥4 0.1148
Here it is |∈𝟒𝒂 | ≤ |∈𝒔 | = 𝟎. 𝟎𝟏 therefore the root is: 𝒙 = 𝟎. 𝟏𝟏𝟒𝟖
(b) Given. nonlinear amplifier equation 𝑓(𝑥) = −0.2𝑥 3 + 0.6𝑥 2 + 0.8𝑥 + 0.1
the first derivative is 𝑓 ′ (𝑥) = −0.6𝑥 2 + 1.2𝑥 + 0.8 and
the iterative Newton Raphson expressed as:
𝒇(𝒙𝒏 )
𝒙𝒏+𝟏 = 𝒙𝒏 − ⁄𝒇′ (𝒙 )
𝒏
First iteration, solving for the root 𝑥1 and absolute relative approximate error |∈1𝑎 |:
𝑓(𝑥0 ) −0.2(1)3 + 0.6(1)2 + 0.8(1) + 0.1
𝑥1 = 𝑥0 − ⁄𝑓 ′ (𝑥 ) = 1 − = 0.0714
0 −0.6(1)2 + 1.2(1) + 0.8
𝑥1 − 𝑥0 0.0714 − 1
|∈1𝑎 | = | |=| | = |−0.9286⁄0.0714| = 13
𝑥1 0.0714
Second iteration, solving for the root 𝑥2 and absolute relative approximate error |∈2𝑎 |:
𝑓(𝑥1 )
𝑥2 = 𝑥1 − ⁄𝑓 ′ (𝑥 ) = 0.0714 − 0.1601⁄0.8826 = −0.11
1
𝑥2 − 𝑥1 −0.11 − 0.0714
|∈2𝑎 | = | |=| | = |−0.1814⁄−0.11| = 1.649
𝑥2 −0.11
Worksheet II Prepared by Eyob S. Date: January 3, 2026
Third iteration, solving for the root 𝑥3 and absolute relative approximate error |∈3𝑎 |:
𝑓(𝑥2 )
𝑥3 = 𝑥2 − ⁄𝑓 ′ (𝑥 ) = −0.11 − 0.0195⁄0.6607 = −0.1395
2
𝑥3 − 𝑥2 −0.1395 − (−0.11)
|∈3𝑎 | = | |=| | = |−0.0295⁄−0.1395| = 0.2115
𝑥3 −0.1395
Fourth iteration, solving for the root 𝑥4 and absolute relative approximate error |∈4𝑎 |:
𝑓(𝑥3 )
𝑥4 = 𝑥3 − ⁄𝑓 ′ (𝑥 ) = −0.1395 − 0.0006⁄0.6209 = −0.1405
3
𝑥4 − 𝑥3 −0.1405 − (−0.1395)
|∈4𝑎 | = | |=| | = |−0.001⁄−0.1405| = 0.0071
𝑥4 −0.1405
Here it is |∈𝟒𝒂 | ≤ |∈𝒔 | = 𝟎. 𝟎𝟏 therefore, the root is: 𝒙 = −𝟎. 𝟏𝟒𝟎𝟓
Q.3. Solution:
The matrix of weights is given as:
1 1 −1
𝐴 = [2 6 2]
4 −3 1
1 1 −1 1 0 0
The Doolittle’s LU decomposition is: 𝑈 = [0 4 4] 𝐿 = [2 1 0]
0 0 12 4 −1.75 1
Forward substitution using the lower triangular and the bias vector in the R.H.S.
𝐿𝐷 = 𝐵
1 0 0 −3
The augmented matrix of 𝐿 and 𝐵 is: (𝐿|𝐵) = (2 1 0| 2 )
4 −1.75 1 1
𝒅𝟏 = −𝟑
2𝑑1 + 𝑑2 = 2 ⇒ 2(−3) + 𝑑2 = 2
Worksheet II Prepared by Eyob S. Date: January 3, 2026
⇒ 𝒅𝟐 = 𝟖
4𝑑1 − 1.75𝑑2 + 𝑑3 = 1 ⇒ 2(−3) + 𝑑3 = 1 − 4(−3) + 1.75(8)
⇒ 𝒅𝟑 = 𝟐𝟕
Backward substitution using the upper triangular 𝑈 and the vector 𝐷.
𝑈𝑋 = 𝐷
The augmented matrix of 𝑈 and 𝐷 is:
1 1 −1 −3
(𝑈|𝐷) = (0 4 4 | 8 )
0 0 1 27
𝒙𝟑 = 𝟐𝟕
4𝑥2 + 4𝑥3 = 8 ⇒ 4𝑥2 + 4(27) = 8
⇒ 𝒙𝟐 = −𝟐𝟓
𝑥1 + 𝑥2 − 𝑥3 = −3 ⇒ 𝑥1 = −3 − (−25) + 27
⇒ 𝒙𝟏 = 𝟒𝟗
Worksheet II Prepared by Eyob S. Date: January 3, 2026
4.A. Solution: The numerical method used to determine the correct 𝒇(𝒙)value after "looking up" an
intermediate value from the table of 𝒙 and 𝒇(𝒙) is called interpolation. To help a machine attain greater
accuracy in interpolation, here are some key strategies: increasing data density, improving data quality,
and choosing the right interpolation method. More Data Points and Their Even Distribution: The more
data points you have on your look-up table, the more accurately the machine can capture the underlying
function's behavior. It might also be done by ensuring data points are evenly distributed across the range
of interest or by avoiding clustering in some areas while neglecting others. Correct Measurements and
Data Cleaning: Minimize errors in the measured values of both 𝑥 and 𝑓(𝑥). Identify and eliminate
inconsistent data points that significantly impact the accuracy. Method Selection: Select an interpolation
method appropriate for the characteristics of the data and the desired level of accuracy. For more complex
functions, higher-order polynomials or more sophisticated methods may be necessary.
4.B. Newton's divided difference polynomial interpolating table is developed as:
𝒊 𝒕𝒊 𝑻[𝒕𝒊 ] 𝑻[𝒕𝒊 , 𝒕𝒊−𝟏 ] 𝑻[𝒕𝒊 , 𝒕𝒊−𝟏 , 𝒕𝒊−𝟐 ] 𝑻[𝒕𝒊 , 𝒕𝒊−𝟏 , 𝒕𝒊−𝟐 , 𝒕𝒊−𝟑 ]
𝟎 1 𝟏𝟒. 𝟔
𝟏𝟔. 𝟖 − 𝟏𝟒. 𝟔
= 𝟐. 𝟐
𝟐−𝟏
𝟏 2 16.8 𝟐. 𝟐 − 𝟐. 𝟐
=𝟎
𝟒−𝟏
21.2 − 16.8 −𝟏 − 𝟎
= 2.2 = −𝟎. 𝟐
4−2 𝟔−𝟏
𝟐 4 21.2 −1.8 − 2.2
= −1
6−2
17.6 − 21.2
= −1.8
6−4
3 6 17.6
The third-order (cubic) Newton’s divided difference interpolation equation is obtained as:
𝑇(𝑡) = 𝑇[𝑡0 ] + (𝑡 − 𝑡0 ) × 𝑇[𝒕0 , 𝒕𝟏 ] + (𝑡 − 𝑡0 )(𝑡 − 𝑡1 ) × 𝑇[𝒕0 , 𝒕𝟏 , 𝒕𝟐 ]
+ (𝑡 − 𝑡0 )(𝑡 − 𝑡1 )(𝑡 − 𝑡2 ) × 𝑇[𝒕0 , 𝒕𝟏 , 𝒕𝟐 , 𝒕𝟑 ]
= 14.6 + (𝑡 − 1) × 2.2 + (𝑡 − 1)(𝑡 − 2) × 0 + (𝑡 − 1)(𝑡 − 2)(𝑡 − 4) × −0.2
= 14.6 + (2.2𝑡 − 2.2) + (𝑡 3 − 7𝑡 2 + 14𝑡 − 8) × −0.2
∴ 𝑇(𝑡) = −0.2𝑡 3 + 1.4𝑡 2 − 0.6𝑡 + 14
Now, substitute 𝑡 = 3 in the above third order (cubic), Newton’s divided diff. equation:
𝑇(3) = −0.2(3)3 + 1.4(3)2 − 0.6(3) + 14 = 𝟏𝟗. 𝟒
Worksheet II Prepared by Eyob S. Date: January 3, 2026
4.C. MATLAB script for the third-order Lagrange interpolation at 𝒕 = 𝟓 can be written as
follows:
% Third Order Lagrange Interpolation
% Define the data points
t = [2, 3, 4, 6];
T = [14.6, 19.4, 21.2, 17.6];
% Point at which to interpolate
t_interp = 5;
% Initialize the interpolated value
T_interp = 0;
% Calculate the Lagrange basis polynomials
for i = 1:4
L = 1;
for j = 1:4
if j ~= i
L = L * (t_interp - t(j)) / (t(i) - t(j));
end
end
T_interp = T_interp + T(i) * L;
end
% Display the interpolated value
disp(['Interpolated value at t = ', num2str(t_interp), ' is ', num2str(T_interp)]);
% Optional: Plot the data points and the interpolated value
plot(t, T, 'o', 'MarkerSize', 8);
hold on;
plot(t_interp, T_interp, 'r*', 'MarkerSize', 12);
xlabel('t');
ylabel('T');
title('Third Order Lagrange Interpolation');
legend('Data Points', 'Interpolated Point');
grid on;
Worksheet II Prepared by Eyob S. Date: January 3, 2026
4.D. The third-order Lagrange interpolation is: 𝑇(𝑡) = 𝐿0 𝑇(𝑡0 ) + 𝐿1 𝑇(𝑡1 ) + 𝐿2 𝑇(𝑡2 ) + 𝐿3 𝑇(𝑡3 )
𝑡−𝑡1 𝑡 − 𝑡2 𝑡 − 𝑡3 (𝑡 − 2)(𝑡 − 4)(𝑡 − 6) 𝑡 3 − 12𝑡 2 + 44𝑡 − 48
𝐿0 = ( )( )( )= =
𝑡0 −𝑡1 𝑡0 − 𝑡2 𝑡0 − 𝑡3 (1 − 2)(1 − 4)(1 − 6) −15
𝑡−𝑡0 𝑡 − 𝑡2 𝑡 − 𝑡3 (𝑡 − 1)(𝑡 − 4)(𝑡 − 6) 𝑡 3 − 11𝑡 2 + 34𝑡 − 24
𝐿1 = ( )( )( )= =
𝑡1 −𝑡0 𝑡1 − 𝑡2 𝑡1 − 𝑡3 (2 − 1)(2 − 4)(2 − 6) 8
𝑡−𝑡0 𝑡 − 𝑡1 𝑡 − 𝑡3 (𝑡 − 1)(𝑡 − 2)(𝑡 − 6) 𝑡 3 − 9𝑡 2 + 20𝑡 − 12
𝐿2 = ( )( )( )= =
𝑡2 −𝑡0 𝑡2 − 𝑡1 𝑡2 − 𝑡3 (4 − 1)(4 − 2)(4 − 6) −12
𝑡−𝑡0 𝑡 − 𝑡1 𝑡 − 𝑡2 (𝑡 − 1)(𝑡 − 2)(𝑡 − 4) 𝑡 3 − 7𝑡 2 + 14𝑡 − 8
𝐿3 = ( )( )( )= =
𝑡3 −𝑡0 𝑡3 − 𝑡1 𝑡3 − 𝑡2 (6 − 1)(6 − 2)(6 − 4) 40
∴ 𝑇(𝑡) = 𝐿0 𝑇(𝑡0 ) + 𝐿1 𝑇(𝑡1 ) + 𝐿2 𝑇(𝑡2 ) + 𝐿3 𝑇(𝑡3 )
= (𝑡 3 − 12𝑡 2 + 44𝑡 − 48)(−0.9733) + (𝑡 3 − 11𝑡 2 + 34𝑡 − 24)(2.1)
+ (𝑡 3 − 9𝑡 2 + 20𝑡 − 12)(−1.7667) + (𝑡 3 − 7𝑡 2 + 14𝑡 − 8)(0.44)
= −0.2𝑡 3 + 1.4𝑡 2 − 0.6𝑡 + 14
∴ 𝑇(𝑡) = −0.2𝑡 3 + 1.4𝑡 2 − 0.6𝑡 + 14 Now, substitute 𝑡 = 5 in the above third-order
(cubic) equation: 𝑇(5) = −0.2(5)3 + 1.4(5)2 − 0.6(5) + 14 = 𝟐𝟏
4.E. All data points are listed as follows
i 0 1 2 3 4 5 6
ti 0 1 2 3 4 5 6
T(t) 14 14.6 16.8 19.4 21.2 21 17.6
Central difference is calculated as follows:
𝒕 0 1 2 3 4 5 6
𝑻(𝒕𝒊+𝟏 ) − 𝑻(𝒕𝒊−𝟏 )
𝑻′(𝒕) = - 1.4 2.4 2.2 0.8 -1.8 -
𝟐(𝒉)
5.A. Forward difference of 𝒇(𝒙) = 𝟐𝒙𝟐 − 𝐬𝐢𝐧(𝒙) for 𝒉 = 𝟎. 𝟐 can be calculated as follows:
𝑓(𝑥𝑖+1 ) − 𝑓(𝑥)
𝑓′(𝑥) =
ℎ
Worksheet II Prepared by Eyob S. Date: January 3, 2026
𝒙 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
𝒇′(𝒙) -4.2 -3.56 -2.87 -2.15 -1.39 -0.59 0.25 1.12 2.04 2.98 --
5.B. MATLAB script for backward difference of 2𝑥 2 − sin(𝑥) = 0 for 𝑥 = [−1, 1] and ℎ = 0.2
can be:
% Define the current waveform function
f = @(x) 2*x^2-sin(x)
% Define the change in x
h = 0.2;
% Number of data points defined
x = -1:x:1;
% Exact derivative
df = @(x) 4*x – cos(x);
% define f in terms of y
y = f(x);
% Calculate the backward diff.
bdf = (y(2:end) - y(1:end-1)) / h;
back_df = [NaN, bdf];
% plot their graphs
plot(x, back_df, ‘g--', x, df(x), ‘r');
legend(‘approx deriv’, ‘exact deriv’);
6.A. To apply Simpson's 1/3 rule, first let’s divide the interval 𝑡 = [0, 2𝜋] into 𝑛 = 8 equal
2𝜋−0
subintervals, each of width ℎ = ⇒ 𝒉 = 𝝅⁄𝟒
𝑛
The Simpson's 1/3 rule is given by:
𝑏
∫ 𝑓(𝑥)𝑑𝑥 = (ℎ⁄3) × [𝑓(𝑥0 ) + 4𝑓(𝑥1 ) + 2𝑓(𝑥2 ) + ⋯ + 2𝑓(𝑥𝑛−2 ) + 4𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]
𝑎
𝑛−1 𝑛−2
= (ℎ⁄3) × [𝑓(𝑥0 ) + 4 ∑ 𝑓(𝑥𝑖 ) + 2 ∑ 𝑓(𝑥𝑖 ) + 𝑓(𝑥𝑛 )]
𝑖=1 𝑖=2
Worksheet II Prepared by Eyob S. Date: January 3, 2026
Applying this to the 𝑰(𝒕) in calculation results in:
2𝜋 𝑛−1 𝑛−2
∫ 𝐼(𝑡)𝑑𝑡 ≈ (ℎ⁄3) × [𝐼(𝑡0 ) + 4 ∑ 𝐼(𝑡𝑖 ) + 2 ∑ 𝐼(𝑡𝑖 ) + 𝐼(𝑡𝑛 )]
0 𝑖=1 𝑖=2
𝜋 𝜋 3𝜋 5𝜋 3𝜋
= (𝜋⁄4 × 3) × [𝐼(0) + 4𝐼 ( ) + 2𝐼 ( ) + 4𝐼 ( ) + 2𝐼(𝜋) + 4𝐼 ( ) + 2𝐼 ( )
4 2 4 4 2
7𝜋
+ 4𝐼 ( ) + 𝐼(2𝜋)]
4
=( 0.7854⁄3)(1 + 4(0.7071) + 2(−2) + 4(0.7071) + 2(1) + 4(−0.7071)
+ 2(0) + 4(−0.7071) + 1)
= (0.2618)(0) = 0
The solution by Simpson's 1/3 Rule is 0.
6.B. Applying Trapezoidal Rule for 𝑰(𝒕) = 𝒔𝒊𝒏(𝟑𝒕) + 𝒄𝒐𝒔(𝟏𝟎𝒕) on 𝑡 = [0, 2𝜋] and 𝑛 = 8
𝑏 ℎ
∫ 𝑓(𝑥)𝑑𝑥 ≅ ( ) × [𝑓(𝑥0 ) + 2𝑓(𝑥1 ) + 2𝑓(𝑥2 ) + ⋯ + 2𝑓(𝑥𝑛−2 ) + 2𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]
𝑎
2
𝑛−1
= (ℎ⁄2) × [𝑓(𝑥0 ) + 2 ∑ 𝑓(𝑥𝑖 ) + 𝑓(𝑥𝑛 )]
𝑖=1
Applying this to the 𝑰(𝒕) = 𝐬𝐢𝐧(𝟑𝒕) + 𝐜𝐨𝐬(𝟏𝟎𝒕) in calculation results in:
2𝜋 𝑛−1
∫ 𝐼(𝑡)𝑑𝑡 ≈ (ℎ⁄2) × [𝐼(𝑡0 ) + 2 × ∑ 𝐼(𝑡𝑖 ) + 𝐼(𝑡𝑛 )]
0 𝑖=1
𝜋 𝜋 3𝜋 5𝜋 3𝜋
= (𝜋⁄4 × 2) × [𝐼(0) + 2𝐼 ( ) + 2𝐼 ( ) + 2𝐼 ( ) + 2𝐼(𝜋) + 2𝐼 ( ) + 2𝐼 ( )
4 2 4 4 2
7𝜋
+ 2𝐼 ( ) + 𝐼(2𝜋)]
4
=( 0.7854⁄2)(1 + 2(0.7071) + 2(−2) + 2(0.7071) + 2(1) + 2(−0.7071)
+ 2(0) + 2(−0.7071) + 1)
= (0.3927)(0) = 𝟎
The solution by the Trapezoidal Rule is 0.
The true integration becomes:
3𝑡 2
sin(10𝑡) 2 cos [( ⁄2) ]
∫ 𝐼(𝑡) 𝑑𝑡 = ∫ sin(3𝑡) + cos(10𝑡) 𝑑𝑡 = +
10 3
2𝜋
3𝑡 2
2𝜋
sin(10𝑡) 2 cos [( ⁄2) ]
∫ 𝐼(𝑡) 𝑑𝑡 = + | =0
0 10 3
0
Therefore, the true error for both the Trapezoidal and Simpson’s 1/3 rule is 0.
Worksheet II Prepared by Eyob S. Date: January 3, 2026
REFERENCE:
1. CHAPRA S. C., Canale R. P., Numerical Methods for Engineers, McGraw-Hill
Education, 7th Ed. 2016 (ISBN-13: 978-9352602131).
Mid-term examination:
Q.1) Page 55-108, Chapter 3&4, Section 3.1, 3.2, 3.3, 3.4, 4.3, 4.4
Q.2) Page 123-173, Chapter 5&6, Section 5.1, 6.1, 6.2
Q.3) Page 245-300, Chapter 9&10, Section 9.2, 10.1
Final examination:
Q.1) Page 491-650, Chapter 18-21, Section 18.1, 20.1, 21.2
Q.2) Page 700, Chapter 24, Section 24.3
Q.3) Page 562, Chapter 19, Section 19.8