Engg. Math. II (Unit-IV) Numerical Analysis

Similar documents
Engineering Mathematics through Applications

Numerical Methods. King Saud University

Engg. Math. I. Unit-I. Differential Calculus

Chapter 1. Numerical Errors. Module No. 3. Operators in Numerical Analysis

FINITE DIFFERENCES. Lecture 1: (a) Operators (b) Forward Differences and their calculations. (c) Backward Differences and their calculations.

1. The accumulated net change function or area-so-far function

Subbalakshmi Lakshmipathy College of Science. Department of Mathematics

Find the slope of the curve at the given point P and an equation of the tangent line at P. 1) y = x2 + 11x - 15, P(1, -3)

MAC 2311 Calculus I Spring 2004

Calculus I Sample Exam #01

MATH 2053 Calculus I Review for the Final Exam

Review for the Final Exam

(0, 0), (1, ), (2, ), (3, ), (4, ), (5, ), (6, ).

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Name Class. (a) (b) (c) 4 t4 3 C

NUMERICAL METHODS. x n+1 = 2x n x 2 n. In particular: which of them gives faster convergence, and why? [Work to four decimal places.

UNIVERSITY OF HOUSTON HIGH SCHOOL MATHEMATICS CONTEST Spring 2018 Calculus Test

SOLUTIONS FOR PRACTICE FINAL EXAM

SOLUTION OF EQUATION AND EIGENVALUE PROBLEMS PART A( 2 MARKS)

JUST THE MATHS UNIT NUMBER DIFFERENTIATION APPLICATIONS 5 (Maclaurin s and Taylor s series) A.J.Hobson

3 Algebraic Methods. we can differentiate both sides implicitly to obtain a differential equation involving x and y:

Practice problems from old exams for math 132 William H. Meeks III

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004

Prelim 2 Math Please show your reasoning and all your work. This is a 90 minute exam. Calculators are not needed or permitted. Good luck!

Fall 2013 Hour Exam 2 11/08/13 Time Limit: 50 Minutes

November 20, Interpolation, Extrapolation & Polynomial Approximation

G H. Extended Unit Tests A L L. Higher Still Advanced Higher Mathematics. (more demanding tests covering all levels) Contents. 3 Extended Unit Tests

Newton's forward interpolation formula

Questions from Larson Chapter 4 Topics. 5. Evaluate

Mathematics 136 Calculus 2 Everything You Need Or Want To Know About Partial Fractions (and maybe more!) October 19 and 21, 2016

M.SC. PHYSICS - II YEAR

AP Calculus Chapter 3 Testbank (Mr. Surowski)

AP Calculus Testbank (Chapter 9) (Mr. Surowski)

Prelim 1 Solutions V2 Math 1120

Numerical Analysis Solution of Algebraic Equation (non-linear equation) 1- Trial and Error. 2- Fixed point

Antiderivatives and Indefinite Integrals

Virtual University of Pakistan

DRAFT - Math 102 Lecture Note - Dr. Said Algarni

MATH 31B: MIDTERM 2 REVIEW. sin 2 x = 1 cos(2x) dx = x 2 sin(2x) 4. + C = x 2. dx = x sin(2x) + C = x sin x cos x

Numerical and Statistical Methods

1.1 GRAPHS AND LINEAR FUNCTIONS

MTH Calculus with Analytic Geom I TEST 1

Solutions to Math 41 Final Exam December 10, 2012

Numerical and Statistical Methods

MATHEMATICAL METHODS INTERPOLATION

The Princeton Review AP Calculus BC Practice Test 2

Preliminary algebra. Polynomial equations. and three real roots altogether. Continue an investigation of its properties as follows.

Calculus II Practice Test Problems for Chapter 7 Page 1 of 6

MS 2001: Test 1 B Solutions

AB CALCULUS SEMESTER A REVIEW Show all work on separate paper. (b) lim. lim. (f) x a. for each of the following functions: (b) y = 3x 4 x + 2

x n cos 2x dx. dx = nx n 1 and v = 1 2 sin(2x). Andreas Fring (City University London) AS1051 Lecture Autumn / 36

MATH 100 and MATH 180 Learning Objectives Session 2010W Term 1 (Sep Dec 2010)

7.1. Calculus of inverse functions. Text Section 7.1 Exercise:

Taylor and Maclaurin Series

Math 152 Take Home Test 1

Review for Final. The final will be about 20% from chapter 2, 30% from chapter 3, and 50% from chapter 4. Below are the topics to study:

Then, Lagrange s interpolation formula is. 2. What is the Lagrange s interpolation formula to find, if three sets of values. are given.

Applied Numerical Analysis Homework #3

Math Final Exam Review

Integration by Parts

Chapter 8: Taylor s theorem and L Hospital s rule

Methods of Integration

COURSE Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method

1 Antiderivatives graphically and numerically

c) xy 3 = cos(7x +5y), y 0 = y3 + 7 sin(7x +5y) 3xy sin(7x +5y) d) xe y = sin(xy), y 0 = ey + y cos(xy) x(e y cos(xy)) e) y = x ln(3x + 5), y 0

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

Empirical Models Interpolation Polynomial Models

7.1 Indefinite Integrals Calculus

MATH 1241 Common Final Exam Fall 2010

Math 106: Review for Exam II - SOLUTIONS

8.7 MacLaurin Polynomials

COURSE Numerical integration of functions

APPLICATIONS OF DIFFERENTIATION

GENG2140, S2, 2012 Week 7: Curve fitting

Numerical Analysis & Computer Programming

Fall 2016 Math 2B Suggested Homework Problems Solutions

Previous Year Questions & Detailed Solutions

New Material Section 1: Functions and Geometry occurring in engineering

Math 106 Answers to Exam 3a Fall 2015

MA2501 Numerical Methods Spring 2015

Purdue University Study Guide for MA Credit Exam

1.4 Techniques of Integration

Practice Questions From Calculus II. 0. State the following calculus rules (these are many of the key rules from Test 1 topics).

Week 1: need to know. November 14, / 20

UNIT 3: DERIVATIVES STUDY GUIDE

Interpolation. P. Sam Johnson. January 30, P. Sam Johnson (NITK) Interpolation January 30, / 75

Mathematics 1052, Calculus II Exam 1, April 3rd, 2010

APPENDIX : PARTIAL FRACTIONS

Infinite series, improper integrals, and Taylor series

AP Calculus BC Chapter 4 AP Exam Problems. Answers

Solutions to Final Review Sheet. The Math 5a final exam will be Tuesday, May 1 from 9:15 am 12:15 p.m.

Goal: Approximate the area under a curve using the Rectangular Approximation Method (RAM) RECTANGULAR APPROXIMATION METHODS

3 Applications of partial differentiation

SOUTH AFRICAN TERTIARY MATHEMATICS OLYMPIAD

CALCULUS JIA-MING (FRANK) LIOU

AP Calculus AB: Semester Review Notes Information in the box are MASTERY CONCEPTS. Be prepared to apply these concepts on your midterm.

2.1 Quadratic Functions

MA 125 CALCULUS I FALL 2006 December 08, 2006 FINAL EXAM. Name (Print last name first):... Instructor:... Section:... PART I

Final Exam. Math 3 December 7, 2010

i x i y i

Transcription:

Dr. Satish Shukla of 33 Engg. Math. II (Unit-IV) Numerical Analysis Syllabus. Interpolation and Curve Fitting: Introduction to Interpolation; Calculus of Finite Differences; Finite Difference and Divided Difference Tables; Newton- Gregory Polynomial Form; Lagrange Polynomial Interpolation; Theoretical Errors in Interpolation; Spline Interpolation; Approximation by Least Square Method. Numerical Differentiation and Integration: Discrete Approximation of Derivatives: Forward, Backward and Central Finite Difference Forms, Numerical Integration, Simple NewtonCotes Rules: Trapezoidal and Simpson s (/3) Rules; Weddle s Rule, Gaussian Quadrature Rules: Gauss-Legendre, Gauss-Laguerre, GaussHermite, Gauss-Chebychev. Finite Differences. In theoretical science most of the functions and relations are in explicit and continuous form. Practical problems leads us to situations when the value of function y = f(x) is known not in form of an explicit formula, but value of y are known only at some points. In such cases we cannot calculate the value of y at any arbitrary given point. Similarly, in such cases it is not possible to find derivatives or integral of the function, and so, it is difficult to analyze the behaviour of function in its domain. To overcome this problem, we need the techniques of finite differences and approximation. Let y = f(x) be any function of the independent variable x. Suppose the explicit values of y in form of x is not known, but only a finite number of values of y at points x, x, x..., x n are known and given by the following table: x x x x x n y y y y y n where y i = f(x i ), i =,,,..., n. Then, the values of x, i.e., x, x, x,..., x n are called the argument of function and the corresponding values y, y, y,..., y n of y are called the entries. We assume that the arguments are equally spaced with space h, i.e., x = x + h, x = x + h..., x n = x n + h. In general, x i = x i + h = x + ih, i =,,..., n. The forward difference operator. It is denoted by and defined by f(x) = f(x + h) f(x). By definition of, it is clear that the forward difference operator finds the difference of the values of function y = f(x) on two consecutive values x + h and x of argument. Also: y = f(x ) = f(x + h) f(x ) = f(x ) f(x ) = y y. Similarly, y = y y,..., y n = y n y n. The higher order differences are defined as follows: f(x) = ( f(x)) = [f(x + h) f(x)] = f(x + h) f(x) = f(x + h) f(x + h) [f(x + h) f(x)] = f(x + h) f(x + h) + f(x). Similarly, 3 f(x) and other higher order differences can be obtain. The differences of y = f(x) for tabular value of y can be obtained by the following forward difference table.

Dr. Satish Shukla of 33 x y y y 3 y y x y y = y y x y y = y y y = y y 3 y = y y x y y = y 3 y y = y y 3 y = y y y = 3 y 3 y x 3 y 3 y = y 3 y y 3 = y y 3 x y The backward difference operator. The backward difference operator is denoted by and defined by f(x) = f(x) f(x h). It is clear that y = f(x ) f(x h) = f(x ) f(x ) = y y. Similarly, y = y y,..., y n = y n y n. Also, it is obvious that. The higher order backward differences can be obtained similarly. The various higher order differences can be obtained by following backward difference table: x y y y 3 y y x y y = y y x y y = y y y = y y 3 y 3 = y 3 y x y y 3 = y 3 y y 3 = y 3 y 3 y = y y 3 y = 3 y 3 y 3 x 3 y 3 y = y y 3 y = y y 3 x y The shifting operator E. It is denoted by E and defined by Ef(x) = f(x + h). The higher order shifting is defined by E f(x) = Ef(x + h) = f(x + h). Similarly, we define E n f(x) = f(x + nh). The negative powers of E is defined in similar way; E f(x) = f(x h) and E n f(x) = f(x nh). Relation between,, E and D.

Dr. Satish Shukla 3 of 33 Example. Prove the following relations: (a) E (b) E (c) E (d) ( + )( ) (e) (f) D h ln( + ) (g) D ln( ). h Sol. (a) By definition we have f(x) = f(x + h) f(x) = Ef(x) f(x) = (E )f(x). Therefore (b)by definition we have E or E +. Therefore f(x) = f(x) f(x h) = f(x) E f(x) = ( E )f(x). (c) By (a) and (b) we have (d) By (a) and (b) we have (e) By (a) and (b) we have E or E. E E EE ( E )E E. ( + )( ) EE. (E )( E ) E EE + E E + E. Similarly, we have E + E. Therefore. (f) By Taylor series we know that f(x + h) = f(x) + hf (x) + h! f (x) + h3 3! f (x) + = Ef(x) = f(x) + hd [f(x)] + h! D [f(x)] + h3 3! D3 [f(x)] + ] = Ef(x) = [ + hd + h! D + h3 3! D3 + f(x) = Ef(x) = e hd f(x). Therefore, E e hd, i.e., + e hd or D ln( + ). h (g) Again, since E e hd and E we have ehd = e hd = ln( ) hd = D ln( ). h

Dr. Satish Shukla of 33 ( ) Example. Prove that: e x = e x Eex E e. x Sol. We have ( ) R.H.S. = e x Eex E e ( ) x (E ) = e x Ee x E (E ) e ( ) x E E + = e x Ee x E (E E + )e x = ( E + E ) e x Ee x (E E + )e x = ( e x+h e x + e x h) e x+h ( (e x+h e x+h + e x ) = ex e x+h e x+h + e x) (e x+h e x+h + e x ) = e x = L.H.S. ( Example 3. Prove that: ln f(x) = ln + f(x) ). f(x) Sol. We have L.H.S. = ln f(x) = (E ) ln f(x) = ln f(x + h) ln f(x) ( ) f(x + h) = ln f(x) ( ) Ef(x) = ln f(x) ( ) ( + )f(x) = ln f(x) ( = ln + f(x) ) f(x) = R.H.S. Example. Prove that: [e ax ln(bx)]. Sol. We know that [e ax ln(bx)] = (E ) [e ax ln(bx)] = E[e ax ln(bx)] e ax ln(bx) = e a(x+h) ln[b(x + h)] e ax ln(bx)

Dr. Satish Shukla 5 of 33 Example 5. Find the value of Sol. (i) ( E (i) ) [ ] (E ) x 3 = x 3 E = ( E + E ) x 3 ( E = (x + h) 3 x 3 + (x h) 3 ) ( ) x 3 (ii) n. x = (x 3 + 3x h + 3xh + h 3 ) x 3 + (x 3 3x h + 3xh h 3 ) = 6xh. ( ) (ii) = x x + h x = h x(x + h). ( ) [ ( )] [ ] Similarly h = = x x x(x + h) [ ] = h (x + h)(x + h) x(x + h) ( )! h = x(x + h)(x + h). In general, we have ( ) n = x ( ) n n! h n x(x + h)(x + h) (x + nh). Theorem. Prove that the n th difference of a polynomial of degree n is constant and all higher order differences are zero.. Proof. Let By definition we have f(x) = f(x + h) f(x) f(x) = a x n + a x n + a x n + + a n x + a n. = a (x + h) n + a (x + h) n + a (x + h) n + + a n (x + h) + a n [ a x n + a x n + a x n + + a n x + a n ] = a [(x + h) n x n ] + a [(x + h) n x n ] + + a n [(x + h) x] + [a n a n ] = a nhx n + b x n + b x n 3 + + b n. Similarly f(x) = [ f(x)] = [a nhx n + b x n + b x n 3 + + b n ] = a n(n )h x n + c x n 3 + c x n + + c n. Thus, we obtain n f(x) = a n(n )(n ) h n = constant. Therefore n+ f(x) = [a n(n )(n ) h n ] = (constant) =.

Dr. Satish Shukla 6 of 33 Some motivation for the calculus of finite differences. How can we evaluate b a f(x), where f is continuous in its domain? The answer is given by the the fundamental theorem of calculus. It says that if g(x) is the anti-derivative of f(x), i.e., f(x) = g (x) then b a f(x) = g(a) g(b). Obviously, the above problem is meaningful when the function f is continuous in its domain (in general). For a function f(x), where the value of function is known only at some finite number of values of x in the interval [a, b]. For such functions an analogue b of the above problem can be stated as: how can we evaluate f(x)? Such problems occurs frequently in practical and theoretical calculations. To answer this question, we need a result similar to the fundamental theorem of calculus which works for instead. Definition (Anti-difference operator). A function g(x) is called anti-derivative of the function f(x) if g(x) = f(x). x=a Theorem (Fundamental theorem of finite difference calculus). Let g(x) be an antiderivative of f(x). Then: b f(x) = g(b + h) g(a). x=a Proof. By definition we have b f(x) = x=a b g(x) = x=a b [g(x + h) g(x)] = x=a b g(x + h) x=a b g(x) = g(a + h) + g(a + h) + + g(b + h) [g(a) + g(a + h) + + g(b)] = g(b + h) g(a) which proves the theorem. Next, we collect some tools for finding anti-difference of a function. Factorial Notation or Falling Powers: Suppose n be any integer, then the factorial power of x is denoted by x (n) and it is defined by: x (n) = x(x h)(x h) (x n h). If the length of interval is assumed h =, then x (n) = x(x )(x ) (x n ). x=a Example 6. Prove that: x (n) = nx (n ), where h =.

Dr. Satish Shukla 7 of 33 Sol. By definition, we have x (n) = (x + ) (n) x (n) = (x + )(x)(x ) (x n ) x(x )(x ) (x n ) = x(x ) (x n ) [ (x + ) (x n ) ] = nx(x ) (x n ) = nx (n ). Example 7. Express y = x 3 3x + 3x in a factorial notation and hence show that 3 y =. Sol. Suppose y = x 3 3x + 3x = Ax (3) + Bx () + Cx () + D. To find the constants A, B, C, D, we use the synthetic division as follows: x 3 x x constant -3 3 -=D - - =C 3 3=B =A Therefore y = x 3 3x + 3x = x (3) + 3x () + x (). Also, 3 y = 3 [x (3) + 3x () + x () ] = [6x () + 6x () + ] = [x () + x () ] =. Example 8. Find the function whose first forward difference is 6x +. Sol. Suppose f(x) is the function whose first forward difference is 6x +, i.e., f(x) = 6x + = Ax () + Bx () + C. To find the constants A, B, C, we use the synthetic division as follows: x x constant 6 =C 6 6 6=B 3 6=A

Dr. Satish Shukla 8 of 33 Therefore f(x) = 6x () + 6x () +. Integrating the above we obtain:, f(x) = x (3) + 3x () + x () + c. Exercise (Assignment) (Q.) Prove that 3 y i = y i+3 3y i+ + 3y i+ y i. Hint: Use the relation E and E n y i = y i+n, n =,, 3. ( ) (Q.) Prove that = f(x), assume h =. f(x) f(x)f(x + ) Hint: Think. [ ] 5x + (Q.3) Evaluate, assume h =. x + 5x + 6 Ans: x+3 (x+)(x+3)(x+)(x+5). (Q.) Prove that + =. Hint: Use the relations between, and E. (Q.5) Construct the table of differences for the data below: x : 3 f(x) :..5. 3..6 (Q.6) Express x 3 x + x into factorial polynomial hence show that f(x) =. Ans: f(x) = x (3) + x (). (Q.7) Represent the function f(x) = x x 3 + x 3x + 9 and all its successive differences into factorial notation. Hence show that 5 f(x) =. Ans: f(x) = x () 6x (3) + 3x () + x () + 9. (Q.8) Find the function whose first forward difference is x 3 + 3x 5x +. Ans: f(x) = x() + 3x (3) + x () + c. (Q.9) Find the function whose first forward difference is 9x + x + 5. Finding the missing terms in a given series. In this, we deal with the data in which few terms are missing and we have to recover those missing values. We know that to fit a straight line we must have two points i.e., two points known means we can assume that a first degree curve can be fitted. Generally, n points known means a (n )-th degree curve can be fitted with the given data. Then we apply the theorem that the n-th difference of a (n )-th degree polynomial is zero.

Dr. Satish Shukla 9 of 33 Example 9. Find the missing values in table given below: x: 3 y: 3 9? 8 Explain why the value differ from 3 3 or 7. Sol. In the above data, there are points are known (as their both x and y co-ordinates are known). So, we can assume that y is a third degree polynomial. Hence all the fourth differences must be zero. Let a be the unknown values of y. Then the difference table will be as follows: x y y y 3 y 3 3 9 a 8 6 a 9 8 a a 5 9 a a 9 5 3a y 3a Since the fourth difference must be zero, we have 3a = = a = 3. This value is not 3 3 = 7, because we assume y as a polynomial, while it is y = 3 x. Example. Find the missing values in table given below: x: 3 5 6 7 y: - -??? Sol. In the above data, there are 5 points are known (as their both x and y co-ordinates are known). So, we can assume that y is a fourth degree polynomial. Hence all the fifth differences must be zero. Let a, b, c respectively, are the unknown values of y. Then the difference table will be as follows: x y y y 3 y 3 5 6 7 a b c a b a c b a 3 b a + c b + a 8 8 a 7 b 3a + c 3b + 3a y 6 a 5 b a + c b + 6a 5 5 y a 3 b 5a + 6 c 5b + a 6

Dr. Satish Shukla of 33 Since the fifth difference must be zero, we have On solving we get: a 3 =, b 5a + 6 =, c 5b + a 6 =. a = 3, b = 9, c = 35. Example. If y x is a polynomial for which fifth difference is constant and y +y 7 = 785, y + y 6 = 686, y 3 + y 5 = 88, find y. Sol. Given that the fifth difference of y x is constant, so, 6 y =, i.e., 6 y = = (E ) 6 y = = (E 6 6E 5 + 5E E 3 + 5E 6E + )y = = y 7 6y 6 + 5y 5 y + 5y 3 6y + y = = (y 7 + y ) 6(y 6 + y ) + 5(y 5 + y 3 ) y = = y = [(y 7 + y ) 6(y 6 + y ) + 5(y 5 + y 3 )] = y = [ 785 6 686 + 5 88] = y = 57. Interpolation. The interpolation is a technique with the help of which we can construct the new data points within the range of given discrete data points. In other words, if a function f(x) is unknown, but the values of this function at some discrete points, say x, x,..., x n are known, then we can find the find the value of f(x) at a point x [x, x n ]. For this, we approximate the function f(x) by a polynomial of degree maximum n (since the value of function is known at n + points). This process is called the Polynomial interpolation. According to the nature of points x, x,..., x n the process of interpolation is divided into the following: (I) Interpolation for equally spaced intervals. In this case, the values x, x,..., x n are equally spaced, i.e., x i = x i + h for i =,,..., n and h is the space or length of the interval. For such case, we will use Newton s Forward interpolation formula or Newton s backward interpolation formula. If the point at which the value is to interpolated lies in the upper half of the difference table then we use Newton s Forward interpolation formula. Newton s Backward interpolation formula is used when the point at which the value is to interpolated lies in the Lower half of the difference table. (II) Interpolation for unequally spaced intervals. In this case, the values x, x,..., x n are not equally spaced. For such cases Newton s Divided difference formula or Lagrange s interpolation formula is used. Newton s Forward interpolation formula. Suppose the value of function y = f(x) is given at n + equally spaced points x, x = x + h, x = x + h,..., x n = x n + h, and we have to find the value of function at an intermediate point x [x, x n ]. Suppose x = x + rh, i.e., r = x x. Then we know that h y = f(x) = f(x + rh) = E r f(x ) = E r y = ( + ) r y = [ + r C + r C + r C 3 3 + + r C r r] y.

Dr. Satish Shukla of 33 Therefore: y = y + r y + r(r ) y +! r(r )(r ) 3 y + + r y. 3! Newton s Backward interpolation formula. Suppose the value of function y = f(x) is given at n + equally spaced points x, x = x + h, x = x + h,..., x n = x n + h, and we have to find the value of function at an intermediate point x [x, x n ]. Suppose x = x n rh, i.e., r = x n x. Then we know that h Therefore: y = f(x) = f(x n rh) = E r f(x n ) = ( E ) r yn = ( ) r y = [ r C + r C + r C 3 3 + + ( ) r r C r r] y n. y = y n r y n + r(r ) y n! r(r )(r ) 3 y n + + ( ) r r y n. 3! Example. The area A of a circle of diameter d is given by the following table: d: 8 85 9 95 A: 56 567 636 788 785 Find the area of circle of diameter 8. Sol. The forward difference table is as follows: y x y y 3 y 8 85 9 95 56 567 636 788 785 68 688 76 766 38 y We represent d by x and A by y. Since d = 8 is near the initial value 8 we will use the forward interpolation formula. Then for x = 8 we have r = x x 8 8 = =. h 5 Now by Newton s forward interpolation formula we have: y(8) = r(r ) y + r y + r(r )(r ) y + 3 y +! 3! = ( ) ( )( ) 56 + ( )(68) + () + ( ) 6 ( )( )( 3) + () = 58.56sq. units.

Dr. Satish Shukla of 33 Example 3. From the following table, estimate the number of students who obtained marks between and 5. Marks: 3- -5 5-6 6-7 7-8 No. of Students: 3 5 35 3 Sol. We construct the cumulative table which is as follows: y Marks less than y y 3 y (x) 5 6 7 8 3 73 59 9 5 35 3 9 6 5 y 37 We have to find y(5) and 5 is near the initial value, therefore we will use the Newton s forward interpolation formula. Then for x = 5 we have r = x x h = 5 = 5. Now by Newton s forward interpolation formula we have: r(r ) y(5) = y + r y + r(r )(r ) y + 3 y +! 3! 5( 5 ) 5( 5 )( 5 ) = 3 + ( 5)() + (9) + ( 5) 6 5( 5 )( 5 )( 5 3) + (37) = 7.87 8. Thus, the number of students obtained marks less than 5, i.e., y(5) = 8 and from the table the number of students obtained marks less than is y() = 3. Therefore, the number of students ontaining the marks between and 5 will be: y(5) y() = 8 3 = 7. Example. Find a polynomial which takes the following values: Hence or otherwise, evaluate f(). x: 3 y: Sol. The difference table for the given function is as follows:

Dr. Satish Shukla 3 of 33 y x y y 3 y 3 9 Here h =, x =, and so r = x x = x h Now by forward interpolation formula we have: = x. f(x) = y r(r ) = y + r y + r(r )(r ) y + 3 y +! 3! = x(x ) x(x )(x ) + x() + ( ) + () 6 = + x x(x ) + x(x )(x ) = x 3 7x + 6x +. Now, putting x = in the above formula for y = f(x) we obtain: f() = ( 3 ) 7( ) + 6() + =. Example 5. Evaluate f(3.75) from the table given below: x:.5 3 3.5.5 5 y:.5.3.5 8.6 7.6 6.7 Sol. Here h =.5. Since 3.75 is near to the final value x = 5 we will use the Newton s backward interpolation formula. Then, r = x n x h = 5 3.75.5 The backward difference table is given as follows: =.5. y x y y 3 y.5 3 3.5.5.5.3.5 8.6 7.6 5 6.7..8 3.58.38.5.8 3.763.99.67 6.7 5.96.3 y.9 7.99 5 y.3

Dr. Satish Shukla of 33 Now by backward interpolation formula we have: y = f(3.75) r(r ) = y 5 r y 5 + r(r )(r ) y 5 3 y 5 +! 3! r(r )(r )(r 3)(r ) + 5 y 5 5! = 6.7 (.5)(.5) + (.5)(.5) + (.5)(.5)(.5)(.5) r(r )(r )(r 3) y 5! (.67) (.5)(.5)(.5) (.3) 6 ( 7.99) + (.5)(.5)(.5)(.5)(.5) (.3) = 6.7 + 3.37 +.33 +.635 +.3.35 =.88. Example 6. Find the values of f(.5) and f(5.5) from the following table: Sol. The difference table is given below: x: 3 5 6 7 y: - 3 5 5 y x y y 3 y y 5 y 6 y 7 y 3 5 6 7 3 5 5 8 5 5 9 8 3 5 7 5 6 7 3 Now use the forward interpolation for f(.5) and backward interpolation for f(5.5). Exercise (Assignment) (Q.) Find the missing term from the following table: x:....3..5.6 y = f(x):.35 -.. -.8.7 Ans. f(.) =.3 and f(.) =.9. (Q.) Fit a polynomial to the given data:

Dr. Satish Shukla 5 of 33 Hence find y at x = 5. x : 6 8 y : 3 8 6 (Q.3) Given that sin(5 ) =.77, sin(5 ) =.766, sin(55 ) =.89, sin(6 ) =.866. Then find sin(5 ). Hint: Use Newton s forward difference formula with x = 5. Ans..788. (Q.) Find the number of mens getting wages between Rs. and Rs. 5 from the Wages - -3 3- -5 following data: Frequency 9 3 35 Ans. 5. (Q.5) Find the cubic polynomial in x for the following polynomial: Ans. f(x) = x 3 x + 7x 3. x : 3 5 y : -3 3 7 57 7 (Q.6) The pressure p of wind corresponding to velocity v is given by the following data. Estimate p when v = 5: Ans. p(5) =.35. (Q.7) Find f() from the following data: Ans. f() = 9. v : 3 p :... 7.9 x : 5 3 35 5 f(x) : 35 33 9 6 3 Interpolation for unequally spaced intervals. For unequally spaced intervals we will use two formulae: (i) The Lagrange s formula; (ii) Newton s Divided Difference formula. (i) The Lagrange s formula. Suppose, the values of function y = f(x) at points x, x, x,..., x n be y = f(x ), y = f(x ), y = f(x ),..., y n = f(x n ). Then, the Lagrange s approximated polynomial of degree n is given by: f(x) = (x x )(x x )(x x 3 ) (x x n ) (x x )(x x )(x x 3 ) (x x n ) y + (x x )(x x )(x x 3 ) (x x n ) (x x )(x x )(x x 3 ) (x x n ) y + + (x x )(x x )(x x ) (x x n ) (x n x )(x n x )(x n x 3 ) (x n x n ) y n. (ii) Newtons Divided Difference formula. First we define the divided difference of a function. Suppose x, x, x,..., x n be the values of arguments x and y = f(x ), y = f(x ), y = f(x ),..., y n = f(x n ) be the corresponding values of y. Then the first divided difference of f is denoted by f(x ) or f[x, x ] and f(x ) = f[x, x ] = f(x ) f(x ) x x.

Dr. Satish Shukla 6 of 33 Similarly, we define f(x ) = f[x, x, x ] = f[x, x ] f[x, x ] x x and so on. Suppose, the values of function y = f(x) at points x, x, x,..., x n be y = f(x ), y = f(x ), y = f(x ),..., y n = f(x n ). Then, the Newton s divided difference approximated polynomial of degree n is given by: f(x) = f(x ) + (x x ) f(x ) + (x x )(x x ) f(x ) + + (x x )(x x ) (x x n ) n f(x ) Example 7. Find the Newton s divided difference approximated polynomial for the function given below and hence find f(8), f(9) and f(5). x : 5 7 3 y = f(x) : 8 9 9 8 Sol. The divided difference table for the given function is as follows: x y f(x) f(x) 3 f(x) f(x) 8 5 7 9 9 3 8 8 5 9 7 5 9 9 7 9 5 8 3 = 5 = 97 = = 3 = 9 97 5 7 = 5 5 = 97 5 = = 7 5 = 3 7 = 7 9 3 3 = 33 33 7 3 7 = Therefore, the Newton s divided difference approximated polynomial will be: f(x) = f(x ) + (x x ) f(x ) 3 5 = +(x x )(x x ) f(x ) + (x x )(x x )(x x ) 3 f(x ) +(x x )(x x )(x x )(x x 3 ) f(x ) +(x x )(x x )(x x )(x x 3 )(x x ) 5 f(x ) = 8 + 5(x ) + 5(x )(x 5) + (x )(x 5)(x 7). Thus, f(x) = 8 + 5(x ) + 5(x )(x 5) + (x )(x 5)(x 7). ()

Dr. Satish Shukla 7 of 33 Putting x = 8 in () we get f(8) = 8 + 5(8 ) + 5(8 )(8 5) + (8 )(8 5)(8 7) = 8. Similarly, f(9) = 68 and f(5) = 35. Example 8. Given that f() = 8, f() =, f(3) =, f(5) = 8, f(6) =, f(9) = 3, then find f(x). Sol. Here x =, x =, x = 3, x 3 = 5, x = 6, x 5 = 9. Therefore, the points are unequally spaced. We shall use the Newton s divided interpolation formula for the calculation of f(x). Then, the divided difference table is as follows: x y f(x) f(x) 3 f(x) f(x) 5 f(x) -8 3 5-8 6 9 3 + 8 = 8 8 3 = 6 3 = 3 + 6 = 5 5 = 3 5 8 5 3 = 8 + 6 3 = + 3 6 = 3 + 8 6 5 = 8 3 = 5 9 3 368 8 = 3 9 5 3 9 6 = 368 3 + 5 6 = 6 5 3 9 = 5 5 6 9 = Therefore, the Newton s divided difference approximated polynomial will be: f(x) = f(x ) + (x x ) f(x ) +(x x )(x x ) f(x ) + (x x )(x x )(x x ) 3 f(x ) +(x x )(x x )(x x )(x x 3 ) f(x ) +(x x )(x x )(x x )(x x 3 )(x x ) 5 f(x ) = 8 + 8x 6x(x ) + 7.x(x )(x 3) +.87x(x )(x 3)(x 5) +.63x(x )(x 3)(x 5)(x 6). Inverse Interpolation. Sometimes it will be required to find out the value of x corresponding to a value of y. Keeping in mind x and y are variables representing independent and dependent variable, in such case we have to treat y as independent variable and x as dependent variable so that the interpolation formulae remain valid in this case also. Since y is considered as the independent variable, we have to check whether the values of y are equally spaced or not and accordingly we have to decide which interpolation formula is applicable. Example 9. Find the value of x for y =. from the following table: x : 3 5 y : 3 5 3

Dr. Satish Shukla 8 of 33 Sol. Since the values of y are not equidistant, we use the Newton s inverse divided difference formula. Then, the divided difference table for y will be: y x x x 3 x x 5 x 3 5 3 3 5 = 3 = 3 =.67 =. 5.5 5 =.67.3. =.5 3 5 3 =.5. +.67 =.3.3.5..3 =. 3 3 3 5 =.3.3 +. =. 3 3 5 3 =.56.56.3 3 5 =.3 Therefore, by Newton s divided difference formula we have x = x + (y y ) x +(y y )(y y ) x + (y y )(y y )(y y ) 3 x +(y y )(y y )(y y )(y y 3 ) x +(y y )(y y )(y y )(y y 3 )(y y ) 5 x = + (. )() + (. )(. )() + (. )(. )(. 3)(.) +(. )(. )(. 3)(. 5)(.5) =. +.8 +.3 =.. Example. From the given table find for what value of x when y = 3.6: x : 3 35 5 5 y : 5.9.9. 3.3.5 Sol. We will find the value x(3.6) by Lagrange s inverse interpolation formula. Here x = 3, x = 35, x =, x 3 = 5, x = 5 and y = 5.9, y =.9, y =., y 3 = 3.3, y =.5 and y = 3.6. Then, we have: x = (y y )(y y )(y y 3 )(y y ) (y y )(y y )(y y 3 )(y y ) x + (y y )(y y )(y y 3 )(y y ) (y y )(y y )(y y 3 )(y y ) x + (y y )(y y )(y y 3 )(y y ) (y y )(y y )(y y 3 )(y y ) x + (y y )(y y )(y y )(y y ) (y 3 y )(y 3 y )(y 3 y )(y 3 y ) x 3 + (y y )(y y )(y y )(y y 3 ) (y y )(y y )(y y )(y y 3 ) x.

Dr. Satish Shukla 9 of 33 Putting all the values we get: x = (3.6.9)(3.6.)(3.6 3.3)(3.6.5) (5.9.9)(5.9.)(5.9 3.3)(5.9.5) 3 (3.6 5.9)(3.6.)(3.6 3.3)(3.6.5) + (.9 5.9)(.9.)(.9 3.3)(.9.5) 35 (3.6 5.9)(3.6.9)(3.6 3.3)(3.6 3.6) + (. 5.9)(..9)(. 3.3)(. 3.6) (3.6 5.9)(3.6.9)(3.6.)(3.6 3.6) + (3.3 5.9)(3.3.9)(3.3.)(3.3 3.6) 5 (3.6 5.9)(3.6.9)(3.6.)(3.6 3.6) + (.5 5.9)(.5.9)(.5.)(.5 3.6) 5 = 3.95. Exercise (Assignment) (Q.) Use Newton s divided difference formula to find the form of f(x), hence find f(): Ans. f(x) = x + 3x + 68. x : 3 6 f(x) : 68 7 79 79 (Q.) Given log(65) =.856, log(658) =.88, log(659) =.889 and log(66) =.8. Find log(656). Ans. Use Lagrange s interpolation formula log(656) =.869. (Q.3) Use Lagrange s formula to find the value of f(9), where: Ans. f(9) = 8. x : 5 7 3 7 f(x) : 5 39 5 366 5 (Q.) Apply Lagrange s formula and find the value of x when f(x) = 5 x : 5 6 9 y = f(x) : 3 6 Ans. Use Lagrange s inverse interpolation formula x(5) = 9.5. Numerical Differentiation Suppose y = f(x) and we have to find the value of dy at point x. Suppose, the values of x are equally spaced. We consider the following two cases: (i) When x is situated near to the initial value x. Let r = x x. Then, by Newton s h forward difference formula we know that y = f(x) = f(x +rh) = y +u y + r(r ) y +! r(r )(r ) 3 y + 3! r(r )(r )(r 3) y +!

Dr. Satish Shukla of 33 Since dr = h dy = [ h we have dy = dy dr dr, i.e., y + r! y + 3r 6r + 3! If x = x, i.e., r = from the above equation we get [ ] dy x=x = h 3 y + r3 8r ] + r 6 y +! [ y y + 3 3 y y + If x x, then we use the formula (). Also, from () we have d y = [ y h + 6r 6 ] 3 y + r 36r + y +. 3!! If x = x, i.e., r = from the above equation we get [ ] d y x=x = h [ y 3 y + y + (i) When x is situated near to the last value x n. Similarly, if we use the Newton s backward difference formula we obtain: dy = [ y n r y n + 3r 6r + 3 y n r3 8r ] + r 6 y n + (3) h! 3!! If x = x n, i.e., r = from the above equation we get [ ] dy x=x n = h ]. [ y n + y n + 3 3 y n + y n + If x x n, then we use the formula (3). Similarly, we can find the second derivative of function. Now, suppose, the values of x are unequally spaced. In such cases, we use the Newton divided difference formula or the Lagrange s interpolation formula, whichever is suitable, and find the approximated polynomial for f(x). Now, we can obtain the derivatives of f by differentiating this polynomial. ]. ]. () Example. Find dy and d y at x =, using: x: 3 5 7 9 y: 85.3 7.5 67. 6.5 5.3 Sol. The difference table for the given values is as follows: x 3 5 7 9 y y y 3 y 85.3 7.5 67. 6.5.8 7.5 6.5 6. 3.3..3.3.7 5.3 y.6

Dr. Satish Shukla of 33 Since x = is the initial point, we have [ ] dy [ y y + 3 3 y ] y = [ ] dy x=x x= = h = [.8 (3.3) + 3 (.3) ] (.6) = 6.88. [ ] d y = x=x h [ ] d y = x= [ y 3 y + = [ 3.3 (.3) + (.6) ] y ] =.767. Example. If the value of function y = f(x) is given by the following table: Then find find the value of dy x: 3 5 6 7 y: - 3 5 5 at points x = and 5. Sol. The difference table for the given function is given below. The blue boxes contain the values of the forward difference of y, while the red boxes contain the values of the backward difference of y. y x y y 3 y 3 5 6 7 3 5 5 8 5 5 9 8 3 5 7 x y y y 3 y y 5 y 6 y 7 y (i) Since x = is near to the initial value, therefore we will use the forward difference formula. Since x = is a table point, we suppose x =, then we know that [ ] dy [ y y + 3 3 y y + 5 5 y 6 ] 6 y y 5 5 y 6 6 y 7 3 7 y = [ ] dy x=x x= = h = + + 3 + + 5 3 6 = 6.667.

Dr. Satish Shukla of 33 (ii) Since x = 5 is near to the last value 7, therefore we will use the backward difference formula. Since x = 5 is a table point, we suppose x n = x 6 =, then we know that [ ] dy [ y n y n + 3 3 y n y n + 5 ] 5 y n = = [ ] dy [ ] dy x=x n x= x= = h = y 6 y 6 + 3 3 y 6 y 6 + 5 5 y 6. = 8 8 3 + 6 5 =.67. Example 3. Find dy and d y at x =, using: x: 8 y: 5 7 Sol. In this problem, the values of x are not equally spaced. Therefore, we use the Newton s divided difference formula to find the approximate polynomial for f(x). Then, the divided difference table is as follows: x y y y 3 f(x) f(x) = = 3 5 = /3 /3 = 8 5 8 7 8 = 3 5 8 = /6 /3 7 8 = 3 3 = 6 = 6 /6 Therefore, the Newton s divided difference approximated polynomial will be: y = f(x ) + (x x ) f(x ) = / +(x x )(x x ) f(x ) + (x x )(x x )(x x ) 3 f(x ) +(x x )(x x )(x x )(x x 3 ) f(x ). Thus, y = + (x ) + (x )(x ) (x )(x )(x )(x 8) 3 = x 5x 3 + 3 x + x + 67. Differentiating two times we get: dy = x3 5x + x + ; 3 and d y = x 9x + 3.

Dr. Satish Shukla 3 of 33 Putting x = in the above equations we get: [ ] [ ] dy d y = 5.8, x= x= = 7.33. Example. Find the rate of change of (i) Pressure (p) w. r. t. volume for v =. (ii) Pressure w. r. t. volume for v = 3. from the table given below: v : 6 8 p : 5.7 5.3 6.7 3 Sol. Since the values v = and v = 3 are near to yhe initial point, therefore we will use the forward difference formula. Then, the forward difference table is as follows: v 6 8 p p p 3 p 5.7 5.3 6.7 6.3 7. 8.6 3.7.6 8.8.9 35.8 3.9 3 p 3.9 (i) At v =. Here r = v v h dp = [ p + r dv h! = [ = p + 3r 6r + 3! 6.3 + + 3(.5) 6(.5) + 6 = [ 6.3 +.96 +.39] = 9.7396. (ii) At v = 3. Here r = v v h dp = [ p + r dv h! = [ = 3 p + 3r 6r + 3! =.5 and 3 p + r3 8r ] + r 6 p +! ( 35.8) + (.5)3 8(.5) + (.5) 6 (3.9) =.5 and 6.3 + (.6) 3(.5) 6(.5) + 6 = [ 6.3 +.97 +.6583] = 3.56567. 3 p + r3 8r ] + r 6 p +! ( 35.8) + (.5)3 8(.5) + (.5) 6 (3.9) ] ]

Dr. Satish Shukla of 33 Exercise (Assignment) (Q.) Values of y as plotted against x are given below, find dy Ans. -.7567 (Q.) Find dy Ans..75 at x =.5.: x :.5.75..5.5 y :.35.3..87.95 at x =.5. from the following table: x :.5..5 3. 3.5. y : 3.375 7. 3.65. 38.875 59. (Q.3) Find f (x) and f (x) at x = 6 from the following table: x :.5 5. 5.5 6. 6.5 6.5 7. f(x) : 9.65.9 6.7.8 ; 6.37 3.3 ; 39.5 Ans. f (6) = 9.6 and f (6) =.88. (Q.) Find dy and d y at x =.6 from the following table: x :....3..5.6 y : 7.989 8.3 8.78 9.9 ; 9.5 9.75 ;.3 Ans. [ ] dy =.776 and x=.6 [ ] d n y n x=.6 =.7. (Q.5) Find the first and second derivatives of the function given below at the point x =.: Ans. [ ] dy =.673 and x=. x: 3 5 y: 5 6 8 [ ] d n y n x=. = 8.3. (Q.6) Find the value of cos.77 using the values as given below: x:.7.7.78.8.86 sin x:.996.9857.978.969.958 Hint. Since d dy (sin x) = cos x, therefore, find at point x =.77.

Dr. Satish Shukla 5 of 33 Numerical integration Formulae for Numerical Integration. Suppose, we have to find the value of integral b b a a f(x). Suppose h = x = a, x n = b, where n is any positive integer called the n number of division. Then, we use the following rules: (i) The Trapezoidal Rule. x n x f(x) = h [(y + y n ) + (y + y + y 3 + + y n )]. This rule is applicable for any no of intervals i.e., n = even or odd. (ii) The Simplson s one-third rule. x n x f(x) = h 3 [(y + y n ) + (y + y 3 + ) + (y + y + )]. This rule is applicable for even no. of intervals only i.e., n, the no. of intervals = even only. (iii) The Simplson s three-eight rule. x n x f(x) = 3h 8 [(y + y n ) + (y 3 + y 6 + y 9 + ) + 3(y + y + y + )]. This rule is applicable for n, the no. of intervals = multiple of three only. (iv) The Weddle s rule. x n x f(x) = 3h [y + 5y + y + 6y 3 + y + 5y 5 + y 6 + 5y 7 + y 8 + ]. This rule is applicable for n, the no.of intervals = multiple of six only. Example 5. Find approximate value of by Simpson s one third, Simp- + x son s three eight and Weddle s rule and hence find the error each case. Sol. Here f(x) = b a, a =, b =. Take n = 6, then h = + x n table for the values of x and f(x) is given below: = 6 = 6. The x : x = x = 6 x = 6 x 3 = 3 6 x = 6 x 5 = 5 6 x 6 = 6 6 = f(x) : y = y =.9797 y =.9 y 3 =.8 y =.693 y 5 =.596 y 6 =.5

Dr. Satish Shukla 6 of 33 Since Therefore, by Simpson s rule we have + x = h 3 [(y + y 6 ) + (y + y ) + (y + y 3 + y 5 )] = [( +.5) + (.9 +.693) + (.9797 +.8 +.596)] 8 =.78539. + x = [ tan x ] = π =.78539 Therefore the error:=.78539.78539 = (up to the five places of decimal). Example 6. Find the approximate value of ln(5) by calculating to four places of decimal by Simpsons one third rule from equal parts. 5 by dividing the range into x + 5 Sol. Here f(x) = 5, a =, b = 5. Take n =, then h = x + 5 the values of x and f(x) is given below: =.5. The table for x : x = x =.5 x = x 3 =.5 x = x 5 =.5 f(x) : y =. y =.86 y =. y 3 =.99 y =.769 y 5 =.6667 x : x 6 = 3 x 7 = 3.5 x 8 = x 9 =.5 x = 5 f(x) : y 6 =.588 y 7 =.563 y 8 =.76 y 9 =.38 y =. Therefore, by Simpson s rule we have 5 Since x + 5 = h 3 [(y + y ) + (y + y + y 6 + y 8 ) + (y + y 3 + y 5 + y 7 + y 9 )] Therefore, we have =.5 3 [.55] =.53. [ ] x + 5 = ln(x + 5) = [ln(5) ln(5)] = ln(5). ln(5) =.53 = ln(5) =.6. Example 7. Evaluate Waddle s rule. π/ cos θdθ by dividing the interval into 6 equal parts. Use

Dr. Satish Shukla 7 of 33 Sol. Here f(θ) = cos θ, a =, b = π/. Take n = 6, then h = π/ 6 for the values of x and f(x) is given below: = π. The table θ : θ = θ = π θ = π θ 3 = π θ = π θ 5 = 5π θ 6 = π 6 3 f(θ) : y = y =.988 y =.936 y 3 =.89 y =.77 y 5 =.587 y 6 = Therefore, by Waddle s s rule we have π/ cos θdθ = 3h [y + 5y + y + 6y 3 + y + 5y 5 + y 6 ] = π [5.8] =.89. Example 8. A river is 8 ft. wide. The depth d in feet at a distance x ft. from one bank is given by the following table: x : 3 5 6 7 8 d : 7 9 5 8 3 Find approximately the area of the cross-section of the river. Sol. Here d(x) =area, a =, b = 8 and n = 8, then h = 8 =. The table for the 8 values of x and d(x) is given in the question. Therefore, by Waddle s s rule we have: the area of cross-section of river A = 3h [d + 5d + d + 6d 3 + d + 5d 5 + d 6 + 5d 7 + d 8 ] = 3 [39] = 77 square units. Example 9. The following table gives the velocity v of a particle at time t : Find the distance moved by the particle in seconds and also the acceleration at t = sec. t (seconds): 6 8 v (velocity): 6 6 3 6 9 36 Sol. Here v(t) =velocity. If s is the distance travel by particle in time t then we know that ds dt = v = s = v dt. Therefore, the distance traveled in t = seconds will be s = and n = 6, then h = 6 v dt. Here a =, b = =. The table for the values of t and v(t) is given in the

Dr. Satish Shukla 8 of 33 question. Therefore, by Simpson s rule we have: Now acceleration a = velocity time s = h 3 [(v + v 6 ) + (v + v ) + (v + v 3 + v 5 )] = [( + 36) + (6 + 6) + (6 + 3 + 9)] 3 = 55 metres. = v t. Therefore, for t = the acceleration a = 6 = 3. Exercise (Assignment) (Q.) Evaluate π/ sin x by Simpson s one-third rule using ordinates. Hint: For ordinates, take n =. Ans..6. (Q.) Evaluate x by Simpson s rule. Hence obtain the approximate value of ln().. Hint: Take n = 6. Ans..693. (Q.3) Evaluate.7.5 e x x. (Q.) A reservoir discharging water through sluices at a depth h below the water surface has a surface area A for various values of h as given below: h (ft.): 3 A (sq. ft.): 95 7 35 53 If t denotes the time in minutes and the rate of fall of the water surface be dh dt = 8 h. Estimate the time taken for the water level to fall from to ft. above A the sluices. Hint: Since dh [ h dt = 8 A therefore dt = A ] 8. Now, let f(h) = h A 8 h and find the value of f(h)dh which is the required value. Ans. -9.9. (Q.5) Evaluate 6 by Trapezoidal rule (ii) Simpson s one-third rule (iii) Simp- + x son s three-eight rule (iv) Weddle s rule. Take h = and compare the result with its actual value in each case. using ordinates. Ans. (i).8 (ii).366 (iii).357 (iv).3735.

Dr. Satish Shukla 9 of 33 (Q.6) The following table gives the values of a function at equal intervals: x:..5..5. f(x):.3989.35..95.5 Evaluate (i) f(.8) (ii) f (, 5) (iii) f(x). Ans. (i) Use Backward interpolation formula::.7833(ii) Use backward interpolation formula with x n =.5:: -.85 (iii) Use Simpson s /3 rule::.77. Approximation by Least Square Method Suppose, y denotes a quantity which depends on another quantity x. Suppose, an explicit relation between x and y is not known, but the value of y for some values of x are known and given in the following table: x : x x x 3 x x n y : y y y 3 y y n For each value (x i, y i ), i =,,..., n we draw n points P i (x i, y i ) on with the values x i on X and y i on Y axis, as shown in figure. Y O x x x 3 x n X The line y = ax + b Suppose, we want to represent the relation between x and y by a linear relation y = a + bx. () The differences e i = y i (a + bx i ), i =,,..., n are called the error at point P i. We find the relation () in such a way that the total error E = e + e + + e n becomes minimum. Note that due to sign of error the total error may be less (ever zero sometimes) than the actual error. To avoid such confusions we do not minimize the total error, but we minimize the sum of squares of error, i.e., the total of square of error: E = n e i = i= n [y i (a + bx i )] i=

Dr. Satish Shukla 3 of 33 Obviously, the above expression depends on the values of a and b and to minimize the value of E we use the condition of minima, i.e., E a = E =. Therefore, we have b E n n n n a = ( ) [y i (a + bx i )] = = y i a b x i = i= i= i= i= E n n n n b = ( x i ) [y i (a + bx i )] = = x i y i a x i b x i =. i= For notational convenience, write x instead x i and others we get: y = na + b x i= i= i= xy = a x + b x. Now a and b can be obtained by solving the above two equations. Similarly, if we fit a quadratic polynomial or a parabola y = a + bx + cx to the given data, then the values of a b and c are given by the following equations: y = na + b x + c x xy = a x + b x + c x 3 x y = a x + b x 3 + c x. Remark. Sometimes (when the data size is big) then it is not convenient to do the calculations with the above mentioned formulae. In such a case, we use the scaling, i.e., we substitute u = x x m, v = y y m h k where x m is a suitable value of x (usually, the middle terms of x and y) and h is the length of interval of x. Similarly y m and k are chosen. After this scaling, we use same formulae to calculate a, b and c with u (in place of x) and v (in place of y). Example 3. Fit a straight line with the following data: Year x : 96 97 98 99 Production y : 8 6 And hence, find the expected production in the year 6. Sol. Suppose u = x 98 and v = y. Then the straight line will be: v = a + bu. (5) The value of a and b can be obtained by the following equations: v = na + b u uv = a u + b u. The required values are given in the following table: (6)

Dr. Satish Shukla 3 of 33 x 96 v = y u = x 98 uv u 8 - -6 97 - - 98 99 6 3 Total v = 56 u = uv = 6 u = On putting the values with n = 5 in (6) we get: 56 = 5a + b 6 = a + b. On solving a =. and b =.6. On putting ( these) values in (5), the straight line will be x 98 v =. + (.6)u, i.e., y =. + (.6) or y = 35.76 + (.6)x. Putting x = 6 we get the expected production in the year 6 = (.6)(6) 35.76 = 5.. Example 3. Fit a second degree parabola to the following data: x :.5..5 3. 3.5 y :..3.6.7 3.. Sol. Suppose u = x.5.5 = x 5 and v = y, then the best fitted parabola will be: v = a + bu + cu. (7) The value of a, b and c can be obtained by the following equations: v = na + b u + c u uv = a u + b u + c u 3 u v = a u + b u 3 + c u. (8) The required values are given in the following table:

Dr. Satish Shukla 3 of 33 x v = y u = x 5 uv u v u. -3-3.3 9.9 9 u 3-7 u 8.5.3 - -.6 5. -8 6.6 - -.6.6 -.5 3.7.7.7 3.5 3. 6.8 3.6 8 6. 3.3 Total v = 6. u = uv =.3 u = 8 36.9 9 7 8 u v = 69.9 u 3 = u = 96 On putting these values with n = 7 in (8) we get: 6. = 7a + b + 8c.3 = a + 8b + c 69.9 = 8a + b + 96c. On solving we get a =.7, b =.5 and c =.6. Therefore, the parabola will be: v =.7 + (.5)u + (.6)u, i.e., y =.7 + (.98)(x 5) + (.6)(x 5). Example 3. Fit a curve of the type y = ax b to the following data: x : 3 5 y :.5.5 8.5 Sol. We have to fit the curve y = ax b. Taking logarithm the required curve will be ln y = ln a + b ln x. Putting ln y = v, ln x = u and ln a = A, the required curve will be: v = A + bu. (9) The value of a and b can be obtained by the following equations: v = na + b u uv = A u + b u. () The required values are given in the following table:

Dr. Satish Shukla 33 of 33 x y u = ln x v = ln y uv u.5 -.693.693.693.8.8 3.5.986.5.65.69 8.3863.79.886.98 5.5.69 Total u =.787 uv = 9.83 u = 6.993.557 v = 6.9.68.59 On putting the values with n = 5 in (6) we get: 6.9 = 5A +.787b 9.83 =.787A + 6.993b. On solving A =.693 and b =. On putting these values in (5), the straight line will be v =.693 + u, i.e., ln y =.693 + ln x or y = e.693 x. Exercise (Assignment) (Q.) Find the parabola of the form y = a + bx + cx which fits most closely with the x : -3 - - 3 table given below: y :.63..67.9.63.5.58. Ans. y =.386.39x +.975x. (Q.) Find the least square fit y = a + bx + cx for the following data: Ans. y =.5 x +.75x. x : -3-3 y : 5 5 3 (Q.3) Fit a second degree parabola for the table given below: x : 3 5 6 7 8 9 y : 6 7 8 9 Hint: Put u = x 5, v = y 8. Ans. y =.67x + 3.5x.93. (Q.) Fit a curve of the type y = ab x to the following data: x : 3 5 y :.5.5 8.5 Hint: Take log of the given curve we get: ln y = ln a + (ln b)x, i.e., v = A + Bx, where A = ln a, v = ln y, B = ln b. Now apply the procedure for fitting a line.