Question: For the function 2 1 ) ( x xf = , find the US and LS in the interval [ 1 , 2 ] for

For the function 2
1)(
x
xf =, find the US and LS in the interval [1,2] for
n =100.
Lets first get the function defined, since it is not a function in the Matlab library.
>> f=inline(1./x.^2)
The dot before the operation symbols tells Matlab to generate a function that can be
evaluated on arrays, in particular vectors.
Next, use the graphing capabilities of Matlab to graph this function on this interval ([1,
2]). As you can see when you do so, because our function is decreasing in any
subinterval the maximum is always on the left end and the minimum in the right end.
Lets first define the \Delta x .
>> deltaX =100/)12( ;
Now generate the vector with the left ends of the intervals. This will be used to give us
the US.
>> xu = linspace deltaX );100,2,1(
Now the vector with the right ends of the intervals fro the LS
>> xl = linspace + deltaX );100,2,1(
Finally a simple command gives us the Riemann sums.
>>= deltaXUS xufsum ))((*
MATH 2414 Lab 1 Matlab Version Page 3of 4
>>= deltaXLS xlfsum ))((*
Remember that we know now that
<=<= USALS
If we define our approximation as the middle point 2
LSUS Aest
+=, then the largest error
we could possibly be making is given by 2
LSUS
error =, what means that
est ||<= errorAA
Now we can compute the estimation of the area and the error
>> Estimate += LSUS 2/)(
>>= LSUSerror 2/)(
Now find an n that is a power of 10 such that the error in the estimation of the area is
less than or equal to 310001.0=.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!