All 13 questions UPSC has asked on interpolation in the Mathematics Optional (Paper II, Numerical Analysis and Computer Programming) from 2008 to 2025, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Numerical Analysis and Computer Programming topic-wise PYQs page.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the answer was worked out again independently with Python: each iteration, table or conversion was run again in double precision (or exact fractions), and algorithms were run on test equations.
- ✓ Proof checked step by step for “prove that” questions, every step was checked against the definitions.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2025 · 7b 2024 · 8b 2021 · 8b 2020 · 8b 2018 · 5b 2017 · 6b 2016 · 6c 2015 · 6c 2013 · 5c 2012 · 7a 2011 · 7c 2009 · 7b 2008 · 7a(i)
Find the unique polynomial of degree 2 or less which fits the following data : Also obtain the bound on the truncation error.
Solution
Divided differences. Newton’s divided-difference form: This is the unique polynomial of degree through the three points (two such polynomials would differ by a polynomial of degree with three zeros, hence by 0).
Check: , , . ✓
Truncation error. If has a continuous third derivative on , for some . Let . Then at , i.e. () and (). At the end points . So on , and where .
✓ Checked by computer We checked by computer: takes the values 1, 3, 55 at , and the largest value of on is at .
Using Newton’s forward difference formula for interpolation, estimate the value of from the following data :
Solution
Forward difference table ():
| 1 | 0 | 1 | 6 | 6 | 0 | 0 |
| 2 | 1 | 7 | 12 | 6 | 0 | |
| 3 | 8 | 19 | 18 | 6 | ||
| 4 | 27 | 37 | 24 | |||
| 5 | 64 | 61 | ||||
| 6 | 125 |
Third differences are constant, so the data come from a cubic and the series stops at .
Newton’s forward formula with , :
✓ Checked by computer We checked by computer: the data are , so exactly.
Derive Newton’s backward difference interpolation formula and also do error analysis.
Solution
Setting. Let at equally spaced points , , and define the backward difference , . We interpolate near the end of the table, so we write Derivation. Look for the polynomial of degree in the form Put : .
Put : , so .
Put : , so Continuing in the same way (or by induction on ), .
Now , so . Substituting, This is Newton’s backward difference interpolation formula. (Equivalently: , expanded by the binomial series.)
Error analysis. Let and lie in the interval spanned by the nodes. The interpolation error is where . Proof. Fix not a node and set and chosen so that . Then has zeros (). By Rolle’s theorem applied times, for some ; since and , we get .
In terms of : , so using . The error is small when is small, i.e. near the end of the table – which is why the backward formula is used there.
✓ Proof checked step by step We checked the formula on (exact, as ) and checked that the error term vanishes at every node.
Write the three point Lagrangian interpolating polynomial relative to the points , and . Then by taking the limit , establish the relation where is the error function and
Solution
Three-point Lagrange polynomial on : with error Call the three coefficients .
Taking the limit. Write . Then
- Combining over a common denominator,
- .
- .
- , and .
Hence with . Note on the printed formula. The coefficient of must be (squared denominator), as derived; with alone the formula would not give at unless .
Check. At the right side is ; at it is ; and its derivative at is – this is the quadratic matching (a Hermite-type interpolant).
✓ Checked by computer We checked by computer (SymPy): the limits of the Lagrange coefficients as are exactly the three coefficients derived.
Using Newton’s forward difference formula find the lowest degree polynomial when it is given that , , , and .
Solution
Difference table:
| 1 | 1 | 8 | 8 | 6 | 0 |
| 2 | 9 | 16 | 14 | 6 | |
| 3 | 25 | 30 | 20 | ||
| 4 | 55 | 50 | |||
| 5 | 105 |
, so the lowest-degree polynomial is a cubic. Newton’s forward formula with , , : Putting : Check: . ✓
✓ Checked by computer We checked by computer: gives 1, 9, 25, 55, 105 at .
For given equidistant values , , and , a value is interpolated by Lagrange’s formula. Show that it may be written in the form where .
Solution
The Lagrange polynomial through the four equidistant values (at ) is the unique polynomial of degree taking these values. So it is enough to show that the right-hand side is a polynomial of degree in with the same four values.
Degree. Each term is a polynomial in of degree at most 3. ✓
Values. Recall and .
- (): and , so . ✓
- (): both cubic terms vanish, so . ✓
- (): and , so
- (): and , so Two polynomials of degree that agree at four points are identical. Hence the value interpolated by Lagrange’s formula can be written as (This is Everett’s formula truncated after second differences.)
✓ Proof checked step by step We checked the identity symbolically (SymPy): the right side, with , equals the Lagrange cubic through for all .
Let , for . Estimate the value of using Lagrange interpolating polynomial of degree 3 over the nodes , , and . Also, compute the error bound over the interval and the actual error .
Solution
Interpolating values () and Lagrange coefficients at :
| 0 | 1.000000 | −0.055556 | −0.055556 |
| 0.3 | 1.132647 | 0.396825 | 0.449463 |
| 0.6 | −0.754338 | 0.694444 | −0.523845 |
| 1.0 | −7.315110 | −0.035714 | 0.261254 |
Error bound on . where . Writing and , On , is largest at , where it is about (the crude bound also works). The largest value of on is about (at ). Hence
Actual error at 0.5. , so well within the bound.
✓ Checked by computer We checked by computer: , , on and .
Find the Lagrange interpolating polynomial that fits the following data : Find .
Solution
Lagrange form with nodes : Expanding and collecting, Check: substituting gives . ✓
✓ Checked by computer We checked by computer: passes through all four points and .
In an examination, the number of students who obtained marks between certain limits were given in the following table : Using Newton forward interpolation formula, find the number of students whose marks lie between 45 and 50.
Solution
Interpolate the cumulative frequency = number of students with marks below :
| 40 | 31 | 42 | 9 | -25 | 37 |
| 50 | 73 | 51 | -16 | 12 | |
| 60 | 124 | 35 | -4 | ||
| 70 | 159 | 31 | |||
| 80 | 190 |
Newton’s forward formula with , , :
So about 48 students scored below 45. Students scoring below 50: 73. Hence the number with marks between 45 and 50 is
✓ Checked by computer We checked by computer: the quartic through the five cumulative values gives , so about students.
Find at from the following data :
Solution
Difference table ():
| 0.1 | 0.9975 | -0.0075 | -0.0049 | 0.0001 |
| 0.2 | 0.9900 | -0.0124 | -0.0048 | |
| 0.3 | 0.9776 | -0.0172 | ||
| 0.4 | 0.9604 |
Differentiate Newton’s forward formula with respect to . At (): With :
✓ Checked by computer We checked by computer: differentiating the cubic through the four points at gives .
Draw a flow chart for Lagrange’s interpolation formula.
Solution
Formula. For points , The outer loop runs over (one term per data point); the inner loop over builds the product for that term.
✓ Proof checked step by step We ran the same steps in Python on the data of the 2009 question (six points): it returns , as obtained there by hand.
Using Lagrange interpolation formula, calculate the value of from the following table of values of and :
Solution
For example All six:
| 0 | 1 | ||
| 1 | 14 | ||
| 2 | 15 | ||
| 4 | 5 | ||
| 5 | 6 | ||
| 6 | 19 |
(The add up to 1, as they must.) Adding the last column,
✓ Checked by computer We checked by computer: the degree-5 interpolating polynomial gives exactly.
The following values of the function are given: Construct the quadratic interpolating polynomial that fits the data. Hence calculate . Compare with exact value.
Solution
Use in degrees, .
| 10° | 1.1585 | 0.1232 | -0.0689 |
| 20° | 1.2817 | 0.0543 | |
| 30° | 1.3360 |
Quadratic (Newton’s forward form, ): which expands to Value at (): Exact value: . The error is about (about ); a quadratic through three widely spaced points cannot follow the curve more closely.
✓ Checked by computer We checked by computer: the quadratic gives , while .
More on Numerical Analysis and Computer Programming
- Numerical Analysis and Computer Programming topic-wise PYQs (questions only, for practice)
- Mathematics PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Mathematics booklist
Questions: UPSC Civil Services (Main) Examination, Mathematics Paper II, 2008–2025. Solutions: Optional Province. Found an error? Tell us.

