0% found this document useful (0 votes)
11 views3 pages

Cat 1

The document outlines the evaluation of the integral ∫1.22.4 log_e x dx using numerical methods: the Trapezoidal rule, Simpson's rule, and Simpson's 3/8 rule, with a specified step size of h = 0.2. It also includes a Newton divided-difference table for a function, requiring the completion of missing entries and the calculation of an interpolating polynomial, along with the relative error in the computation of x + y. Finally, it discusses the use of Lagrange's formula for finding an interpolating polynomial based on given data points.

Uploaded by

Adagala Snr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Cat 1

The document outlines the evaluation of the integral ∫1.22.4 log_e x dx using numerical methods: the Trapezoidal rule, Simpson's rule, and Simpson's 3/8 rule, with a specified step size of h = 0.2. It also includes a Newton divided-difference table for a function, requiring the completion of missing entries and the calculation of an interpolating polynomial, along with the relative error in the computation of x + y. Finally, it discusses the use of Lagrange's formula for finding an interpolating polynomial based on given data points.

Uploaded by

Adagala Snr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Evaluate ∫ସ ହ.ଶ log 𝑒 ௫𝑑𝑥 by using [Taking h = 0.

2] (i) Trapezoidal rule (3marks) (ii) Simpson's rule (3marks) (iii)


Simpson's ଷ ଼ rule, (3marks)

ChatGPT

To evaluate the integral ∫1.22.4log⁡ex dx\int_{1.2}^{2.4} \log_e x \, dx∫1.22.4logexdx using numerical integration
methods with h=0.2h = 0.2h=0.2:

(i) Trapezoidal Rule

The trapezoidal rule formula for approximating the integral ∫abf(x) dx\int_a^b f(x) \, dx∫abf(x)dx with step size hhh is:

∫abf(x) dx≈h2[f(a)+2∑i=1n−1f(xi)+f(b)]\int_a^b f(x) \, dx \approx \frac{h}{2} [f(a) + 2 \sum_{i=1}^{n-1} f(x_i) + f(b)]∫ab


f(x)dx≈2h[f(a)+2∑i=1n−1f(xi)+f(b)]

where h=b−anh = \frac{b - a}{n}h=nb−a and xi=a+i⋅hx_i = a + i \cdot hxi=a+i⋅h for i=1,2,…,n−1i = 1, 2, \ldots, n-1i=1,2,
…,n−1.

Given a=1.2a = 1.2a=1.2, b=2.4b = 2.4b=2.4, and h=0.2h = 0.2h=0.2:

n=b−ah=2.4−1.20.2=6n = \frac{b - a}{h} = \frac{2.4 - 1.2}{0.2} = 6n=hb−a=0.22.4−1.2=6

The evaluation using the trapezoidal rule:

∫1.22.4log⁡ex dx≈0.22[log⁡e(1.2)+2∑i=15log⁡e(1.2+0.2i)+log⁡e(2.4)]\int_{1.2}^{2.4} \log_e x \, dx \approx \frac{0.2}{2} \left[ \


log_e(1.2) + 2 \sum_{i=1}^{5} \log_e(1.2 + 0.2i) + \log_e(2.4) \right]∫1.22.4logexdx≈20.2[loge(1.2)+2∑i=15loge(1.2+0.2i)
+loge(2.4)]

Calculate each log⁡e(1.2+0.2i)\log_e(1.2 + 0.2i)loge(1.2+0.2i) and sum them up, then compute the final result.

(ii) Simpson's Rule

Simpson's rule for approximating ∫abf(x) dx\int_a^b f(x) \, dx∫abf(x)dx with nnn subintervals (where nnn must be even):

∫abf(x) dx≈h3[f(a)+4∑i=1,3,…,n−1f(xi)+2∑i=2,4,…,n−2f(xi)+f(b)]\int_a^b f(x) \, dx \approx \frac{h}{3} [f(a) + 4 \


sum_{i=1,3,\ldots,n-1} f(x_i) + 2 \sum_{i=2,4,\ldots,n-2} f(x_i) + f(b)]∫abf(x)dx≈3h[f(a)+4∑i=1,3,…,n−1f(xi)+2∑i=2,4,…,n−2
f(xi)+f(b)]

where h=b−anh = \frac{b - a}{n}h=nb−a and xi=a+i⋅hx_i = a + i \cdot hxi=a+i⋅h for i=0,1,…,ni = 0, 1, \ldots, ni=0,1,…,n.

For a=1.2a = 1.2a=1.2, b=2.4b = 2.4b=2.4, h=0.2h = 0.2h=0.2, n=6n = 6n=6:

∫1.22.4log⁡ex dx≈0.23[log⁡e(1.2)+4∑i=1,3,5log⁡e(1.2+0.2i)+2∑i=2,4log⁡e(1.2+0.2i)+log⁡e(2.4)]\int_{1.2}^{2.4} \log_e x \, dx \


approx \frac{0.2}{3} \left[ \log_e(1.2) + 4 \sum_{i=1,3,5} \log_e(1.2 + 0.2i) + 2 \sum_{i=2,4} \log_e(1.2 + 0.2i) + \
log_e(2.4) \right]∫1.22.4logexdx≈30.2[loge(1.2)+4∑i=1,3,5loge(1.2+0.2i)+2∑i=2,4loge(1.2+0.2i)+loge(2.4)]

Calculate each log⁡e(1.2+0.2i)\log_e(1.2 + 0.2i)loge(1.2+0.2i) and sum them up accordingly.

(iii) Simpson's 3/8 Rule

Simpson's 3/8 rule is used when nnn is a multiple of 3:


∫abf(x) dx≈3h8[f(a)+3∑i=1,4,…,n−1f(xi)+3∑i=2,5,…,n−2f(xi)+2∑i=3,6,…,n−3f(xi)+f(b)]\int_a^b f(x) \, dx \approx \frac{3h}{8}
[f(a) + 3 \sum_{i=1,4,\ldots,n-1} f(x_i) + 3 \sum_{i=2,5,\ldots,n-2} f(x_i) + 2 \sum_{i=3,6,\ldots,n-3} f(x_i) + f(b)]∫ab
f(x)dx≈83h[f(a)+3∑i=1,4,…,n−1f(xi)+3∑i=2,5,…,n−2f(xi)+2∑i=3,6,…,n−3f(xi)+f(b)]

For a=1.2a = 1.2a=1.2, b=2.4b = 2.4b=2.4, h=0.2h = 0.2h=0.2, n=6n = 6n=6:

∫1.22.4log⁡ex dx≈3⋅0.28[log⁡e(1.2)+3∑i=1,4log⁡e(1.2+0.2i)+3∑i=2,5log⁡e(1.2+0.2i)+2∑i=3log⁡e(1.2+0.2i)+log⁡e(2.4)]\
int_{1.2}^{2.4} \log_e x \, dx \approx \frac{3 \cdot 0.2}{8} \left[ \log_e(1.2) + 3 \sum_{i=1,4} \log_e(1.2 + 0.2i) + 3 \
sum_{i=2,5} \log_e(1.2 + 0.2i) + 2 \sum_{i=3} \log_e(1.2 + 0.2i) + \log_e(2.4) \right]∫1.22.4logexdx≈83⋅0.2[loge
(1.2)+3∑i=1,4loge(1.2+0.2i)+3∑i=2,5loge(1.2+0.2i)+2∑i=3loge(1.2+0.2i)+loge(2.4)]

Calculate each log⁡e(1.2+0.2i)\log_e(1.2 + 0.2i)loge(1.2+0.2i) and sum them up accordingly.

These methods provide approximate values of the integral using different numerical integration techniques. Calculating
each term and summing them will give the respective approximations for the integral using each method.

For a function 𝑓 the Newton divided-difference table is f𝑥௜ [𝑥௜] 𝑓[𝑥௜ ; 𝑥௜ାଵ] 𝑓[𝑥଴; 𝑥ଵ; 𝑥ଶ] 0 0 3 1 ? 3 ? 2 ? (i)

and Δ𝑦 = 0.001 be the absolute errors in 𝑥 = 2.11 and 𝑦 = 4.15, find the relative error in computation of 𝑥 + 𝑦.
Determine the missing entries in the table. (6marks) (ii) Give the interpolating polynomial (𝑥) (5marks) c) If Δ𝑥 = 0.005

(3marks) d) Find the interpolating polynomial for the data using Lagrange’s formula (7 marks) x 1 2 -4 F(x) 3 -5 -4

ChatGPT

Let's address each part of the question step by step.

(i) Completing the Newton Divided-Difference Table

Given the Newton divided-difference table:

x_i & f[x_i] & f[x_i, x_{i+1}] & f[x_i, x_{i+1}, x_{i+2}] \\ \hline 0 & 0 & 3 & ? \\ 1 & ? & 3 & ? \\ 2 & ? & ? & ? \\ \
end{array} \] To complete the table, we use the Newton divided-difference formulas: 1. \( f[x_i] = f(x_i) \) 2. \( f[x_i,
x_{i+1}] = \frac{f[x_{i+1}] - f[x_i]}{x_{i+1} - x_i} \) 3. \( f[x_i, x_{i+1}, x_{i+2}] = \frac{f[x_{i+1}, x_{i+2}] - f[x_i, x_{i+1}]}
{x_{i+2} - x_i} \) Given: - \( f[0] = 0 \) - \( f[0, 1] = 3 \) Now, let's find the missing entries: - **For \( x = 1 \):** \( f[1] = ? \) -
**For \( x = 1 \) and \( x = 2 \):** \( f[1, 2] = ? \) Let's apply the formulas: - \( f[1] = \frac{f[0, 1] - f[0]}{1 - 0} = \frac{3 - 0}
{1} = 3 \) - \( f[1, 2] = \frac{f[2] - f[1]}{2 - 1} = \frac{? - 3}{1} = ? \) Now, using \( f[1, 2] = 3 \): - \( f[0, 1, 2] = \frac{f[1, 2] -
f[0, 1]}{2 - 0} = \frac{3 - 3}{2} = 0 \) So, the completed table is: \[ \begin{array}{c|c} x_i & f[x_i] & f[x_i, x_{i+1}] & f[x_i,
x_{i+1}, x_{i+2}] \\ \hline 0 & 0 & 3 & 0 \\ 1 & 3 & 3 & ? \\ 2 & ? & ? & ? \\ \end{array} \] - \( f[1] = 3 \) - \( f[1, 2] = 3 \) - \(
f[2, 1, 0] = 0 \) (since \( f[0, 1, 2] = 0 \)) To find \( f[2] \): - \( f[2] = f[1] + f[1, 2] = 3 + 3 = 6 \) - \( f[2, 1] = \frac{f[1, 2] - f[2]}
{2 - 1} = \frac{3 - 6}{1} = -3 \) Now, the completed table is: \[ \begin{array}{c|c} x_i & f[x_i] & f[x_i, x_{i+1}] & f[x_i,
x_{i+1}, x_{i+2}] \\ \hline 0 & 0 & 3 & 0 \\ 1 & 3 & 3 & -3 \\ 2 & 6 & ? & ? \\ \end{array} \] - \( f[2, 1] = -3 \) - \( f[2, 1, 0] =
0 \) ### (ii) Interpolating Polynomial \( p(x) \) The interpolating polynomial using Newton's divided-difference form is: \
[ p(x) = f[x_0] + (x - x_0) f[x_0, x_1] + (x - x_0)(x - x_1) f[x_0, x_1, x_2] \] Substituting the values: \[ p(x) = 0 + (x - 0) \cdot
3 + (x - 0)(x - 1) \cdot (-3) \] \[ p(x) = 3x - 3x^2 \] So, the interpolating polynomial \( p(x) \) is \( 3x - 3x^2 \). ### (c)
Relative Error Calculation Given: - \( \Delta x = 0.005 \) (absolute error in \( x = 2.11 \)) - \( \Delta y = 0.001 \) (absolute
error in \( y = 4.15 \)) Relative error in \( x + y \) is given by: \[ \frac{\Delta(x+y)}{x+y} = \frac{\Delta x}{x} + \frac{\Delta y}
{y} \] Substitute \( x = 2.11 \), \( y = 4.15 \): \[ \frac{\Delta(x+y)}{x+y} = \frac{0.005}{2.11} + \frac{0.001}{4.15} \] Calculate
the values: \[ \frac{0.005}{2.11} \approx 0.00237 \] \[ \frac{0.001}{4.15} \approx 0.00024 \] So, \[ \frac{\Delta(x+y)}
{x+y} \approx 0.00237 + 0.00024 = 0.00261 \] Therefore, the relative error in the computation of \( x + y \) is
approximately \( 0.00261 \). ### (d) Interpolating Polynomial using Lagrange's Formula Given data: \[ \begin{array}{c|c}
x & F(x) \\ \hline 1 & 3 \\ 2 & -5 \\ -4 & -4 \\ \end{array} \] The Lagrange interpolating polynomial \( p(x) \) is given by: \
[ p(x) = \sum_{i=0}^{2} F(x_i) \cdot \ell_i(x) \] where \( \ell_i(x) = \prod_{\substack{0 \leq j \leq 2 \\ j \neq i}} \frac{x - x_j}
{x_i - x_j} \). Calculate \( \ell_i(x) \) for each \( i \): - \( \ell_0(x) = \frac{(x - 2)(x + 4)}{(1 - 2)(1 + 4)} = \frac{(x - 2)(x + 4)}{-5}
= \frac{-x^2 + 2x + 8}{5} \) - \( \ell_1(x) = \frac{(x - 1)(x + 4)}{(2 - 1)(2 + 4)} = \frac{(x - 1)(x + 4)}{6} \) - \( \ell_2(x) = \frac{(x
- 1)(x - 2)}{(-4 - 1)(-4 - 2)} = \frac{(x - 1)(x - 2)}{-15} \) Now, substitute these into \( p(x) \): \[ p(x) = 3 \cdot \ell_0(x) + (-5) \
cdot \ell_1(x) + (-4) \cdot \ell_2(x) \] \[ p(x) = \frac{-3x^2 + 6x + 24}{5} - \frac{5(x^2 + 3x - 4)}{6} + \frac{4(x^2 - 3x + 2)}
{15} \] Simplify to get the final form of \( p(x) \). This completes the solution for the given problem, covering all parts as
requested

You might also like