Numerical Methods Homework 2 3
Numerical Methods Homework 2 3
&3
December 2023
x f (x) f ′ (x)
2.1 -1.709845
2.2 -1.373823
2.3 -1.119214
2.4 -0.9160143
2.5 -0.7470223
2.6 -0.6015966
2. Perform the integration of the function f (x) = e2x sin(x + 1) + x21+1 over
the interval [0, 2], utilizing a step size of h = 0.2. Apply the following
numerical methods for this computation:
a) Composite Trapezoidal Rule;
b) Composite Simpson’s Rule; and
c) Composite Midpoint Rule.
3. Employ the Romberg integration method to calculate R3,3 and R4,4 values
for the integral of the function f (x) = x sin2 (x) − 2x sin(x) + 1 over the
interval [1, 4].
1
Perform the calculations with step sizes h = 0.2, h = 0.1, and h = 0.05.
Subsequently, compare the resulting approximate values with the actual
solution y(t) = − 1t , analyzing the actual errors.
2. Address the initial-value problem presented in Ex. 1 by employing Taylor’s
method of both second and fourth order, utilizing a step size of h =
0.1. After computing the solution, compare it with the exact solution by
determining the actual errors.
3. Apply the second-order and fourth-order Runge-Kutta methods to solve
the initial-value problem y ′ = −5y + 5t2 + 2t in the interval 0 ≤ t ≤ 1,
given the initial condition y(0) = 31 and a step size of h = 0.1. Then,
compare the obtained solutions with the actual solution y(t) = t2 + 31 e−5t
to evaluate their accuracy.
x1 + x2 + x4 = 2,
2x1 + x2 − x3 + x4 = 1,
− x1 + 2x2 + 3x3 − x4 = 4,
3x1 − x2 − x3 + 2x4 = −3.
(b)
2
4 Iterative Techniques in Matrix Algebra
1. Determine the eigenvalues and their corresponding eigenvectors for the
matrices listed below:
−1 −1
(a)
1/3 1/6
3 2 −1
(b) 1 −2 3
2 0 4
2. Perform the first 10 iterations using the Jacobi method, starting with
x(0) = 0, to approximate the solution of the linear system. Subsequently,
estimate the infinity norm ||x10 − x9 ||∞ .
x1 + 2x2 − 2x3 = 7,
x1 + x2 + x3 = 2,
2x1 + 2x2 + x3 = 5,
2x1 − x2 + x3 = −1,
2x1 + 2x2 + 2x3 = 4,
− x1 − x2 + 2x3 = −5,