# Numerical Methods

 Question 1
Value of $\int_{4}^{5.2}\ln x \; dx$ using Simpson's one-third rule with interval size 0.3 is
 A 1.83 B 1.6 C 1.51 D 1.06
GATE ME 2021 SET-2   Engineering Mathematics
Question 1 Explanation:
\begin{aligned} \text { Here } \qquad f(x)&=\log x\\ a=4, \quad b=5.2, h=0.3\\ \text { So, } \qquad n&=\frac{b-a}{h}=\frac{5.2-4}{0.3}=4\\ \end{aligned}
$\begin{array}{cccccc} \hline x & 4 & 4.3 & 4.6 & 4.9 & 5.2 \\ \hline y & \log 4 & \log 4.3 & \log 4.6 & \log 4.9 & \log 5.2 \\ \hline & y_{0} & y_{1} & y_{2} & y_{3} & y_{4} \end{array}$
As per Simpson's $1 / 3^{\text {rd }}$ rule
\begin{aligned} \int_{4}^{5.2} \log x d x &=\frac{h}{3}\left[y_{0}+y_{4}+4\left(y_{1}+y_{3}\right)+2\left(y_{2}\right)\right] \\ &=1.8272 \simeq 1.83 \end{aligned}
 Question 2
For the integral $\int_{0}^{\pi/2}(8+4 \cos x)dx$, the absolute percentage error in numerical evaluation with the Trapezoidal rule, using only the end points, is ________. (round off to one decimal place).
 A 15.7 B 85.9 C 0.859 D 5.2
GATE ME 2020 SET-2   Engineering Mathematics
Question 2 Explanation:
True value
\begin{aligned} \int_{0}^{\pi / 2}(8+4 \cos x) d x &=[8 x+(4 \sin x)]_{0}^{\pi / 2} \\ &=4 \pi+4=16.566 \end{aligned}
By trapezoidal rule, (single step)

\begin{aligned} h&=\frac{\pi}{2} \\ \text{Approx.} \qquad I&=\frac{\pi}{4}[12+8]=5 \pi=15.707 \end{aligned}
Absolute error = |True value - Approximate value|
\begin{aligned} &=|16.566-15.707|=0.859 \\ \text { Absolute percentage error } &=\frac{0.859}{16.566} \times 100=5.18 \% \approx 5.2 \% \end{aligned}
 Question 3
The evaluation of the definite integral $\int_{-1}^{1.4}x|x|dx$ by using Simpson's $1/3^{rd}$ (one-third) rule with step size h = 0.6 yields
 A 0.914 B 1.248 C 0.581 D 0.592
GATE ME 2020 SET-1   Engineering Mathematics
Question 3 Explanation:
$\int_{-1}^{1.4} x|x| d x \text { step size } h=0.6$

Simpson's $1 / 3^{\text {rd }}$ rule
\begin{aligned} \int_{-1}^{1.4} x|x| d x &=\frac{0.6}{3}[(-1+1.96)+4(-0.16+0.64)+2(0.04)] \\ &=0.2[0.96+1.92+0.08]=0.592 \end{aligned}
 Question 4
Evaluation of $\int_{2}^{4}x^3 dx$ using a 2-equal-segment trapezoidal rule gives a value of______
 A 32 B 88 C 63 D 42
GATE ME 2019 SET-1   Engineering Mathematics
Question 4 Explanation:
\begin{aligned} &\text { Let } y=f(x)=x^{3}\\ &\begin{array}{|c|c|c|c|} \hline \mathrm{x} & 2 & 3 & 4 \\ \hline \mathrm{y} & 8 & 27 & 64 \\ \hline \end{array} \end{aligned}
Given $n=2 \Rightarrow h=\frac{4-2}{2}=1$
By trapezoidal rule, we have
$\int_{2}^{4} x^{3} d x=\frac{h}{2}\left\{\left(y_{0}+y_{n}\right)+2\left(y_{1}+y_{2}+\ldots .+y_{n-1}\right)\right\}=\frac{1}{2}\{(8+64)+2(27)\}=63$
 Question 5
An explicit forward Euler method is used to numerically integrate the differential equation
$\frac{\mathrm{d} y}{\mathrm{d} x}=y$
using a time step of 0.1. With the initial condition y(0) = 1, the value of y(1) computed by this method is ___________ (correct to two decimal places).
 A 2.59 B 1.54 C 2.24 D 3.67
GATE ME 2018 SET-1   Engineering Mathematics
Question 5 Explanation:
\begin{aligned} y_{1} &=y_{0}+h_{A}\left(t_{0}, y_{0}\right) \\ &=y_{0}+h y_{0} \\ &=1+0.1(1) \\ y_{1} &=1.1 \\ y_{2} &=y_{1}+h_{f}\left(t_{1}, y_{1}\right) \\ &=y_{1}+h . y_{1} \\ &=1.1+0.1(1.1) \\ y_{2} &=1.21 \\ y_{3} &=y_{2}+h f\left(t_{2,} y_{2}\right) \\ &=y_{2}+h . y_{2} \\ &=1.21+0.1 \times 1.21 \\ y_{3} &=1.331 \\ y_{4} &=y_{3}+h . f\left(t_{3}, y_{3}\right) \\ &=y_{3}+h . y_{3} \\ &=1.331+0.1 \times 1.331 \\ y_{4} &=1.4641 \\ y_{5} &=y_{4}+h . f\left(t_{4}, y_{4}\right) \\ &=y_{4}+h . y_{4} \\ &=1.4641+0.1 \times(1.4641) \\ &=1.61051 \\ y_{6} &=y_{5}+h . f\left(t_{5}, y_{5}\right) \\ &=y_{5}+h . y_{5} \\ &=1.61051+0.1 \times 1.61051 \end{aligned}
\begin{aligned} y_{6} &=1.771561 \\ y_{7} &=y_{6}+h . f\left(t_{6}, y_{6}\right) \\ &=y_{6}+h \times y_{6} \\ &=1.771561+0.1 \times 1.771561=1.9487 \\ y_{8} &=y_{7}+h . f\left(t_{7}, y_{7}\right) \\ &=y_{7}+h . y_{7} \\ &=1.9487+0.1 \times(1.9487) \\ y_{8} &=2.14357 \\ y_{9} &=y_{8}+h . f\left(t_{8}, y_{8}\right) \\ &=y_{8}+h . y_{8}=2.14357+0.1 \times 2.14357 \\ y_{9} &=2.3579 \\ y_{10} &=y_{9}+h . f\left(t_{9}, y_{9}\right)=y_{9}+h . y_{9} \\ &=2.3579+0.1 \times(2.3579) \\ y_{10} &=2.5937 \end{aligned}
 Question 6
P(0,3), Q(0.5, 4), and R (1,5) are three points on the curve defined by f(x). Numerical integration is carried out using both Trapezoidal rule and Simpson's rule within limits x = 0 and x =1 for the curve. The difference between the two results will be.
 A 0 B 0.25 C 0.5 D 1
GATE ME 2017 SET-1   Engineering Mathematics
Question 6 Explanation:

By Trapezoidal rule
\begin{aligned} \int_{0}^{1} f(x) d x &=\frac{h}{2}\left[\left(y_{0}+y_{2}\right)+2 y_{1}\right] \\ &=\frac{0.5}{2}[(3+5)+2(4)]=4 \end{aligned}
By Simpson rule
$\int_{0}^{1} f(x) d x=\frac{h}{3}\left[\left(y_{0}+y_{2}\right)+4 y_{1}\right]$
$=\frac{0.5}{3}[(3+5)+4(4)]=4$
The difference between the two results will be zero.
 Question 7
The root of the function $f(x)=x^{3}+x-1$ obtained after first iteration on application of NewtonRaphson scheme using an initial guess of $x_{0}=1$ is
 A 0.682 B 0.686 C 0.75 D 1
GATE ME 2016 SET-3   Engineering Mathematics
Question 7 Explanation:
\begin{aligned} f(x)&=x^3+x-1\\ f(1)&=1+1-1=1 \\ f'(x)&=3x^2+1\\ f'(1)&=3+1=4\\ x_1&=x_0-\frac{f(x_0)}{f'(x_0)}\\ &=1-\frac{1}{4}=1-0.25=0.75 \end{aligned}
 Question 8
The error in numerically computing the integral $\int_{0}^{\pi }(\sin x+\cos x )dx$ using the trapezoidal rule with three intervals of equal length between 0 and $\pi$ is
 A 0.186 B 0.12121 C 0.9898 D 0.6587
GATE ME 2016 SET-2   Engineering Mathematics
Question 8 Explanation:
$\begin{array}{|c|c|c|c|c|} \hline x & 0 & \frac{\pi}{3} & \frac{2 \pi}{3} & \pi \\ \hline f(x) & 1 & 1.366 & 0.366 & -1 \\ & y_{0} & y_{1} & y_{2} & y_{3} \\ \hline \end{array}$
By Trapezoidal
$\int_{0}^{\pi}(\sin x+\cos x) d x=\frac{\pi / 3}{2}(1+(-1)+$
\begin{aligned}2(1.366+0.366)) & \\ =\frac{\pi}{3}(1.732)=1.8137\end{aligned}
\begin{aligned}\int_{0}^{\pi}(\sin x+\cos x) d x&=\int_{0}^{\pi / 2}(\sin x+\cos x) d x \\&+\int_{\pi / 2}^{\pi}(\sin x+\cos x) d x\\ =&\left.(-\cos x+\sin x)\right|_{0} ^{\pi / 2}\\&+\left.(-\cos x+\sin x)\right|_{\pi / 2} ^{\pi}\\ =&[(0+1)-(-1+0)]\\&+[(1+0)-(0+1)] | x \\ =& 1+1+1-1 \\ =& 2 \end{aligned}
\begin{aligned} \text{Error}=& \text { Exact value - approx value } \\=& 2-1.8137 \\=& 0.1863 \end{aligned}
 Question 9
Numerical integration using trapezoidal rule gives the best result for a single variable function
 A linear B parabolic C logarithmic D hyperbolic
GATE ME 2016 SET-2   Engineering Mathematics
Question 9 Explanation:
Trapezoidal rule gives the best result in single variable function when the function is linear (degree 1)
 Question 10
Gauss-Seidel method is used to solve the following equations (as per the given order):
$x_{1}+2x_{2}+3x_{3}=5$
$2x_{1}+3x_{2}+x_{3}=1$
$3x_{1}+2x_{2}+x_{3}=3$
Assuming initial guess as $x_{1}=x_{2}=x_{3}=0$ , the value of $x_{3}$ after the first iteration is __________
 A -5 B -6 C -3 D -1
GATE ME 2016 SET-1   Engineering Mathematics
Question 10 Explanation:
The equations are
$x_{1}+2 x_{2}+3 x_{3}=5 \quad \ldots(3)$
$2 x_{1}+3 x_{2}+x_{3}=1 \quad \ldots(2)$
$3 x_{1}+2 x_{2}+x_{3}=3 \quad \ldots(1)$
By poveting we can write
\begin{aligned} 3 x_{1}+2 x_{2}+x_{3} &=3 \\ 2 x_{1}+3 x_{2}+x_{3} &=1 \\ x_{1} &=\frac{3-2 x_{2}-x_{3}}{3} \quad \ldots(1)\\ x_{2} &=\frac{1-2 x_{1}-x_{3}}{3} \quad \ldots(2)\\ x_{1}+2 x_{2}+3 x_{3} &=5 \\ x_{3} &=\frac{5-x_{1}-2 x_{2}}{3} \quad \ldots(3) \end{aligned}
Put $x_{2}=0 \quad x_{3}=0$ in equation (1)
$x_{1}=1$
Put $x_{1}=1 \quad x_{3}=0$ in equation (3)
$x_{2}=-0.333$
Put $x_{1}=1 \quad x_{2}=-0.333$ in equation $(3)$
$x_{3}=1.555$
There are 10 questions to complete.