Skip to main content

Chapter 4

Mathematics for Physics (MAT-303)

TU BBS past exam questions

Past questions and answers

6 questions set from this chapter. Most repeated first.

  • 2081 · MAT-303 · 2+2 marks

Define error in numerical methods with its different kinds. If the number 625.4835625.4835 is approximated to 44 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:
The difference between the exact (true) value and the approximate value obtained by a numerical method is called error. If xx is the true value and x~\tilde{x} is the approximate value, then error is usually taken as
E=x−x~orE=x~−x.E = x - \tilde{x} \quad \text{or} \quad E = \tilde{x} - x.

Different kinds of error:

  • Absolute error: Ea=∣x−x~∣E_a = |x - \tilde{x}|
  • Relative error: Er=∣x−x~∣∣x∣,x≠0E_r = \dfrac{|x - \tilde{x}|}{|x|}, \quad x \neq 0
  • Percentage error: Ep=∣x−x~∣∣x∣×100%E_p = \dfrac{|x - \tilde{x}|}{|x|} \times 100\%

By source, errors are also classified as:

  • Inherent error: due to inexact input data.
  • Truncation error: due to truncating an infinite process or series.
  • Round-off error: due to finite-digit arithmetic.
  • Discretization error: due to approximating a continuous problem by a discrete one.

Numerical part:
True value, x=625.4835x = 625.4835.
Approximating 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\tilde{x} = 625.5

Absolute error: Ea=∣625.5−625.4835∣=0.0165E_a = |625.5 - 625.4835| = 0.0165

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

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

Percentage error≈0.002638%\boxed{\text{Percentage error} \approx 0.002638\%}


OR

MATLAB program for RK-2 method to solve
y′=f(x,y),y(x0)=y0at x=xpy' = f(x,y), \quad y(x_0)=y_0 \quad \text{at } x=x_p

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

% Define the function f(x,y)
f = @(x,y) x + y;      % Change this to the given f(x,y)

% Inputs
x0 = 0;                % initial x
y0 = 1;                % initial y
xp = 1;                % target x
h  = 0.1;              % step size

x = x0;
y = y0;

while x < xp
    if x + h > xp
        h = xp - x;    % adjust last step
    end
    
    k1 = h * f(x, y);
    k2 = h * f(x + h, y + k1);
    
    y = y + (k1 + k2)/2;
    x = x + h;
end

fprintf('At x = %f, y = %f\n', x, y);

Note: For the midpoint RK-2 method, replace the two stages by

k1 = h * f(x, y);
k2 = h * f(x + h/2, y + k1/2);
y = y + k2;

Answer checked by Claude Haiku · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · MAT-303 · 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

Write the system as (Ax=b):

[ A=\begin{bmatrix} 1&1&1\ 2&-3&4\ 3&4&5 \end{bmatrix},\qquad b=\begin{bmatrix} 9\13\40 \end{bmatrix} ]

Using Doolittle’s LU-decomposition, take (A=LU), where (L) is unit lower triangular and (U) is upper triangular.

[ L=\begin{bmatrix} 1&0&0\ 2&1&0\ 3&-\frac15&1 \end{bmatrix},\qquad U=\begin{bmatrix} 1&1&1\ 0&-5&2\ 0&0&\frac{12}{5} \end{bmatrix} ]

Check:

[ LU= \begin{bmatrix} 1&1&1\ 2&-3&4\ 3&4&5 \end{bmatrix}=A ]

Now solve (Ly=b):

[ \begin{bmatrix} 1&0&0\ 2&1&0\ 3&-\frac15&1 \end{bmatrix} \begin{bmatrix} y_1\y_2\y_3 \end{bmatrix}

\begin{bmatrix} 9\13\40 \end{bmatrix} ]

From the first row:

[ y_1=9 ]

From the second row:

[ 2y_1+y_2=13 ]

[ 18+y_2=13 \Rightarrow y_2=-5 ]

From the third row:

[ 3y_1-\frac15y_2+y_3=40 ]

[ 27-\frac15(-5)+y_3=40 ]

[ 27+1+y_3=40 \Rightarrow y_3=12 ]

So,

[ y=\begin{bmatrix} 9\-5\12 \end{bmatrix} ]

Now solve (Ux=y):

[ \begin{bmatrix} 1&1&1\ 0&-5&2\ 0&0&\frac{12}{5} \end{bmatrix} \begin{bmatrix} x\y\z \end{bmatrix}

\begin{bmatrix} 9\-5\12 \end{bmatrix} ]

From the third row:

[ \frac{12}{5}z=12 ]

[ z=5 ]

From the second row:

[ -5y+2z=-5 ]

[ -5y+10=-5 ]

[ -5y=-15 \Rightarrow y=3 ]

From the first row:

[ x+y+z=9 ]

[ x+3+5=9 ]

[ x=1 ]

Hence the required solution is

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

Verification:

[ 1+3+5=9 ]

[ 2(1)-3(3)+4(5)=2-9+20=13 ]

[ 3(1)+4(3)+5(5)=3+12+25=40 ]

So the solution is correct.

Answer checked by Claude Haiku · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · MAT-303 · 6 marks

Find the value of y(3)y(3) from the following data using Lagrange interpolation formula
xx1144991111
yy1010252540406060

Answer

Using Lagrange’s interpolation formula,

[ y(x)=\sum_{i=0}^{3} y_i \frac{(x-x_0)(x-x_1)\cdots (x-x_{i-1})(x-x_{i+1})\cdots (x-x_3)} {(x_i-x_0)(x_i-x_1)\cdots (x_i-x_{i-1})(x_i-x_{i+1})\cdots (x_i-x_3)} ]

Given points:

[ (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),

[ y(3)=10\frac{(3-4)(3-9)(3-11)}{(1-4)(1-9)(1-11)} +25\frac{(3-1)(3-9)(3-11)}{(4-1)(4-9)(4-11)} ]

[ +40\frac{(3-1)(3-4)(3-11)}{(9-1)(9-4)(9-11)} +60\frac{(3-1)(3-4)(3-9)}{(11-1)(11-4)(11-9)} ]

Now,

[ 10\frac{(-1)(-6)(-8)}{(-3)(-8)(-10)} =10\cdot \frac{1}{5}=2 ]

[ 25\frac{(2)(-6)(-8)}{(3)(-5)(-7)} =25\cdot \frac{32}{35}=\frac{160}{7} ]

[ 40\frac{(2)(-1)(-8)}{(8)(5)(-2)} =40\cdot \left(-\frac15\right)=-8 ]

[ 60\frac{(2)(-1)(-6)}{(10)(7)(2)} =60\cdot \frac{3}{35}=\frac{36}{7} ]

Therefore,

[ y(3)=2+\frac{160}{7}-8+\frac{36}{7} ]

[ =2-8+\frac{196}{7} =-6+28=22 ]

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

Answer checked by Claude Haiku · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · MAT-303 · 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

Let f(x)=3x−cos⁡x−1f(x)=3x-\cos x-1, so we solve f(x)=0f(x)=0.

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.7)=2.1−0.76484−1=0.33516>0f(0.7)=2.1-0.76484-1=0.33516>0, so a root lies between 0.60.6 and 0.70.7.

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})}

Take x0=0.6x_0=0.6, x1=0.7x_1=0.7.

nnxn−1x_{n-1}xnx_nf(xn−1)f(x_{n-1})f(xn)f(x_n)xn+1x_{n+1}
10.60000.7000−0.025336-0.0253360.3351580.3351580.607028
20.70000.6070280.3351580.335158−0.000263-0.0002630.607101
30.6070280.607101−0.000263-0.000263−0.0000027-0.00000270.607102

The last two iterates agree to four decimal places (0.60710.6071).

Root: x≈0.6071x\approx 0.6071.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · MAT-303 · 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

Take n=4n=4 sub-intervals (an even number, as Simpson's 13\tfrac13 rule requires), so h=1−04=0.25h=\dfrac{1-0}{4}=0.25 and f(x)=e−x2f(x)=e^{-x^2}.

iixix_iyi=e−xi2y_i=e^{-x_i^2}
00.001.0000000
10.250.9394131
20.500.7788008
30.750.5697828
41.000.3678794

Simpson's 13\tfrac13 rule: I≈h3[(y0+y4)+4(y1+y3)+2y2]I\approx\frac{h}{3}\left[(y_0+y_4)+4(y_1+y_3)+2y_2\right]

I≈0.253[1.3678794+4(1.5091959)+2(0.7788008)]I\approx\frac{0.25}{3}\left[1.3678794+4(1.5091959)+2(0.7788008)\right]

=0.253[1.3678794+6.0367836+1.5576016]=0.253(8.9622646)=0.746855=\frac{0.25}{3}\left[1.3678794+6.0367836+1.5576016\right]=\frac{0.25}{3}(8.9622646)=0.746855

Result: ∫01e−x2dx≈0.7469\displaystyle\int_0^1e^{-x^2}dx\approx 0.7469.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · MAT-303 · 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

Here f(x,y)=x+sin⁡yf(x,y)=x+\sin y, x0=0x_0=0, y0=1y_0=1, h=0.1h=0.1. Euler's method: yn+1=yn+h (xn+sin⁡yn)y_{n+1}=y_n+h\,(x_n+\sin y_n)

(Use yy in radians.)

nnxnx_nyny_nf(xn,yn)=xn+sin⁡ynf(x_n,y_n)=x_n+\sin y_nyn+1=yn+0.1fy_{n+1}=y_n+0.1f
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 · 2082), TU 4 Yrs BSc 3rd Year Math Physics (Bachelor Level (4 Yrs.)/Science & Tech./III year · Math Physics & Classical Mechanics- PHY 301 (New Course) · 2081), TU 4 Yrs BSc 3rd Year Numerical Methods (Bachelor Level (4 Yrs.) III Year · MAT-303 · 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./III 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 Regular · 2076). Answers are written for this site; check them against your class notes.