Skip to main content

Chapter 11

Numerical Methods for Algebraic and Transcendental Equations

TU BSc past exam questions

Past questions and answers

6 questions set from this chapter. Most repeated first.

  • 2081 · Numerical Methods (MAT-303) (Elective, New Course) · 2+2 marks

Define error in numerical methods with its different kinds. If the number 625.4835 is approximated to 4 significant digits then find the percentage error in the number. OR Write a Matlab program to solve the IVP : y′=f(x,y),y(x0)=y0y' = f(x, y), y(x_0) = y_0 at x=xpx = x_p RK-2 method with step size hh.

Answer

Error in Numerical Methods

Definition. In numerical computation we replace the exact (true) value xx of a quantity by an approximate value xˉ\bar{x}. The difference between the two is called the error:

E=x−xˉ(true value−approximate value)E = x - \bar{x} \quad (\text{true value} - \text{approximate value})

Kinds of error

KindMeaning
Absolute errorEa=∣x−xˉ∣E_a = \lvert x - \bar{x}\rvert — the actual magnitude of the difference
Relative errorEr=∣x−xˉ∣∣x∣E_r = \dfrac{\lvert x - \bar{x}\rvert}{\lvert x\rvert} — error measured per unit of the true value
Percentage errorEp=∣x−xˉ∣∣x∣×100%E_p = \dfrac{\lvert x - \bar{x}\rvert}{\lvert x\rvert}\times 100\%
Inherent errorError already present in the given data or in the mathematical model itself
Round-off errorError caused by retaining only a fixed number of digits (rounding)
Truncation errorError caused by cutting off an infinite process, e.g. a Taylor series after a few terms

Numerical part

Given: true value x=625.4835x = 625.4835, to be approximated to 4 significant digits.

The first four significant digits are 6, 2, 5, 46,\,2,\,5,\,4; the next digit is 8≥58 \ge 5, so we round up:

xˉ=625.5\bar{x} = 625.5

Absolute error: Ea=∣625.4835−625.5∣=0.0165E_a = \lvert 625.4835 - 625.5\rvert = 0.0165

Relative error: Er=0.0165625.4835=2.638×10−5E_r = \frac{0.0165}{625.4835} = 2.638\times 10^{-5}

Percentage error: Ep=2.638×10−5×100%=2.638×10−3%≈0.00264%E_p = 2.638\times 10^{-5}\times 100\% = 2.638\times 10^{-3}\% \approx 0.00264\%

Result: The percentage error is approximately 0.00264%\boxed{0.00264\%}.


OR — MATLAB program for RK-2 (Heun's) method

y′=f(x,y),y(x0)=y0,find y(xp), step hy' = f(x,y),\qquad y(x_0)=y_0,\qquad \text{find } y(x_p),\ \text{step } h

Heun's RK-2 formulas: k1=h f(xn,yn),k2=h f(xn+h,  yn+k1)k_1 = h\,f(x_n,y_n),\qquad k_2 = h\,f(x_n+h,\;y_n+k_1) yn+1=yn+12(k1+k2),xn+1=xn+hy_{n+1} = y_n + \tfrac{1}{2}(k_1+k_2),\qquad x_{n+1}=x_n+h

% RK-2 (Heun's) method for y' = f(x,y), y(x0) = y0, at x = xp
clc; clear;

f  = @(x,y) x + y;      % <-- enter f(x,y) here
x0 = 0;                 % initial x
y0 = 1;                 % initial y
xp = 0.2;               % point where y is required
h  = 0.05;              % step size

n = round((xp - x0)/h); % number of steps
x = x0;  y = y0;

fprintf('  x        y\n');
fprintf('%6.4f  %10.6f\n', x, y);

for i = 1:n
    k1 = h*f(x, y);
    k2 = h*f(x + h, y + k1);
    y  = y + (k1 + k2)/2;
    x  = x + h;
    fprintf('%6.4f  %10.6f\n', x, y);
end

fprintf('\ny(%.4f) = %.6f\n', xp, y);

Output (for f=x+y, y(0)=1, h=0.05f=x+y,\ y(0)=1,\ h=0.05): y(0.2)≈1.242609y(0.2) \approx 1.242609 (exact value 2e0.2−1−0.2=1.2428062e^{0.2}-1-0.2 = 1.242806).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · Numerical Methods (MAT-303) (Elective, New Course) · 7 marks

Solve the following system of linear equations using LU-decomposition method: x+y+z=9;2x−3y+4z=13;3x+4y+5z=40x + y + z = 9 ; 2x - 3y + 4z = 13; 3x + 4y + 5z = 40 OR Write the algorithm of Gauss elimination method for solving linear system Ax=bAx = b.

Answer

Solve by LU-decomposition (Doolittle method)

Given system:

x+y+z=92x−3y+4z=133x+4y+5z=40\begin{aligned} x+y+z&=9\\ 2x-3y+4z&=13\\ 3x+4y+5z&=40 \end{aligned}

In matrix form, (Ax=b):

A=(1112−34345),b=(91340)A=\begin{pmatrix} 1&1&1\\ 2&-3&4\\ 3&4&5 \end{pmatrix},\qquad b=\begin{pmatrix} 9\\13\\40 \end{pmatrix}

Let

A=LUA=LU

where (L) is unit lower triangular and (U) is upper triangular:

L=(100l2110l31l321),U=(u11u12u130u22u2300u33)L=\begin{pmatrix} 1&0&0\\ l_{21}&1&0\\ l_{31}&l_{32}&1 \end{pmatrix},\qquad U=\begin{pmatrix} u_{11}&u_{12}&u_{13}\\ 0&u_{22}&u_{23}\\ 0&0&u_{33} \end{pmatrix}

Step 1: Find (L) and (U)

From the first row of (U):

u11=1,u12=1,u13=1u_{11}=1,\quad u_{12}=1,\quad u_{13}=1

From the first column of (L):

l21=21=2,l31=31=3l_{21}=\frac{2}{1}=2,\qquad l_{31}=\frac{3}{1}=3

Now compute the second row of (U):

u22=−3−l21u12=−3−2(1)=−5u_{22}=-3-l_{21}u_{12}=-3-2(1)=-5 u23=4−l21u13=4−2(1)=2u_{23}=4-l_{21}u_{13}=4-2(1)=2

Compute (l_{32}):

l32=4−l31u12u22=4−3(1)−5=−15l_{32}=\frac{4-l_{31}u_{12}}{u_{22}} =\frac{4-3(1)}{-5} =-\frac15

Compute (u_{33}):

u33=5−l31u13−l32u23=5−3(1)−(−15)(2)=2+25=125u_{33}=5-l_{31}u_{13}-l_{32}u_{23} =5-3(1)-\left(-\frac15\right)(2) =2+\frac25=\frac{12}{5}

Hence,

L=(1002103−151),U=(1110−5200125)L=\begin{pmatrix} 1&0&0\\ 2&1&0\\ 3&-\frac15&1 \end{pmatrix},\qquad U=\begin{pmatrix} 1&1&1\\ 0&-5&2\\ 0&0&\frac{12}{5} \end{pmatrix}

Step 2: Solve (Ly=b)

Let

y=(y1y2y3)y=\begin{pmatrix} y_1\\y_2\\y_3 \end{pmatrix}

Then

y1=92y1+y2=133y1−15y2+y3=40\begin{aligned} y_1&=9\\ 2y_1+y_2&=13\\ 3y_1-\frac15y_2+y_3&=40 \end{aligned}

From the first equation:

y1=9y_1=9

From the second:

2(9)+y2=13⇒y2=−52(9)+y_2=13 \Rightarrow y_2=-5

From the third:

3(9)−15(−5)+y3=403(9)-\frac15(-5)+y_3=40 27+1+y3=40⇒y3=1227+1+y_3=40 \Rightarrow y_3=12

Thus,

y=(9−512)y=\begin{pmatrix} 9\\-5\\12 \end{pmatrix}

Step 3: Solve (Ux=y)

Let

x=(xyz)x=\begin{pmatrix} x\\y\\z \end{pmatrix}

Then

x+y+z=9−5y+2z=−5125z=12\begin{aligned} x+y+z&=9\\ -5y+2z&=-5\\ \frac{12}{5}z&=12 \end{aligned}

From the last equation:

z=12⋅512=5z=12\cdot\frac{5}{12}=5

From the second equation:

−5y+2(5)=−5-5y+2(5)=-5 −5y+10=−5⇒−5y=−15⇒y=3-5y+10=-5 \Rightarrow -5y=-15 \Rightarrow y=3

From the first equation:

x+3+5=9⇒x=1x+3+5=9 \Rightarrow x=1

Therefore,

x=1,y=3,z=5\boxed{x=1,\quad y=3,\quad z=5}

Verification

2(1)−3(3)+4(5)=2−9+20=132(1)-3(3)+4(5)=2-9+20=13 3(1)+4(3)+5(5)=3+12+25=403(1)+4(3)+5(5)=3+12+25=40

Hence the solution is correct.

Answer checked by Claude Haiku · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · Numerical Methods (MAT-303) (Elective, New Course) · 6 marks

Find the value of y(3)y(3) from the following data using Lagrange interpolation formula
x14911
y10254060

Answer

Using Lagrange’s interpolation formula,

[ y(x)=\sum_{i=0}^{3} y_i \prod_{\substack{j=0\j\ne i}}^{3}\frac{x-x_j}{x_i-x_j} ]

Given:

[ (x_0,y_0)=(1,10),\quad (x_1,y_1)=(4,25),\quad (x_2,y_2)=(9,40),\quad (x_3,y_3)=(11,60) ]

For (x=3),

[ L_0=\frac{(3-4)(3-9)(3-11)}{(1-4)(1-9)(1-11)} =\frac{(-1)(-6)(-8)}{(-3)(-8)(-10)} =\frac{-48}{-240}=\frac15 ]

[ L_1=\frac{(3-1)(3-9)(3-11)}{(4-1)(4-9)(4-11)} =\frac{(2)(-6)(-8)}{(3)(-5)(-7)} =\frac{96}{105}=\frac{32}{35} ]

[ L_2=\frac{(3-1)(3-4)(3-11)}{(9-1)(9-4)(9-11)} =\frac{(2)(-1)(-8)}{(8)(5)(-2)} =\frac{16}{-80}=-\frac15 ]

[ L_3=\frac{(3-1)(3-4)(3-9)}{(11-1)(11-4)(11-9)} =\frac{(2)(-1)(-6)}{(10)(7)(2)} =\frac{12}{140}=\frac{3}{35} ]

Now,

[ y(3)=10L_0+25L_1+40L_2+60L_3 ]

[ =10\left(\frac15\right)+25\left(\frac{32}{35}\right)+40\left(-\frac15\right)+60\left(\frac{3}{35}\right) ]

[ =2+\frac{160}{7}-8+\frac{36}{7} ]

[ =-6+\frac{196}{7} ]

[ =-6+28=22 ]

[ \boxed{y(3)=22} ]

Answer checked by Claude Haiku · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · Numerical Methods (MAT-303) (Elective, New Course) · 6 marks

Find a real root of the equation 3x=cos⁡x+13x = \cos x + 1 using secant method correct to four decimal places.

Answer

Secant method for 3x=cos⁡x+13x=\cos x+1

Let f(x)=3x−cos⁡x−1f(x)=3x-\cos x-1.

Locating the root: f(0.6)=1.8−0.82534−1=−0.02534<0f(0.6)=1.8-0.82534-1=-0.02534<0 and f(0.62)=1.86−0.81388−1=0.04612>0f(0.62)=1.86-0.81388-1=0.04612>0, so a root lies in (0.6, 0.62)(0.6,\,0.62). Take x0=0.6x_0=0.6, x1=0.62x_1=0.62 (angles in radians).

Secant formula:

xn+1=xn−f(xn) (xn−xn−1)f(xn)−f(xn−1)x_{n+1}=x_n-\frac{f(x_n)\,(x_n-x_{n-1})}{f(x_n)-f(x_{n-1})}

nnxn−1x_{n-1}xnx_nf(xn−1)f(x_{n-1})f(xn)f(x_n)xn+1x_{n+1}
10.60.62−0.025336-0.0253360.0461220.0461220.607091
20.620.6070910.0461220.046122−0.000038-0.0000380.607102
30.6070910.607102−0.000038-0.000038≈0\approx00.607102

The last two iterates agree to four decimal places (0.60710.6071), so the iteration has converged.

Root: x≈0.6071x\approx 0.6071

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · Numerical Methods (MAT-303) (Elective, New Course) · 6 marks

Use Simpson's −13-\frac{1}{3} rule to evaluate ∫01e−x2dx\int_0^1 e^{-x^2} dx taking suitable number of sub-intervals.

Answer

Simpson's 1/3 rule for ∫01e−x2dx\displaystyle\int_0^1 e^{-x^2}dx

Take n=4n=4 sub-intervals (an even number, as the rule requires), so h=1−04=0.25h=\dfrac{1-0}{4}=0.25. Let y=e−x2y=e^{-x^2}.

xx00.250.50.751
yy1.0000000.9394130.7788010.5697830.367879
y0y_0y1y_1y2y_2y3y_3y4y_4

∫01e−x2dx≈h3[y0+y4+4(y1+y3)+2y2]\int_0^1 e^{-x^2}dx\approx\frac h3\left[y_0+y_4+4(y_1+y_3)+2y_2\right]

=0.253[1+0.367879+4(0.939413+0.569783)+2(0.778801)]=\frac{0.25}{3}\left[1+0.367879+4(0.939413+0.569783)+2(0.778801)\right]

=0.253[1.367879+6.036784+1.557602]=0.253(8.962265)≈0.74686=\frac{0.25}{3}\left[1.367879+6.036784+1.557602\right]=\frac{0.25}{3}(8.962265)\approx0.74686

Result: ∫01e−x2dx≈0.7469\displaystyle\int_0^1 e^{-x^2}dx\approx0.7469 (the exact value is 0.746820.74682).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · Numerical Methods (MAT-303) (Elective, New Course) · 6 marks

Given IVP: dydx=x+sin⁡y,y(0)=1\frac{dy}{dx} = x + \sin y, y(0) = 1 use Euler's method to find yy at x=1x = 1. Take h=0.1h = 0.1.

Answer

Euler's method for y′=x+sin⁡y, y(0)=1, h=0.1y'=x+\sin y,\ y(0)=1,\ h=0.1

Formula: yn+1=yn+h f(xn,yn)=yn+0.1 (xn+sin⁡yn)y_{n+1}=y_n+h\,f(x_n,y_n)=y_n+0.1\,(x_n+\sin y_n), with f(x,y)=x+sin⁡yf(x,y)=x+\sin y (angles in radians).

nnxnx_nyny_nf(xn,yn)f(x_n,y_n)yn+1y_{n+1}
00.01.00000.84151.0841
10.11.08410.98391.1825
20.21.18251.12561.2951
30.31.29511.26221.4213
40.41.42131.38881.5602
50.51.56021.49991.7102
60.61.71021.59031.8692
70.71.86921.65582.0348
80.82.03481.69432.2042
90.92.20421.70602.3748

Result: y(1)≈2.375y(1)\approx 2.375

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

Questions from TU 4 Years BSc 3rd Year Math Physics (Bachelor Level (4 Yrs.)/Science & Tech. / III year · Math Physics & Classical Mechanics PHY 301 (New Course) · 2082), TU 4 Yrs BSc 3rd Year Math Physics (Bachelor Level (4 Yrs.)/Science & Tech. / III year · PHY 301 (New Course) · 2081), TU 4 Yrs BSc 3rd Year Numerical Methods (Bachelor Level (4 Yrs.) III Year/Science & Tech. · Numerical Methods (MAT-303) (Elective, New Course) · 2081), TU 4 Yrs BSc 3rd Year Research (Bachelor Level (4 Yrs.)/Science & Tech./III Year · R.M. 305 · 2081), TU 4 Yrs BSc 3rd Year Operations (Bachelor Level (4 Yrs.) Science & Tech. 3rd Year · Operations Research (STA.304) Elective · 2078) and TU BSc 3rd Year Operations Research (Bachelor Level (4 Yrs.)/Science & Tech./III Year · Operations Research (STA.304) Elective · 2076). Answers are written for this site; check them against your class notes.