All 28 questions UPSC has asked on numerical solution of algebraic, transcendental and linear equations in the Mathematics Optional (Paper II, Numerical Analysis and Computer Programming) from 2008 to 2026, 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):
2026 · 5b 2025 · 5b 2024 · 5b 2023 · 6b 2023 · 8b 2022 · 5b 2021 · 5b 2021 · 7b 2020 · 5b 2020 · 6b 2019 · 5b 2019 · 7b 2018 · 5e 2017 · 5b 2017 · 8b 2015 · 8b 2014 · 5b 2014 · 6b 2013 · 7a 2012 · 5b 2012 · 6c 2010 · 5c 2010 · 7a 2009 · 5c(i) 2009 · 7a 2008 · 5c 2008 · 7a(ii) 2008 · 7b
By using the Newton-Raphson iterative formula, establish the formula to find the cube root of . Use this formula, if established, to find the cube root of 63 correct to four decimal places with the initial approximation 3.9.
Solution
Finding means solving , with . The Newton–Raphson step is which is the required formula.
Cube root of 63. With and :
| 0 | 3.900000 | 3.980671 |
| 1 | 3.980671 | 3.979058 |
| 2 | 3.979058 | 3.979057 |
| 3 | 3.979057 | 3.979057 |
and agree to more than four decimal places, so
✓ Checked by computer We checked by computer: , so the iterates settle at to four decimal places.
Solve the following system of linear equations by Gauss-Seidel method :
Solution
The coefficient matrix is diagonally dominant (, , ), so Gauss–Seidel converges. Solve each equation for its diagonal unknown: Start from and always use the newest values:
| Iteration | |||
|---|---|---|---|
| 1 | 0.9000 | −2.2900 | 3.0670 |
| 2 | 1.0513 | −1.9984 | 3.0098 |
| 3 | 0.9987 | −1.9989 | 2.9994 |
| 4 | 0.9998 | −2.0000 | 3.0000 |
| 5 | 1.0000 | −2.0000 | 3.0000 |
| 6 | 1.0000 | −2.0000 | 3.0000 |
The values have settled, so
✓ Checked by computer We checked by computer: the system has the exact solution , and the iterations above converge to it.
Solve the following system of linear equations by Gauss-Jordan method :
Solution
In the Gauss–Jordan method we reduce the augmented matrix until becomes the identity; the last column is then the solution. :
:
:
:
:
:
So .
Check. , , . ✓
✓ Checked by computer We checked by computer: substituting satisfies all three equations exactly.
Solve the system of linear equations correct up to 4 significant figures by the Gauss-Seidel iterative method. Take initially guessed solution as .
Solution
The matrix is diagonally dominant (, , ), so Gauss–Seidel converges. Write and start from :
| Iteration | |||
|---|---|---|---|
| 1 | 1.57143 | 0.73214 | 0.76587 |
| 2 | 1.45720 | 0.85643 | 0.80619 |
| 3 | 1.46344 | 0.85991 | 0.80627 |
| 4 | 1.46391 | 0.85981 | 0.80619 |
| 5 | 1.46392 | 0.85979 | 0.80619 |
| 6 | 1.46392 | 0.85979 | 0.80619 |
The last two iterations agree to four significant figures, so
✓ Checked by computer We checked by computer: the exact solution is , , .
Compute a root of the equation , in the interval , by Regula-Falsi method, correct to 6 decimal places.
Solution
Let . Then and , so there is a root in .
Regula–falsi replaces the curve by the chord through and : and keeps the sub-interval on which changes sign.
| Step | ||||||
|---|---|---|---|---|---|---|
| 1 | 0.000000 | 3.000000 | 3.000000 | −5.154902 | 1.103631 | 2.288134 |
| 2 | 1.103631 | 3.000000 | 2.288134 | −5.154902 | 1.686611 | 0.796143 |
| 3 | 1.686611 | 3.000000 | 0.796143 | −5.154902 | 1.862319 | 0.206135 |
| 4 | 1.862319 | 3.000000 | 0.206135 | −5.154902 | 1.906064 | 0.049258 |
| 5 | 1.906064 | 3.000000 | 0.049258 | −5.154902 | 1.916418 | 0.011544 |
| 6 | 1.916418 | 3.000000 | 0.011544 | −5.154902 | 1.918839 | 0.002693 |
| 7 | 1.918839 | 3.000000 | 0.002693 | −5.154902 | 1.919404 | 0.000628 |
| 8 | 1.919404 | 3.000000 | 0.000628 | −5.154902 | 1.919535 | 0.000146 |
| 9 | 1.919535 | 3.000000 | 0.000146 | −5.154902 | 1.919566 | 0.000034 |
| 10 | 1.919566 | 3.000000 | 0.000034 | −5.154902 | 1.919573 | 0.000008 |
| 11 | 1.919573 | 3.000000 | 0.000008 | −5.154902 | 1.919575 | 0.000002 |
| 12 | 1.919575 | 3.000000 | 0.000002 | −5.154902 | 1.919575 | 0.000000 |
| 13 | 1.919575 | 3.000000 | 0.000000 | −5.154902 | 1.919575 | 0.000000 |
| 14 | 1.919575 | 3.000000 | 0.000000 | −5.154902 | 1.919575 | 0.000000 |
Because stays at the same end, the left end creeps up to the root while stays fixed. The values of now agree to six decimal places, so
✓ Checked by computer We checked by computer: a bracketing root-finder gives , and changes sign only once on .
Solve, by Gauss elimination method, the system of equations
Solution
Reduce the augmented matrix to upper triangular form: :
:
The triangular system is Back-substitution: , then , then , so .
✓ Checked by computer We checked by computer: the system has the unique solution .
Find a positive root of the equation by a numerical technique using initial values ; and further improve the result using Newton-Raphson method correct to 8 significant figures.
Solution
Let . Then and ; since , there is exactly one root.
Starting from 0 and : regula–falsi.
| Step | ||||||
|---|---|---|---|---|---|---|
| 1 | 0.000000 | 1.570796 | −2.000000 | 3.712389 | 0.549961 | −0.202661 |
| 2 | 0.549961 | 1.570796 | −0.202661 | 3.712389 | 0.602804 | −0.015336 |
| 3 | 0.602804 | 1.570796 | −0.015336 | 3.712389 | 0.606787 | −0.001125 |
This gives .
Improving with Newton–Raphson. :
| 0 | 0.6067866727 | −0.0011245756 | 3.5702307097 | 0.6071016595 |
| 1 | 0.6071016595 | 0.0000000407 | 3.5704894382 | 0.6071016481 |
| 2 | 0.6071016481 | 0.0000000000 | 3.5704894289 | 0.6071016481 |
The last two iterates agree, so to eight significant figures
✓ Checked by computer We checked by computer: the root of is .
Solve the system of equations correct up to 4 significant figures by using Gauss-Seidel method after verifying whether the method is applicable in your transformed form of the system.
Solution
As written, the system is not diagonally dominant (the first equation has ), so Gauss–Seidel is not guaranteed to converge. Reorder the equations so that the largest coefficient sits on the diagonal: Now , and : the matrix is strictly diagonally dominant, so the method converges for any starting vector.
Start from :
| Iteration | |||
|---|---|---|---|
| 1 | −2.00000 | 1.88889 | 2.17094 |
| 2 | −1.59829 | 2.23742 | 1.99372 |
| 3 | −1.37972 | 2.12518 | 1.94373 |
| 4 | −1.42334 | 2.12861 | 1.95663 |
| 5 | −1.42485 | 2.13198 | 1.95657 |
| 6 | −1.42315 | 2.13140 | 1.95614 |
| 7 | −1.42333 | 2.13136 | 1.95620 |
| 8 | −1.42337 | 2.13139 | 1.95621 |
| 9 | −1.42336 | 2.13139 | 1.95620 |
| 10 | −1.42336 | 2.13139 | 1.95620 |
To four significant figures
✓ Checked by computer We checked by computer: the exact solution is , i.e. .
Show that the equation : has one root in the interval and one in . Calculate the negative root correct to four decimal places using Newton-Raphson method.
Solution
.
changes sign on and on , so (being continuous) it has a root in each.
Negative root by Newton–Raphson. . Take :
| 0 | −0.500000 | 0.000585 | 0.071388 | −0.508199 |
| 1 | −0.508199 | −0.000005 | 0.072629 | −0.508129 |
| 2 | −0.508129 | 0.000000 | 0.072618 | −0.508129 |
So the negative root is
✓ Checked by computer We checked by computer: the two roots are and .
For the solution of the system of equations : set up the Gauss-Seidel iterative scheme and iterate three times starting with the initial vector . Also find the exact solutions and compare with the iterated solutions.
Solution
Iterative scheme. The matrix is diagonally dominant (, , ). Solving each equation for its diagonal unknown, Three iterations from :
| Iteration | |||
|---|---|---|---|
| 1 | 1.0000 | 0.8000 | 0.4000 |
| 2 | 0.6000 | 0.9600 | 0.4800 |
| 3 | 0.5200 | 0.9920 | 0.4960 |
Exact solution. Elimination gives Comparison. After three iterations the errors are about , and : after three sweeps every component is within of the exact value, and each further sweep cuts the error by a factor of about 5.
✓ Checked by computer We checked by computer: the exact solution is and the third Gauss–Seidel iterate is as tabulated.
Apply Newton-Raphson method, to find a real root of transcendental equation , correct to three decimal places.
Solution
Let . Since and , there is a root between 2 and 3. Newton–Raphson: , starting at :
| 0 | 2.500000 | −0.205150 | 0.832234 | 2.746505 |
| 1 | 2.746505 | 0.005113 | 0.873075 | 2.740649 |
| 2 | 2.740649 | 0.000003 | 0.872148 | 2.740646 |
Correct to three decimal places,
✓ Checked by computer We checked by computer: the root is .
Apply Gauss-Seidel iteration method to solve the following system of equations : correct to three decimal places.
Solution
We solve the system exactly as printed. (Many books carry this example with first equation ; that version has solution .)
Solve each equation for its diagonal unknown: The first row is not diagonally dominant, but the second and third are strongly so, and the iteration still converges quickly (its iteration matrix has spectral radius about ). From :
| Iteration | |||
|---|---|---|---|
| 1 | 8.5000 | −2.1750 | 0.0738 |
| 2 | 9.6613 | −2.3455 | −0.0680 |
| 3 | 9.6048 | −2.3441 | −0.0621 |
| 4 | 9.6100 | −2.3446 | −0.0627 |
| 5 | 9.6096 | −2.3446 | −0.0626 |
| 6 | 9.6096 | −2.3446 | −0.0627 |
Correct to three decimal places,
✓ Checked by computer We checked by computer: the exact solution of the printed system is ; the iteration matrix has spectral radius about , so Gauss–Seidel converges.
Write down the basic algorithm for solving the equation : by bisection method, correct to 4 decimal places.
Solution
has and , so a root lies in (and only one, as there). Each bisection halves the bracket while keeping the sign change inside it. The root is known to four decimal places once both ends of the bracket round to the same four-decimal number, so that is our stopping test (it needs at least 14 halvings, since ).
ALGORITHM Bisection for f(x) = x·e^x − 1 = 0
1. Define f(x) = x*exp(x) - 1
2. Read a, b (here a = 0, b = 1)
3. If f(a)*f(b) > 0: print "no sign change", stop
4. Repeat
c = (a + b)/2
if f(c) = 0: go to 6
if f(a)*f(c) < 0 then b = c
else a = c
until round(a, 4) = round(b, 4)
5. c = (a + b)/2
6. Print c rounded to 4 decimals, stop
Trace of the first steps (a ← c when , b ← c when ):
| Step | ||||
|---|---|---|---|---|
| 1 | 0.00000 | 1.00000 | 0.50000 | −0.17564 |
| 2 | 0.50000 | 1.00000 | 0.75000 | 0.58775 |
| 3 | 0.50000 | 0.75000 | 0.62500 | 0.16765 |
| 4 | 0.50000 | 0.62500 | 0.56250 | −0.01278 |
| 5 | 0.56250 | 0.62500 | 0.59375 | 0.07514 |
| 6 | 0.56250 | 0.59375 | 0.57812 | 0.03062 |
| 7 | 0.56250 | 0.57812 | 0.57031 | 0.00878 |
| 8 | 0.56250 | 0.57031 | 0.56641 | −0.00204 |
Continuing, after 17 halvings the bracket is ; both ends round to , so the root is .
✓ Checked by computer We ran this algorithm in Python: it stops after 17 halvings with , , giving ; the exact root is .
Explain the main steps of the Gauss-Jordan method and apply this method to find the inverse of the matrix
Solution
Main steps of the Gauss–Jordan method.
- Write the augmented matrix ( to solve , or to find ).
- Choose a pivot in the first column (interchanging rows if needed, preferably the entry of largest size), divide the pivot row by the pivot so that it becomes 1.
- Subtract suitable multiples of the pivot row from every other row, above as well as below, so that the rest of the pivot column becomes 0.
- Repeat with the next column. When the left block has become , the right block is the solution (or ). No back-substitution is needed.
Inverse of the given matrix. :
:
:
:
Check. Row 1 of times column 1 of : ; the other products work out the same way to .
✓ Checked by computer We checked by computer: and .
Write an algorithm in the form of a flow chart for Newton-Raphson method. Describe the cases of failure of this method.
Solution
Flow chart. is the tolerance, the largest number of iterations allowed, a small number used to guard against division by a near-zero derivative.
Cases where Newton–Raphson fails (or behaves badly).
- Zero or very small derivative. If the step is undefined; if is tiny, is thrown far away (the tangent is nearly horizontal).
- Poor starting value. Far from the root the iterates may diverge or converge to a different root. For example with gives iterates that grow without bound.
- Cycling. The iterates can repeat. For with we get
- Multiple roots. At a root of multiplicity (e.g. ) the convergence is only linear, not quadratic; the modified formula restores quadratic convergence.
- Inflection point or wrong-way curvature near the root (e.g. , where each step doubles the distance from the root: ).
- No real root at all (e.g. ): the iterates wander without settling.
✓ Proof checked step by step We traced the flow chart by hand on , : it reaches in four passes and exits through the convergence test.
Find the solution of the system using Gauss-Seidel method (make four iterations).
Solution
Each diagonal entry (10) exceeds the sum of the others in its row (4), so Gauss–Seidel converges. Four iterations from :
| Iteration | ||||
|---|---|---|---|---|
| 1 | 0.3000 | 1.5600 | 2.8860 | −0.1368 |
| 2 | 0.8869 | 1.9523 | 2.9566 | −0.0248 |
| 3 | 0.9836 | 1.9899 | 2.9924 | −0.0042 |
| 4 | 0.9968 | 1.9982 | 2.9987 | −0.0008 |
So, after four iterations, which is the exact solution .
✓ Checked by computer We checked by computer: the exact solution is .
Apply Newton-Raphson method to determine a root of the equation correct up to four decimal places.
Solution
Let . , , so there is a root in . Newton–Raphson from :
| 0 | 1.000000 | −2.177980 | −6.278035 | 0.653079 |
| 1 | 0.653079 | −0.460642 | −3.783942 | 0.531343 |
| 2 | 0.531343 | −0.041803 | −3.111838 | 0.517910 |
| 3 | 0.517910 | −0.000464 | −3.042901 | 0.517757 |
| 4 | 0.517757 | 0.000000 | −3.042124 | 0.517757 |
Correct to four decimal places,
✓ Checked by computer We checked by computer: the root is .
Solve the system of equations using Gauss-Seidel iteration method (Perform three iterations).
Solution
The matrix is symmetric positive definite (tridiagonal 2, −1), so Gauss–Seidel converges. Three iterations from :
| Iteration | |||
|---|---|---|---|
| 1 | 3.5000 | 2.2500 | 1.6250 |
| 2 | 4.6250 | 3.6250 | 2.3125 |
| 3 | 5.3125 | 4.3125 | 2.6562 |
After three iterations . (The iterates are heading for the exact solution .)
✓ Checked by computer We checked by computer: the exact solution is , and the third iterate is as tabulated.
Develop an algorithm for Newton — Raphson method to solve starting with initial iterate , be the number of iterations allowed, eps be the prescribed relative error and delta be the prescribed lower bound for .
Solution
The Newton–Raphson step is . The algorithm must guard against two things: a derivative too close to zero (the step would blow up), and non-convergence (stop after steps). The stopping test uses the relative error .
ALGORITHM Newton–Raphson for f(x) = 0
Input : x0, n (max. iterations), eps (relative error), delta (lower bound for |f'|)
1. i = 1
2. fd = f'(x0)
3. If |fd| < delta then
print "Derivative too small – method fails", stop
4. x1 = x0 - f(x0)/fd
5. If |x1 - x0| < eps*|x1| then
print "Root =", x1, "after", i, "iterations", stop
6. If i >= n then
print "No convergence in", n, "iterations; last value", x1, stop
7. x0 = x1; i = i + 1; go to step 2
Remarks.
- Step 3 is the “delta” test: if delta the tangent is almost horizontal and the next iterate is unreliable.
- In step 5 we write the test as to avoid dividing by when the root is 0.
- Each pass needs one evaluation of and one of .
✓ Checked by computer We ran this algorithm in Python on with , , eps , delta : it stops after 4 iterations at .
Use Newton-Raphson method to find the real root of the equation correct to four decimal places.
Solution
Let , . Since and , a root lies in , and shows it is the only real root. Take (where ):
| 0 | 0.600000 | −0.025336 | 3.564642 | 0.607107 |
| 1 | 0.607107 | 0.000021 | 3.570494 | 0.607102 |
| 2 | 0.607102 | 0.000000 | 3.570489 | 0.607102 |
Correct to four decimal places,
✓ Checked by computer We checked by computer: the root is .
Solve the following system of simultaneous equations, using Gauss-Seidel iterative method :
Solution
As given, the first equation has its largest coefficient on . Interchange the first two equations so that the system is diagonally dominant: From :
| Iteration | |||
|---|---|---|---|
| 1 | 0.8500 | −1.0275 | 1.0109 |
| 2 | 1.0025 | −0.9998 | 0.9998 |
| 3 | 1.0000 | −1.0000 | 1.0000 |
| 4 | 1.0000 | −1.0000 | 1.0000 |
So
✓ Checked by computer We checked by computer: the exact solution is .
Find the positive root of the equation correct up to 6 decimal places by using Newton-Raphson method. Carry out computations only for three iterations.
Solution
Let , .
How many positive roots? rises from 0 to its maximum at and then decays to 0. So has two positive roots: one near and one between 1.6 and 1.7 (, ). The question speaks of “the” positive root; we give both, three iterations each.
Smaller root, :
| 0 | 0.000000 | −1.000000 | 10.000000 | 0.100000 |
| 1 | 0.100000 | −0.009950 | 9.702488 | 0.101026 |
| 2 | 0.101026 | −0.000003 | 9.696407 | 0.101026 |
Larger root, :
| 0 | 1.700000 | −0.055204 | −2.656543 | 1.679219 |
| 1 | 1.679219 | 0.001137 | −2.766065 | 1.679630 |
| 2 | 1.679630 | 0.000000 | −2.763893 | 1.679631 |
After three iterations: and .
✓ Checked by computer We checked by computer: the positive roots are and .
Given the system of equations State the solvability and uniqueness conditions for the system. Give the solution when it exists.
Solution
Eliminate step by step.
Subtract the first equation from the second: , so .
Third equation: , i.e. .
Fourth equation: , i.e. .
Subtracting these two, The determinant of the coefficient matrix is .
Unique solution: . Then
and : the last two equations coincide, so the system is consistent with infinitely many solutions: is arbitrary, and , , .
and : the equations read , so the system is inconsistent – no solution.
✓ Checked by computer We checked by computer: the coefficient determinant is and the solution for is as stated.
The equation has two real roots and . Show that the iterative method given by : is convergent near , if .
Solution
The iteration is with is a fixed point. Since , dividing by ( because ) gives .
Derivative at the fixed point. . For the quadratic, (product of roots), so Convergence. If then . As is continuous near , there is an interval on which . For , the mean value theorem gives so too, and . Hence the method converges to for every starting value close enough to , and the convergence is linear with rate .
(If instead , then and the iterates move away from .)
✓ Proof checked step by step We checked each step against the fixed-point convergence theorem; numerically, () with converges to 3, as predicted.
Develop an algorithm for Regula-Falsi method to find a root of starting with two initial iterates and to the root such that sign sign . Take as the maximum number of iterations allowed and eps be the prescribed error.
Solution
Idea. If and have opposite signs, the chord joining and cuts the -axis at We keep whichever of , still has a sign change, so the root always stays bracketed.
ALGORITHM Regula-Falsi for f(x) = 0
Input : x0, x1 with sign(f(x0)) ≠ sign(f(x1)), n (max. iterations), eps
1. f0 = f(x0); f1 = f(x1)
2. If f0*f1 > 0 then print "Root not bracketed", stop
3. i = 1; xold = x0
4. x2 = (x0*f1 - x1*f0)/(f1 - f0) (chord meets the x-axis)
5. f2 = f(x2)
6. If |x2 - xold| < eps or f2 = 0 then
print "Root =", x2, "after", i, "iterations", stop
7. If f0*f2 < 0 then (root in [x0, x2])
x1 = x2; f1 = f2
else (root in [x2, x1])
x0 = x2; f0 = f2
8. If i >= n then
print "No convergence in", n, "iterations; last value", x2, stop
9. xold = x2; i = i + 1; go to step 4
✓ Checked by computer We ran this algorithm in Python on with , , , eps : it returns after 13 iterations.
Find the smallest positive root of equation using regula-falsi method. Do three iterations.
Solution
Let . and . Since for , there is exactly one root in – the smallest positive root.
| Step | ||||||
|---|---|---|---|---|---|---|
| 1 | 0.000000 | 1.000000 | −1.000000 | 2.177980 | 0.314665 | −0.519871 |
| 2 | 0.314665 | 1.000000 | −0.519871 | 2.177980 | 0.446728 | −0.203545 |
| 3 | 0.446728 | 1.000000 | −0.203545 | 2.177980 | 0.494015 | −0.070802 |
After three iterations (the root is ; regula-falsi approaches it slowly here because the end never moves).
✓ Checked by computer We checked by computer: the smallest positive root is ; the three regula-falsi iterates are as tabulated.
Apply Gauss-Seidel method to calculate , , from the system: with initial values . Carry out computations for two iterations.
Solution
Rearrange the equations so that the dominant coefficient 6 is on the diagonal: Start from :
| Iteration | |||
|---|---|---|---|
| 1 | 4.6667 | 7.6194 | 9.0477 |
| 2 | 4.6662 | 7.6190 | 9.0475 |
After two iterations
✓ Checked by computer We checked by computer: the exact solution is .
Draw a flow chart for solving equation correct to five decimal places by Newton-Raphson method.
Solution
Newton–Raphson: . For five-decimal accuracy we stop when two successive iterates differ by less than ; caps the number of passes, and the test prevents division by zero.
✓ Proof checked step by step We traced the chart on , : it stops after 4 passes with , which is to five decimals.
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–2026. Solutions: Optional Province. Found an error? Tell us.

