Riemann Sum - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Education : Student Package : Calculus 1 : Visualization : Riemann Sums : Student/Calculus1/RiemannSum

Riemann Sum

 

Calling Sequence

Parameters

Description

Examples

Riemann Sum Methods

Calling Sequence

RiemannSum(f(x), x = a..b, opts)

RiemannSum(Int(f(x), x = a..b), opts)

Parameters

f(x)

-

algebraic expression in variable 'x'

x

-

name; specify the independent variable

a, b

-

algebraic expressions; specify the interval

opts

-

equation(s) of the form option=value where option is one of boxoptions, functionoptions, iterations, method, outline, output, partition, pointoptions, refinement, showarea, showfunction, showpoints, subpartition, or Student plot options; specify output options

Description

• 

The RiemannSum(f(x), x = a..b, opts) command calculates the Riemann sum of f(x) from a to b using the given method. The first two arguments (function expression and range) can be replaced by a definite integral.

• 

Given a partition P=a=x0,x1,...,xN=b of the interval a,b, the Riemann sum is defined as:

i=1Nfxi* xixi1

  

where the chosen point of each subinterval xi1,xi of the partition is a point xi*  determined by the method. By default, the midpoint Riemann sum is used.

  

If method=procedure is given, the procedure must take the four arguments: fx,x,pi,pi+1 where pi and pi+1 are the end points of an interval and return an algebraic value which is assumed to be a point between the two end points.

• 

By default, the interval is divided into 10 equal-sized subintervals.

• 

These integration methods can be applied interactively, through the ApproximateInt Tutor.

• 

The opts argument can contain any of the Student plot options or any of the following equations that (excluding output, method, and partition) set plot options.

  

 

  

boxoptions = list

  

A list of options for the plot of approximating boxes. For more information on plot options, see plot/options.

  

 

  

functionoptions = list

  

A list of options for the plot of the expression fx.  By default, the expression is plotted as a solid red line. For more information on plot options, see plot/options.

  

 

  

iterations = posint

  

The number of successive refinements in the animation. By default, the value is 6.

  

 

  

method = left, lower, midpoint, random, right, upper, or procedure

  

The method of approximating the integral.  By default, the midpoint Riemann sum is used.

left

left Riemann Sum

lower

lower Riemann Sum

midpoint

midpoint Riemann Sum

random

random selection of point in each interval

right

right Riemann Sum

upper

upper Riemann Sum

procedure

custom procedure

  

If a procedure is given, it must take the four arguments: fx,x,pi,pi+1, where pi and pi+1 are the end points of an interval, and return an algebraic value which is assumed to be a point between the two end points.

  

Note: The random method is not available when the option output=sum is included.

  

 

  

outline = true or false

  

Whether the boxes as a whole are outlined.  Setting this option to true provides a less cluttered image when the partition is large. By default, this value is false.

  

 

  

output = value, sum, plot, or animation

  

This option controls the return value of the function.

– 

output = value specifies that the value of the approximation is returned. Plot options are ignored if output = value.  This is the default.

– 

output = sum specifies that an inert sum with the appropriate summand is returned. Plot options are ignored if output = sum.

– 

output = plot specifies that a plot, which shows the expression and an approximation to the integral on a,b, is displayed.

– 

output = animation specifies that an animation, which shows the expression and approximations using a sequence of partitions, each of which is a refinement of its predecessor, is displayed.

  

 

  

partition = posint, list(algebraic), random[algebraic], or algebraic

  

The partition option controls the partitioning of the interval a,b.

  

By default, the interval is divided into 10 equally spaced subintervals.

  

A positive integer value divides the interval into that number of equally spaced subintervals.

  

A list of algebraic values is assumed to be the partition. If the end points are not included in the partition, they are added.  The values are assumed to be sorted in ascending order.

  

The value random indexed by an algebraic value c creates a random partition with the width of each subinterval chosen in the closed interval 12c,c.  The parameter c must evaluate to a positive value.

  

An arbitrary algebraic expression given as the value of this option is assumed to be a positive integer and is useful only if the output option is sum.

  

 

  

pointoptions = list

  

A list of options for the plot of the chosen points x'[i],fx'[i] for Riemann sums.  By default, these points are plotted as green circles. For more information on plot options, see plot/options.

  

 

  

refinement = halve, random, or numeric in (0, 1)

  

In an animation, the refinement controls how an interval is subpartitioned.  The default is halve.

  

The value halve indicates that the interval is subdivided into two equal subintervals.

  

The value random indicates that the interval is randomly subdivided.  The random value is chosen from the average of two uniform distributions.

  

A numeric value c must be in the open interval 0,1 and indicates the interval p,q is broken into the intervals p,p+cqp and p+cqp,q.

  

 

  

showarea = true or false

  

Whether the approximation of the integral fx is displayed on the plot.  By default, this value is true.

  

 

  

showfunction = true or false

  

Whether the expression fx is plotted.  By default, the value is true.

  

 

  

showpoints = true or false

  

Whether the chosen points x'[i] are marked. These are the points at which the function fx is evaluated to obtain the height of the corresponding box. By default, the value is true.

  

 

  

subpartition = all, width, or area

  

In an animation, the subpartition controls which intervals are subpartitioned each iteration.  The default is all.

  

The value all indicates that every subinterval is subpartitioned.

  

The value width indicates that the interval with greatest width is subpartitioned.  If there is more than one interval with largest width, the leftmost is chosen.

  

The value area indicates that the interval with greatest area is subpartitioned.  If there is more than one interval with largest area, the leftmost is chosen.

  

 

  

caption = anything

  

A caption for the plot.

  

The default caption is constructed from the parameters and the command options. caption = "" disables the default caption. For more information about specifying a caption, see plot/typesetting.

Examples

withStudent[Calculus1]:

RiemannSumsinx,x=0.0..5.0,method=lower

0.0576648694

(1)

RiemannSumxx2x3,x=0..5,method=upper,output=plot,boxoptions=filled=color=pink,transparency=0.5

RiemannSumtanx2x,x=1..1,method=left,output=plot,partition=50

RiemannSumlnx,x=1..100,method=right,output=animation

RiemannSumlnx,x=1..100,method=random,output=animation

Riemann Sum Methods

  

Left Riemann Sum

  

Lower Riemann Sum

  

Midpoint Riemann Sum

  

Right Riemann Sum

  

Upper Riemann Sum

See Also

plot/options

plot/typesetting

Student

Student plot options

Student[Calculus1]

Student[Calculus1][ApproximateInt]

Student[Calculus1][ApproximateIntTutor]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam