Composite trapezoidal rule and Simpson rule question?

$\begingroup$

We have the following integral $$\int_{1}^{3} \frac x{x^2+4}\; dx$$ and $n=6$. I have to approximate it using composite trapezoidal rule and then composite simpson rule.

Using trapezoidal rule:

$$\int_a^b f(x)\; dx = \frac h2 \left[f(a)+2\sum_{j=1}^{n-1}f(x_j)+f(b)\right]-\frac{b-a}{12}h^2f''(\mu)$$

where $h=\frac{3-1}6=1/3$.

Here is my solution for composite trapezoidal rule and error formula:

$$ h=\frac{b-a}n=\frac{3-1}6=\frac13 \\ \int_a^bf(x)\;dx = \frac h2 \left[f(a)+2\sum_{j=1}^{n-1}f(x_1)+f(b)\right] $$

$$\begin{array}{c|l} x & y \\ \hline 1 & 0.2 \\ \frac43 & 0.2343 \\ \frac53 & 0.2466 \\ 2 & 0.25 \\ \frac73 & 0.2470 \\ \frac83 & 0.2400 \\ 3 & 0.2307 \end{array}$$

$$ \begin{align} \int_1^3\frac x{x^2+4}\;dx & = \frac16[0.2+0.2307+2(0.2343+0.2466+0.25+0.2470+0.24)] \\ & = 0.48065 \end{align} $$

We see that $n=2$.

$$\begin{align} E & =-\frac{b-a}{12}\cdot h^2f''(n) \\ & =-\frac2{12}\cdot\left(\frac13\right)^2\cdot\frac{2n\left(n^2-12\right)}{\left(n^2+n\right)^3} \end{align}$$

Here $n=2$.

$\endgroup$ 5 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like