145k views
2 votes
Consider the function, f(x) = 1 1 + x 2 .

a. (10 pts) Compute Z 1 −1 f(x) dx using five point Simpson’s method (two Simpson partitions). Show all the calculations in exact arithmetic (i.e. use fractions throughout).
b. (15 pts) Partition the interval [−1, 1] into 5 subintervals. For this partition, compute Z 1 −1 f(x) dx using trapezoid and midpoint methods. Show all the calculations in exact arithmetic

User Nerdburn
by
7.1k points

1 Answer

6 votes

Answer:

a. Simpson method
\int_(-1)^(1)(1)/(x^(2) + 1)\ dx \approx (47)/(30)

b. Trapezoid method
\int_(-1)^(1)(1)/(x^(2) + 1)\ dx \approx (1721)/(1105)

Midpoint method
\int_(-1)^(1)(1)/(x^(2) + 1)\ dx \approx (9378)/(5945)

Explanation:

a. We want to compute
\int_(-1)^(1)(1)/(x^(2) + 1)\ dx using five point Simpson’s method.

The Simpson's rule states that


\int_(a)^(b)f(x)dx\approx\frac{\Delta{x}}{3}(f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+...+2f(x_(n-2))+4f(x_(n-1))+f(x_n))

where
\Delta{x}=(b-a)/(n)

We know that a = −1, b = 1, n = 4.

Therefore,
\Delta{x}=(1-\left(-1\right))/(4)=(1)/(2).

Divide the interval [−1,1] into n = 4 sub-intervals of length
\Delta{x}=(1)/(2)


-1, - (1)/(2), 0, (1)/(2), 1

Now, we just evaluate the function at these endpoints:


f\left(x_(0)\right)=f(a)=f\left(-1\right)=(1)/(2)


4f\left(x_(1)\right)=4f\left(- (1)/(2)\right)=(16)/(5)


2f\left(x_(2)\right)=2f\left(0\right)=2


4f\left(x_(3)\right)=4f\left((1)/(2)\right)=(16)/(5)


f\left(x_(4)\right)=f(b)=f\left(1\right)=(1)/(2)

Finally, just sum up the above values and multiply by
\frac{\Delta{x}}{3}=(1)/(6)


\int_(-1)^(1)(1)/(x^(2) + 1)\ dx \approx (1)/(6)((1)/(2)+(16)/(5)+2+(16)/(5)+(1)/(2))=(47)/(30).

b.

The trapezoidal rule states that


\int_(a)^(b)f(x)dx\approx\frac{\Delta{x}}{2}\left(f(x_0)+2f(x_1)+2f(x_2)+...+2f(x_(n-1))+f(x_n)\right)

where
\Delta{x}=(b-a)/(n)

We know that a = −1, b = 1, n = 5.

Therefore,
\Delta{x}=(1-\left(-1\right))/(5)=(2)/(5).

Divide the interval [−1,1] into n = 5 sub-intervals of length
\Delta{x}=(2)/(5)


-1, - (3)/(5), - (1)/(5), (1)/(5), (3)/(5), 1

Now, we just evaluate the function at these endpoints:


f\left(x_(0)\right)=f(a)=f\left(-1\right)=(1)/(2)


2f\left(x_(1)\right)=2f\left(- (3)/(5)\right)=(25)/(17)


2f\left(x_(2)\right)=2f\left(- (1)/(5)\right)=(25)/(13)


2f\left(x_(3)\right)=2f\left((1)/(5)\right)=(25)/(13)


2f\left(x_(4)\right)=2f\left((3)/(5)\right)=(25)/(17)


f\left(x_(5)\right)=f(b)=f\left(1\right)=(1)/(2)


\int_(-1)^(1)(1)/(x^(2) + 1)\ dx \approx (1)/(5)((1)/(2)+(25)/(17)+(25)/(13)+(25)/(13)+(25)/(17)+(1)/(2))=(1721)/(1105)

The Midpoint method uses the midpoints of sub-interval:


\int_(a)^(b)f(x)dx\approx\Delta{x}\left(f\left((x_0+x_1)/(2)\right)+f\left((x_1+x_2)/(2)\right)+f\left((x_2+x_3)/(2)\right)+...+f\left((x_(n-2)+x_(n-1))/(2)\right)+f\left((x_(n-1)+x_(n))/(2)\right)\right)

where
\Delta{x}=(b-a)/(n)

We know that a = −1, b = 1, n = 5.

Therefore,
\Delta{x}=(1-\left(-1\right))/(5)=(2)/(5).

Divide the interval [−1,1] into n = 5 sub-intervals of length
\Delta{x}=(2)/(5)


-1, - (3)/(5), - (1)/(5), (1)/(5), (3)/(5), 1

Now, we just evaluate the function at these endpoints:


f\left((x_(0)+x_(1))/(2)\right)=f\left((\left(-1\right)+\left(- (3)/(5)\right))/(2)\right)=f\left(- (4)/(5)\right)=(25)/(41)


f\left((x_(1)+x_(2))/(2)\right)=f\left((\left(- (3)/(5)\right)+\left(- (1)/(5)\right))/(2)\right)=f\left(- (2)/(5)\right)=(25)/(29)


f\left((x_(2)+x_(3))/(2)\right)=f\left((\left(- (1)/(5)\right)+\left((1)/(5)\right))/(2)\right)=f\left(0\right)=1


f\left((x_(3)+x_(4))/(2)\right)=f\left((\left((1)/(5)\right)+\left((3)/(5)\right))/(2)\right)=f\left((2)/(5)\right)=(25)/(29)


f\left((x_(4)+x_(5))/(2)\right)=f\left((\left((3)/(5)\right)+\left(1\right))/(2)\right)=f\left((4)/(5)\right)=(25)/(41)


\int_(-1)^(1)(1)/(x^(2) + 1)\ dx \approx (2)/(5)((25)/(41)+(25)/(29)+1+(25)/(29)+(25)/(41))=(9378)/(5945)

User Nibir
by
7.4k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.