Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr.

Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-01
UNIT-I: Rate of Convergence, Order of Convergence
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649

Books- Essential Readings:

is
Book: A Friendly Introduction to Numerical Analysis by Brain Bradie
n+3 2n +3
jM
1. Compare the rates of convergence of two sequences n+7
and 2n +7
.

2. Compute each of the following limits and determine the corresponding rate of con-
vergence.
sin n
(a) limn→∞ n
.
ka

(b) limn→∞ nn−1


3 +2 .
√ √
(c) limn→∞ ( n + 1 − n).
3n2 −1
(d) limn→∞ .
n

7n2 +n+2

3. Show that the convergence of the sequence generated by the formula


Pa

 
1 a
xn+1 = xn +
2 xn

toward a is of second order. What is asymptotic error constant?
r.

4. Show that the convergence of the sequence generated by the formula

x3n + 3xn a
D

xn+1 =
3x2n + a

toward a is of third order. What is asymptotic error constant?

5. Let a be a non zero real number. For any x0 satisfying 0 < x0 < 2/a, the recursive
sequence defined by

xn+1 = xn (2 − axn )

converges to 1/a. What are the order of convergence and the asymptotic error con-
stant?

Page No. 1
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra


6. Theory indicates that the following sequence should converge to 3 of order 1.618.
Does the sequence actually achieve an order of convergence of 1.618 ? If not, what
is actual order?
n pn
0 2.000000000000000
1 1.666666666666667
2 1.727272727272727
3 1.732142857142857
4 1.732050680431722
5 1.732050807565499

a
hr
*** The End ***

is
jM
n ka
Pa
r.
D

Page No. 2
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-02
UNIT-I: Root Finding Method– BISECTION METHOD
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649

Books- Essential Readings:

is
Book: A Friendly Introduction to Numerical Analysis by Brian Bradie
jM
1. By using Bisection, approximate the root of the fallowing problem with given toler-
ance 0.0005

(a) f (x) = x3 + x2 − 3x − 3, in (1, 2)


−x
(b) f (x) = e − x, in (0, 1).
ka

2. By construction, the endpoints of the enclosing intervals produced by the Bisection


Method satisfy a1 ≤ a2 ≤ a3 · · · ≤ b1 ≤ b2 ≤ b1 . Prove that the sequence {an } and {bn }
converge and that
n

lim an = lim bn = lim pn = p.


n→∞ n→∞ n→∞
Pa

3. Approximate 1/37 to five decimal places by applying the bisection method to the
equation 1/x − 37 = 0.

4. Approximate (13)1/3 to three decimal places by applying the bisection method to the
equation x3 − 13 = 0.
r.
D

*** The End ***

Page No. 3
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-03
UNIT-I: Root Finding Method-Method of False Position
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649

Book: A Friendly Introduction to Numerical Analysis by Brian Bradie

is
Formula for Method of False Position: pn = bn − f (bn ) f (bbnn)−f
jM −an
(an )

1. Using Method of False Position, find approximate root p3

(a) x3 + x2 − 3x − 3 = 0 in (1, 2)
(b) x7 = 3 in (2, 3)
ka

(c) cos x − x = 0
(d) e−x − x = 0

2. The function x3 + 2x2 − 3x − 1 has a simple zero on the interval (−1, 0). Find the
n

approximate roots by performing 3 iterations of Regula False Method.

3. Verify that the equation x4 −18x2 +45 = 0 has a root on the interval (1, 2). Next Perform
Pa

three iterations
√ of the method of False Position. Given that the exact value of the
root is x = 3, compute the absolute error in three error in three approximations
just obtained. What is apparent order of convergence?

4. Verify that the equation x4 −18x2 +45 = 0 has a root on the interval (3, 4). Next Perform
r.

three iterations
√ of the method of False Position. Given that the exact value of the
root is x = 15, compute the absolute error in three error in three approximations
just obtained. What is apparent order of convergence?
D

*** The End ***

Page No. 4
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-04
Root Finding Methods: FIXED POINT ITERATION
METHOD
Dr. Pankaj Mishra

a
Department of Mathematics
Deshbandhu College (University of Delhi)

hr
E-Mail: pmishra@db.du.ac.in
Cell: 9473937649

is
Book: A Friendly Introduction to Numerical Analysis by Brian Bradie
1. Suppose the sequence pn is generated by the fixed point iteration scheme pn = g(pn )
jM
is generated by the fixed point iteration scheme pn = g(pn−1 ). Further, suppose that
the sequence converges linearly to the fixed point p.
(a) Show that
pn − pn−1
g ′ (p) = .
ka

pn−1 − pn−2

(b) Show that


g ′ (p)
n

|en | ≈ ′ |pn − pn−1 |.


g (p) − 1

Pa

2. Verify that x = a is a fixed point of the function


1 a
g(x) = x+ .
2 x
Use the techniques of this section to determine the order of convergence
√ and the
r.

asymptotic error constant of the sequence p − n = g(pn−1 ) toward a.



3. Verify that x = a is a fixed point of the function
D

x3 + 3xa
g(x) = .
3x2 + a
Use the techniques of this section to determine the order of convergence
√ and the
asymptotic error constant of the sequence p − n = g(pn−1 ) toward a.

4. Verify that x = a is a fixed point of the function

g(x) = x(2 − ax).

Use the techniques of this section to determine the order of convergence


√ and the
asymptotic error constant of the sequence p − n = g(pn−1 ) toward a.

Page No. 5
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

5. Consider the function f (x) = 2x(1 − x), which has fixed point at x = 0 and at x = 1/2.

(a) Why should we expect that fixed point iteration, starting even with a value very
close to zero, will fail to converge towards x = 0.
(b) Why should we expect that fixed point iteration, starting with p0 ∈ (0, 1) will
converge toward x = 1/2? What order of convergence should we expect?
(c) Perform seven iterations starting from an arbitrary point p0 ∈ (0, 1) and numer-
ically confirm the order of convergence.

a
*** The End ***

hr
is
jM
n ka
Pa
r.
D

Page No. 6
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-05
Root Finding Methods: NEWTON’S METHOD
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)

hr
E-Mail: pmishra@db.du.ac.in
Cell: 9473937649

Book: A Friendly Introduction to Numerical Analysis by Brian Bradie

is
2
1. Show that when Newton’s method is
1 a
 applied to the equation x − a = 0, the resulting
iteration function is g(x) = 2 x + x .
jM
1
2. Show that when Newton’s method is applied to the equation x
− a = 0, the resulting
iteration function is g(x) = 2 (2 − ax).

3. The equation x3 + x2 − 3x − 3 = 0 has a root on the interval (1, 2), namely 3. Find
ka

the approximate root using Newton method up to 4 iteration.

4. Each of the following has a root on the interval (0, 1). Perform Newton’s method to
determine p4 , the fourth approximation to the location of the root.
n

(a) ln(1 + x) − cos x = 0


(b) x5 + 2x − 1 = 0.
Pa

*** The End ***


r.
D

Page No. 7
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-06
Root Finding Methods: SECANT METHOD
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649

Book: A Friendly Introduction to Numerical Analysis by Brian Bradie

is
1. Derive the following error equation for Secant method
jM f ”(p)
pn+1 ≈ (pn − p)(pn−1 − p) .
2f ′ (p) + f ”(p)(pn + pn−1 − 2p)

Hence, derive the order of convergence α for secant method.



2. The equation x3 + x2 − 3x − 3 = 0 has a root on the interval (1, 2), namely 3. Find
ka

the approximate root using Secant method up to 4 iteration.

3. Each of the following has a root on the interval (0, 1). Perform Secant’s method to
determine p4 , the fourth approximation to the location of the root.
n

(a) ln(1 + x) − cos x = 0


Pa

(b) x5 + 2x − 1 = 0.

4. Apply the Secant method to the function f (x) = x3 − 2x − 5 = 0 using the indicated
values for p0 and p1 . Iterate until |pn − pn−1 | < 5 × 10−7 .

(a) p0 = 1, p1 = 3
r.

(b) p0 = 3, p1 = 2.
D

*** The End ***

Page No. 8
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-07
UNIT-II: Jacobi Method & Gauss Seidel Method
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649
1. For each of the following coefficient matrices and right hand side vectors, write out
the components of the Jacobi & Gauss Seidel methods iteration equation. Then,

is
starting with initial vector x(0) = 0, perform three iterations of the Jacobi method &
Gauss Seidel method. jM
   
2 −1 0 −1
(a) −1 4 2,  3 
0 2 6 5
   
4 2 −1 1
(b)  2 4 1 , −1
 
ka

−1 1 4 1
   
3 −1 1 4
(c)  2 −6 3 , −13
−9 7 −20 7
n

2. Let
Pa

 
2 3 4
A =  3 3 3 .
10 10 5
(a) Write out iteration matrix Tjac corresponding to the matrix A, and determine
ρ(Tjac ).
r.

(b) Write out iteration matrix Tgs corresponding to the matrix A, and determine
ρ(Tjac ).
D

(c) Will Jacobi and Gauss Seidel methods converge for any choice of initial vector
x(0) .
(d) Special Problem Consider the iteration scheme x(k+1) = T x(k) + c. and suppose
that ||T || < 1 for some natural matrix norm. Show that for any x(0) ∈ Rn
||T ||k
||x − x(k) || ≤ ||x(1) − x(0) ||.
1 − ||T ||

*** The End ***


Page No. 9
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-08
UNIT-II: LU Decomposition
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649

1. Let

is
 
1 2
A=
3 4
Verify that each of the following pairs forms an LU
 decomposition of A, and then
jM 4
use the decomposition to solve the system Ax = .
6
   
1 0 1 2
(a) L1 = , U1 =
3 1 0 −2
ka

   
1 0 1 2
(b) L2 = , U2 =
3 −2 0 1
   
−1 0 −1 −2
n

(c) L3 = , U3 =
−3 −2 0 1
Pa

2. Let  
2 7 5
A = 6 20 10
4 3 0.
Verify that each of the following pairs forms an LU decomposition of A, and then
0
r.

use the decomposition to solve the system Ax = 4.



1
D

   
1 0 0 2 7 5
(a) L1 = 3 1 0, U1 = 0 −1 −5.
2 11 1 0 0 45
   
1 0 0 2 7 5
(b) L2 = 3 −1 0 , U2 = 0 1 5.
2 −11 45 0 0 1
   
2 0 0 1 7/2 5/2
(c) L3 = 6 −1 0 , U3 = 0 1 5 .
4 −11 45 0 0 1

Page No. 10
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

3. Determine LU decomposition of given matrix, and then solve the system Ax = b for
right hand side vector.
   
2 7 5 0
(a) A = 6 20 10
  b = 4

4 3 0 1
   
1 1 2 3
(b) A = −1 0 2  b = −1
3 2 −1 4
   
1 4 5 −15
(c) A =  2 6 4  b = −14

a
−1 −2 −3 −7
   
1 4 3 −4

hr
(d) A = 2 7 9
  b = −10

5 8 −2 9

4. (a) Show that the matrix

is
 
0 1
A=
jM 1 1
has no LU decomposition.
(b) Reverse the order of the rows of A and show that the resulting matrix does have
an LU decomposition.

5. (a) Show that the matrix


ka

 
0 0 1
A = 0 1 1
1 0 1
has no LU decomposition.
n

(b) Reverse the order of the rows of A and show that the resulting matrix does have
an LU decomposition.
Pa

*** The End ***


r.
D

Page No. 11
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-09
UNIT-II: Lagrange Interpolation
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649
1. Let x0 = −1, x1 = 1 and x2 = 2.

is
(a) Determine the formulas for the Lagrange polynomials L2,0 , L2,1 , and L2,2 asso-
ciated with the given interpolating points.
(b) Plot L2,0 , L2,1 , and L2,2 on the same set of axes over the range [−1, 2].
jM
2. Construct the Lagrange interpolating polynomials for following data sets
x 0 1 2
(a)
y 2 −1 4.
ka

x −1 0 1 2
(b)
y 3 −1 −3 1
x −7 −5 −4 −1
(c)
y 10 5 2 10
n

x 2 4 5
(d)
y −1 4 8
Pa

x −1 0 1 2
3. Consider the data set
y 7 5 1 11.
(a) Show that the polynomials f (x) = x3 +2x2 −3x+1 and g(x) = 81 x4 + 34 x3 + 15
8
x2 − 11
4
x+1
both interpolate all of data.
r.

(b) Why does this contradict the uniqueness part of the theorem on existence and
uniqueness of polynomial interpolation.
D

4. Suppose that f is continuous and has continuous first and second derivatives on
the interval [x0 , x1 ]. Derive the following bound on the error due to linear interpola-
tion.
1
|f (x) − P1 (x)| ≤ h2 max , where, h = x1 − x0 .
8 x∈[x0 ,x1 ]|f ”(x)|

*** The End ***


Page No. 12
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-10
UNIT-II: Newton Divided Difference Interpolation
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649

1. Construct the Newton divided difference table for following data sets, and write out

is
the Newton form of the interpolating polynomial.

x 0 1 2
(a)
y 2 −1 4.
jM
x −1 0 1 2
(b)
y 3 −1 −3 1
x −7 −5 −4 −1
ka

(c)
y 10 5 2 10
x 2 4 5
(d)
y −1 4 8
n

x −1 0 1 2
(e)
y 7 5 1 11.
Pa

2. Determine the missing values in the divided difference table provided below.

x0 = 0 f [x0 ] = 1
f [x0 , x1 ] = 2
x1 = 1 f [x1 ] = 3 f [x0 , x1 , x2 ] =?
r.

f [x1 , x2 ] =? f [x0 , x1 , x2 , x3 ] =?
x2 = 2 f [x2 ] = 3 f [x1 , x2 , x3 ] = 0
D

f [x2 , x3 ] = 0
x3 = 3 f [x3 ] =?

*** The End ***

Page No. 13
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-11
UNIT-II: PIECEWISE LINEAR INTERPOLATION
Dr. Pankaj Mishra
Department of Mathematics

a
Deshbandhu College (University of Delhi)
E-Mail: pmishra@db.du.ac.in

hr
Cell: 9473937649

1. Construct the PIECEWISE LINEAR INTERPOLANT for following data sets.

is
x 0 1 2
(a)
y 2 −1 4.
x −1 0 1 2
jM
(b)
y 3 −1 −3 1
x −7 −5 −4 −1
(c)
y 10 5 2 10
ka

x 2 4 5
(d)
y −1 4 8
x −1 0 1 2
n

(e)
y 7 5 1 11.
Pa

*** The End ***


r.
D

Page No. 14
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-12
UNIT-III: First and Higher Order Approximation of First
& Second Derivative
Dr. Pankaj Mishra

a
Department of Mathematics
Deshbandhu College (University of Delhi)

hr
E-Mail: pmishra@db.du.ac.in
Cell: 9473937649

is
1. Derive the second-order central difference approximation for the first derivative,
including error term: jM
′ f (x0 + h) − f (x0 − h) h2 ′′′
f (x0 ) = − f (ξ).
2h 6
2. (a) Derive the following difference approximation for the first derivative:
f (x0 + 2h) − f (x0 − h)
f ′ (x0 ) = .
ka

3h
(b) What is the error term associated with the formula?
(c) Numerically verify the order of approximation using f (x) = ln x and x0 = 2.
n

3. (a) Derive the following forward difference approximation for the second derivative:
Pa

f (x0 ) − 2f (x0 + h) + f (x0 + 2h)


f ′′ (x0 ) = .
h2
(b) What is the error term associated with the formula?
(c) Numerically verify the order of approximation using f (x) = ex and x0 = 0.
r.

4. (a) Derive the following backward difference approximation for the second deriva-
tive:
D

f (x0 − 2h) − 2f (x0 − h) + f (x0 )


f ′′ (x0 ) = .
h2
(b) What is the error term associated with the formula?
(c) Numerically verify the order of approximation using f (x) = ln x and x0 = 2.
5. Using f (x) = ex and x0 = 0, demonstrate numerically that the central difference
approximation for second derivative given by
f (x0 − h) − 2f (x0 ) + f (x0 + h)
f ′′ (x0 ) = .
h2
is second order accurate.

Page No. 15
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

6. (a) Use the formula


f (x0 + h) − f (x0 )
f ′ (x0 ) =
h
to approximate the derivative of f (x) = 1 + x + x3 at x0 , taking h = 1, 0.1, 0.01 and
0.001. What is the order of approximation?

*** The End ***

a
hr
is
jM
n ka
Pa
r.
D

Page No. 16
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-13
UNIT-III: Numerical Integration-Trapezoidal & Simpson’s
Rule
Dr. Pankaj Mishra

a
Department of Mathematics
Deshbandhu College (University of Delhi)

hr
E-Mail: pmishra@db.du.ac.in
Cell: 9473937649

is
1. Approximate the value of each of the following integrals using Trapezoidal rule,
Simpson’s rule. Verify theoretical error bound holds in each case.
jM
R2
(a) 1 x1 dx
R1
(b) 0 e−x dx
R1 1
(c) 0 1+x 2 dx
ka

R1
(d) 0 tan−1 x dx

2. (a) Determine values for coefficients A0 , A1 and A2 so that the quadrature formula
Z 1    
1 1
n

I(f ) = f (x) dx = A0 f − + A1 f (0) + A2


−1 2 2
Pa

has degree of precision at least 2.


(b) Once the values for the coefficients A0 , A1 and A2 have been computed, deter-
mine the overall degree of precision for the quadrature rule.

3. (a) Determine values for coefficients A0 , A1 and x1 so that the quadrature formula
r.

Z 1
I(f ) = f (x) dx = A0 f (−1) + A1 f (1)
D

−1

has degree of precision at least 2.


(b) Once the values for the coefficients A0 , A1 and x1 have been computed, deter-
mine the overall degree of precision for the quadrature rule.

*** The End ***

Page No. 17
Numerical Analysis Tutorial Sheet ©April 14, 2024, Dr. Pankaj Mishra

NUMERICAL ANALYSIS
BSc(H) Mathematics
Semester-IV (2023-24)

TUTORIAL-14
UNIT-III: Initial Value Problem-Euler’s Method, Modified
Euler Method & Runge Kutta Method (Fourth Order)
Dr. Pankaj Mishra

a
Department of Mathematics
Deshbandhu College (University of Delhi)

hr
E-Mail: pmishra@db.du.ac.in
Cell: 9473937649

is
1. Apply Euler’s method, Modified Euler’s Method, RK4 Method to approximate
the solution of the given initial value problem over the indicated interval in t using
the indicated number of time steps.
jM
dx
(a) dt
= tx3 − x (0 ≤ t ≤ 1), x(0) = 1, N = 4.
dx
(b) dt
+ 4t x = t4 (1 ≤ t ≤ 3), x(1) = 1, N = 5.
dx (1+x2 )
(c) = (1 ≤ t ≤ 4), x(1) = 0, N = 5.
ka

dt t
dx
(d) dt
= t2 − 2x2 − 1 (0 ≤ t ≤ 1), x(0) = 0, N = 4.

2. Apply Euler’s method, Modified Euler’s Method, RK4 Method to approximate


the solution of the given initial value problem over the indicated interval in t using
n

the indicated number of time steps. Compare the approximate solution with given
exact solution, and compare the actual error with theoretical error bound.
Pa

t √
(a) dx
dt
= ex , (0 ≤ t ≤ 2), x(0) = 1, N = 4, x(t) = 2et − 1.
(b) dx
dt
= t − x, (0 ≤ t ≤ 4), x(0) = 1, N = 4, x(t) = 2e−t + t − 1.
r.

*** The End ***


D

Page No. 18

You might also like