Approximating a function

mwoelfel

New member
Joined
Dec 6, 2012
Messages
4
1. Normally when you get a function and you have to approximate it, we
use left hand rectangles or right hand rectangles. There are several that
you could use, but the next logicial one is the Midpoint rule, where you
don't take either the left point or the right point, but the middle point.
(a) Consider the function f(x) = e^x^2. Use the left, right, and midpoint
rectangle rules to approximate the area from 0 to 1 with x = 0.2.
(b) Sketch the graph with the midpoint rectangles.
(c) Repeat with g(x) = x^2-3x + 1 over 0 to 10 with x = 2.
(d) Computer int(0 to 10)x^2-3x+1dx and compare your answers to part c.
 
You should evaluate f(0.0), f(0.2), f(0.4), f(0.6), f(0.8), f(1.0) and have at it!
 
1. Normally when you get a function and you have to approximate it, we
use left hand rectangles or right hand rectangles. There are several that
you could use, but the next logicial one is the Midpoint rule, where you
don't take either the left point or the right point, but the middle point.
You are not talking about approximating the function, you are talking about approximating the integral of the function.

(a) Consider the function f(x) = e^x^2. Use the left, right, and midpoint
rectangle rules to approximate the area from 0 to 1 with x = 0.2.
(b) Sketch the graph with the midpoint rectangles.
(c) Repeat with g(x) = x^2-3x + 1 over 0 to 10 with x = 2.
(d) Computer int(0 to 10)x^2-3x+1dx and compare your answers to part c.
 
End Point (left or right) - Draw a little rectangle. Each is 0.2 wide and the height is what it is.

Mid Point - Draw little trepezoids. Each is 0.2 wide.
 
1. Normally when you get a function and you have to approximate it, we
use left hand rectangles or right hand rectangles. There are several that
you could use, but the next logicial one is the Midpoint rule, where you
don't take either the left point or the right point, but the middle point.

(a) Consider the function f(x) = e^(x^2). Use the left, right, and midpoint

rectangle rules to approximate the area from 0 to 1 with x = 0.2.

(b) Sketch the graph with the midpoint rectangles.

(c) Repeat with g(x) = x^2 - 3x + 1 over 0 to 10 with x = 2.

(d) Computer int(0 to 10)( x^2 - 3x + 1)dx and compare your answers to part c.


Please show your work here so we will know where you are stuck. Here is a link
with forum posting rules/guidelines:


http://www.freemathhelp.com/forum/threads/41538-Read-Before-Posting!!
 
Last edited:
You should evaluate f(0.0), f(0.2), f(0.4), f(0.6), f(0.8), f(1.0) and have at it!
Following this advise, you should make a table: column 1 = x, column 2 = f(x)
You have six points, from which you can draw five rectangles. Every rectangle has width 0.2, and height that depends of which formula you use.

For the approximate integral using "left-hand rectangles" the first rectangle has height f(0.0), ...fifth has height f(0.8). The total area is the sum of the first five table entries times the common width of 0.2 units.

For the approximation with "right-hand rectangles," choose the right hand side of each interval as the height. That is, the first rectangle has height f(0.2) and the final one has height f(1.0). The area of the five rectangles is the sum of the last five table entries (skipping x=0) times the common width of 0.2 units.

Repeat using the average of the two sides of each interval for the height of a rectangle. How do the three approximations compare? Which do you think is more likely to be most accurate?

EDITED after reading Hallsofivy reply:
What I have above is really the trapezoid rule - I agree that the "midpoint" should be found by evaluating the function at the midpoint of each interval - that makes more sense for part (b) of the question to draw the five mid-point rectangles. That means evaluating f(x) at x=0.1, 0.3, 0.5, 0.7, and 0.9. But that is more work!
 
Last edited:
End Point (left or right) - Draw a little rectangle. Each is 0.2 wide and the height is what it is.

Mid Point - Draw little trepezoids. Each is 0.2 wide.
My understanding of the "mid-point" rule is NOT the same as the "trapezoid" rule. The "midpoint" rule has you draw the height of the rectangles at the function value at the midpoint of each interval. For example, to integrate \(\displaystyle x^2\), from 0 to 1 using two intervals, the midpoints of the two intervals are at 1/4 and 3/4 so we would have one rectangle with base 1/2 and height \(\displaystyle (1/4)^2= 1/16\), and so area 1/32, and and one rectangle with base 1/2 and height \(\displaystyle (3/4)^2= 9/16\), and so area 9/32, so the total area is \(\displaystyle 1/32+ 9/32= 10/32= 5/16\).

The "trapezoid" rule for that same problem would have one "trapezoid" (actually a triangle) with height 1/2 and bases 0 and \(\displaystyle (1/2)^2= 1/4\), and so area 1/16, and another trapezoid with height 1/2 and bases 1/4 and 1, and so area 5/16, and so the total area is 1/16+ 5/16= 6/16.

(The "trapezoid" rule does give the average of "left end point" and "right end point" methods. We might also point out that the "left endpoint", "right endpoint", and "midpoint" rules have the same accuracy for a fixed number of intervals while the "trapezoid" rule gives better accuracy [but requires more calculation]. As far a "most accuracy for a fixed amount of calculation is concerned", Simpson's rule probably is best.)
 
Last edited:
Top