Riemann Sum - Maple Help (2024)

Riemann Sum - Maple Help (1)

Calling Sequence

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

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

Riemann Sum - Maple Help (2)

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=valuewhere optionis one of boxoptions, functionoptions, iterations, method, outline, output, partition, pointoptions, refinement, showarea, showfunction, showpoints, subpartition, or Student plot options; specify output options

Riemann Sum - Maple Help (3)

Description

The RiemannSum(f(x), x = a..b, opts)command calculates the Riemann sumof f(x)from ato busing 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=bof the interval a,b, the Riemann sum is defined as:

i=1N⁡f⁡xi* ⁢xixi1

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

If method=procedureis given, the proceduremust take the four arguments: f⁡x,x,pi,pi+1where piand pi+1are 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 10equal-sized subintervals.

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

The optsargument can contain any of the Student plot optionsor 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 f⁡x. 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: f⁡x,x,pi,pi+1, where piand pi+1are 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 randommethod is not available when the option output=sumis included.

outline =trueor false

Whether the boxes as a whole are outlined. Setting this option to trueprovides 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 = valuespecifies that the value of the approximation is returned. Plot options are ignored if output = value. This is the default.

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

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

output = animationspecifies 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 partitionoption controls the partitioning of the interval a,b.

By default, the interval is divided into 10equally 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 randomindexed by an algebraic value ccreates a random partition with the width of each subinterval chosen in the closed interval c2,c. The parameter cmust 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],f⁡x'⁢[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 halveindicates that the interval is subdivided into two equal subintervals.

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

A numeric value cmust be in the open interval 0,1and indicates the interval p,qis broken into the intervals p,p+c⁢qpand p+c⁢qp,q.

showarea =trueor false

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

showfunction =trueor false

Whether the expression f⁡xis plotted. By default, the value is true.

showpoints =trueor false

Whether the chosen points x'⁢[i]are marked. These are the points at which the function f⁡xis 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 allindicates that every subinterval is subpartitioned.

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

The value areaindicates 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.

Riemann Sum - Maple Help (4)

Examples

>

with⁡StudentCalculus1:

>

RiemannSum⁡sin⁡x,x=0.0..5.0,method=lower

−0.0576648694

(1)
>

RiemannSum⁡x⁢x2⁢x3,x=0..5,method=upper,output=plot

Riemann Sum - Maple Help (5)

>

RiemannSum⁡tan⁡x2⁢x,x=1..1,method=left,output=plot,partition=20,boxoptions=filled=color=Burgundy

Riemann Sum - Maple Help (6)

The following table illustrates the available methods.

>

optsoutput=plot,partition=13,size=300,300,tickmarks=,,labels=,:DocumentTools:-Tabulate⁡RiemannSum⁡sin⁡x,x=0..Pi,method=left,caption=left Riemann sum,opts,RiemannSum⁡sin⁡x,x=0..Pi,method=right,caption=right Riemann sum,opts,RiemannSum⁡sin⁡x,x=0..Pi,method=lower,caption=lower Riemann sum,opts,RiemannSum⁡sin⁡x,x=0..Pi,method=upper,caption=upper Riemann sum,opts,RiemannSum⁡sin⁡x,x=0..Pi,method=midpoint,caption=midpoint Riemann sum,opts,RiemannSum⁡sin⁡x,x=0..Pi,method=random,caption=random Riemann sum,opts,widthmode=pixels,width=600:

Riemann Sum - Maple Help (7)

Riemann Sum - Maple Help (8)

Riemann Sum - Maple Help (9)

Riemann Sum - Maple Help (10)

Riemann Sum - Maple Help (11)

Riemann Sum - Maple Help (12)

To play the following animations in this help page, right-click (Control-click, on Mac) the plot to display the context menu. Select Animation> Play.

>

exact∫1100ln⁡xⅆx

exact≔99+200⁢ln⁡2+200⁢ln⁡5

(2)
>

evalf⁡exact

361.5170185

(3)
>

RiemannSum⁡ln⁡x,x=1..100,method=right,outline=true,output=animation

Riemann Sum - Maple Help (13)

>

RiemannSum⁡ln⁡x,x=1..100,method=random,outline=true,output=animation

Riemann Sum - Maple Help (14)

Riemann Sum - Maple Help (15)

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]

Riemann Sum - Maple Help (2024)
Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 6114

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.