Re: Table to find lower and upper estimate
- To: mathgroup at smc.vnet.net
- Subject: [mg68164] Re: Table to find lower and upper estimate
- From: Peter Pein <petsie at dordos.net>
- Date: Thu, 27 Jul 2006 05:29:43 -0400 (EDT)
- References: <ea72lp$k6p$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
T Harris schrieb:
> Hello,
>
>
>
> I hope someone could tell me where to look to or if easy enough, to advise
> me on how to use Mathemetica for the type of problem I have below. I
> already have worked it and have the lower estimate to be -475 and the upper
> estimate to be -85. I was hoping to put Mathematica to a practical use here
> and I really don't know how to do this. I have typed the problem in
> exactly as shown in James Stewart's, Calculus 5th Edition.
>
>
>
> Here it is:
>
> A table of values of an increasing function f is shown. Use the table to
> find lower and upper estimates for f(x) dx.
>
> x
> 0
> 5
> 10
> 15
> 20
> 25
>
> f(x)
> -42
> -37
> -25
> -6
> 15
> 36
>
>
>
>
> Thanks to anyone with advice.
>
>
> T Harris
>
>
>
Hello,
you're absolutely right:
In[1]:=
data = Transpose[{5*Range[0, 5], {-42, -37, -25, -6, 15, 36}}]
Out[1]=
{{0, -42}, {5, -37}, {10, -25}, {15, -6}, {20, 15}, {25, 36}}
In[2]:=
lowsum = Total[((#1[[2,1]] - #1[[1,1]])*#1[[1,2]] & ) /@ Partition[data, 2, 1]]
Out[2]=
-475
In[3]:=
highsum = Total[((#1[[2,1]] - #1[[1,1]])*#1[[2,2]] & ) /@ Partition[data, 2, 1]]
Out[3]=
-85
Peter