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

Question
Answer:
Answer:a. Simpson method [tex]\int_{-1}^{1}\frac{1}{x^{2} + 1}\ dx \approx \frac{47}{30}[/tex]b. Trapezoid method [tex]\int_{-1}^{1}\frac{1}{x^{2} + 1}\ dx \approx \frac{1721}{1105}[/tex]Midpoint method [tex]\int_{-1}^{1}\frac{1}{x^{2} + 1}\ dx \approx \frac{9378}{5945}[/tex]Step-by-step explanation:a. We want to compute [tex]\int_{-1}^{1}\frac{1}{x^{2} + 1}\ dx[/tex] using five point Simpson’s method.The Simpson's rule states that[tex]\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))[/tex]where [tex]\Delta{x}=\frac{b-a}{n}[/tex]We know that a = −1, b = 1, n = 4.Therefore, [tex]\Delta{x}=\frac{1-\left(-1\right)}{4}=\frac{1}{2}[/tex].Divide the interval [−1,1] into n = 4 sub-intervals of length [tex]\Delta{x}=\frac{1}{2}[/tex][tex]-1, - \frac{1}{2}, 0, \frac{1}{2}, 1[/tex]Now, we just evaluate the function at these endpoints:[tex]f\left(x_{0}\right)=f(a)=f\left(-1\right)=\frac{1}{2}[/tex][tex]4f\left(x_{1}\right)=4f\left(- \frac{1}{2}\right)=\frac{16}{5}[/tex][tex]2f\left(x_{2}\right)=2f\left(0\right)=2[/tex][tex]4f\left(x_{3}\right)=4f\left(\frac{1}{2}\right)=\frac{16}{5}[/tex][tex]f\left(x_{4}\right)=f(b)=f\left(1\right)=\frac{1}{2}[/tex]Finally, just sum up the above values and multiply by [tex]\frac{\Delta{x}}{3}=\frac{1}{6}[/tex][tex]\int_{-1}^{1}\frac{1}{x^{2} + 1}\ dx \approx \frac{1}{6}(\frac{1}{2}+\frac{16}{5}+2+\frac{16}{5}+\frac{1}{2})=\frac{47}{30}[/tex].b. The trapezoidal rule states that[tex]\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)[/tex]where [tex]\Delta{x}=\frac{b-a}{n}[/tex]We know that a = −1, b = 1, n = 5.Therefore, [tex]\Delta{x}=\frac{1-\left(-1\right)}{5}=\frac{2}{5}[/tex].Divide the interval [−1,1] into n = 5 sub-intervals of length [tex]\Delta{x}=\frac{2}{5}[/tex][tex]-1, - \frac{3}{5}, - \frac{1}{5}, \frac{1}{5}, \frac{3}{5}, 1[/tex]Now, we just evaluate the function at these endpoints:[tex]f\left(x_{0}\right)=f(a)=f\left(-1\right)=\frac{1}{2}[/tex][tex]2f\left(x_{1}\right)=2f\left(- \frac{3}{5}\right)=\frac{25}{17}[/tex][tex]2f\left(x_{2}\right)=2f\left(- \frac{1}{5}\right)=\frac{25}{13}[/tex][tex]2f\left(x_{3}\right)=2f\left(\frac{1}{5}\right)=\frac{25}{13}[/tex][tex]2f\left(x_{4}\right)=2f\left(\frac{3}{5}\right)=\frac{25}{17}[/tex][tex]f\left(x_{5}\right)=f(b)=f\left(1\right)=\frac{1}{2}[/tex][tex]\int_{-1}^{1}\frac{1}{x^{2} + 1}\ dx \approx \frac{1}{5}(\frac{1}{2}+\frac{25}{17}+\frac{25}{13}+\frac{25}{13}+\frac{25}{17}+\frac{1}{2})=\frac{1721}{1105}[/tex]The Midpoint method uses the midpoints of sub-interval:[tex]\int_{a}^{b}f(x)dx\approx\Delta{x}\left(f\left(\frac{x_0+x_1}{2}\right)+f\left(\frac{x_1+x_2}{2}\right)+f\left(\frac{x_2+x_3}{2}\right)+...+f\left(\frac{x_{n-2}+x_{n-1}}{2}\right)+f\left(\frac{x_{n-1}+x_{n}}{2}\right)\right)[/tex]where [tex]\Delta{x}=\frac{b-a}{n}[/tex]We know that a = −1, b = 1, n = 5.Therefore, [tex]\Delta{x}=\frac{1-\left(-1\right)}{5}=\frac{2}{5}[/tex].Divide the interval [−1,1] into n = 5 sub-intervals of length [tex]\Delta{x}=\frac{2}{5}[/tex][tex]-1, - \frac{3}{5}, - \frac{1}{5}, \frac{1}{5}, \frac{3}{5}, 1[/tex]Now, we just evaluate the function at these endpoints:[tex]f\left(\frac{x_{0}+x_{1}}{2}\right)=f\left(\frac{\left(-1\right)+\left(- \frac{3}{5}\right)}{2}\right)=f\left(- \frac{4}{5}\right)=\frac{25}{41}[/tex][tex]f\left(\frac{x_{1}+x_{2}}{2}\right)=f\left(\frac{\left(- \frac{3}{5}\right)+\left(- \frac{1}{5}\right)}{2}\right)=f\left(- \frac{2}{5}\right)=\frac{25}{29}[/tex][tex]f\left(\frac{x_{2}+x_{3}}{2}\right)=f\left(\frac{\left(- \frac{1}{5}\right)+\left(\frac{1}{5}\right)}{2}\right)=f\left(0\right)=1[/tex][tex]f\left(\frac{x_{3}+x_{4}}{2}\right)=f\left(\frac{\left(\frac{1}{5}\right)+\left(\frac{3}{5}\right)}{2}\right)=f\left(\frac{2}{5}\right)=\frac{25}{29}[/tex][tex]f\left(\frac{x_{4}+x_{5}}{2}\right)=f\left(\frac{\left(\frac{3}{5}\right)+\left(1\right)}{2}\right)=f\left(\frac{4}{5}\right)=\frac{25}{41}[/tex][tex]\int_{-1}^{1}\frac{1}{x^{2} + 1}\ dx \approx \frac{2}{5}(\frac{25}{41}+\frac{25}{29}+1+\frac{25}{29}+\frac{25}{41})=\frac{9378}{5945}[/tex]
solved
general 10 months ago 6694