- #1
Ocasta
- 40
- 0
Homework Statement
Given the following integral and value of n, approximate the integral using the methods indicated (round your answers to six decimal places):
[itex]
\int_0^1 e^{-3x^2} dx
[/itex]
[itex]
n = 4
[/itex]
(a) Trapezoidal Rule
(b) Midpoint Rule
This is the only one I'm having trouble with.
(c) Simpson's Rule
Homework Equations
[itex]
\Delta x = \frac{b-a}{n}
[/itex]
Trapezoid Rule
[itex]
\Delta X \cdot \frac{1}{2} \cdot [ f(0) + 2f(\frac{1}{4}) + 2f(\frac{1}{2}) + 2f(\frac{3}{4}) + f(1) ]
[/itex]
Midpoint Rule <- incorrect
[itex]
\Delta X \cdot [ f(\frac{0 + \frac{1}{4}}{2}) + f(\frac{ \frac{1}{4} + \frac{1}{2} }{2}) + f(\frac{\frac{1}{3} + \frac{3}{4}}{2}) +f(\frac{\frac{3}{4} + 1}{2})]
[/itex]
Simpson's Rule
[itex]
\Delta X \cdot \frac{1}{3} \cdot [ f(0) + 4f(\frac{1}{4}) + 2f(\frac{1}{2}) + 4f(\frac{3}{4}) + f(1) ]
[/itex]
The Attempt at a Solution
I set variable for my f-values.
[itex]
a = f(0) = 1
[/itex]
[itex]
b = f(\frac{1}{4}) \approx 0.82903
[/itex]
[itex]
c = f(\frac{1}{2}) \approx 0.47237
[/itex]
[itex]
d = f(\frac{3}{4}) \approx 0.18498
[/itex]
[itex]
e = f(1) \approx 0.04979
[/itex]
So I plugged everything in and I get
Midpoint Rule
[itex]
\Delta X \cdot [ f(\frac{0 + \frac{1}{4}}{2}) + f(\frac{ \frac{1}{4} + \frac{1}{2} }{2}) + f(\frac{\frac{1}{3} + \frac{3}{4}}{2}) +f(\frac{\frac{3}{4} + 1}{2})]
[/itex]
(a) Trapezoidal Rule
0.5028176513
(b) Midpoint Rule
0.5028176513
(c) Simpson's Rule
0.5042135205
However, my midpoint rule answer is wrong. I do think it's strange that I'm getting exactly the same answer for B as I am for A, but I can't seem to see what I'm doing wrong.
Last edited: