6.20.4 Riemann sum: sum_riemann
Given a function f on [0,1], the Riemann sum corresponding to
dividing the interval into n equal parts and using the right
endpoints is
The sum_riemann command determines if a sum is such a
Riemann sum, and if it is, evaluates the integral.
-
sum_riemann takes two arguments:
-
expr, an expression depending on two variables.
- [n,k], the list of those two variables.
- sum_riemann(expr,[n,k])
returns
(which, viewing the sum as a Riemann sum of a continuous function on
[0,1], is the definite integral) or returns
"it is probably not a Riemann sum" when the no result is
found.
Exercises.
-
Suppose Sn=∑k=1n k2/n3.
Compute limn → +∞ Sn.
Input:
sum_riemann(k^2/n^3,[n,k])
Output:
- Suppose Sn=∑k=1n k3/n4.
Compute limn → +∞ Sn.
Input:
sum_riemann(k^3/n^4,[n,k])
Output:
- Compute limn → +∞(1/n+1+
1/n+2+…+1/n+n).
Input:
sum_riemann(1/(n+k),[n,k])
Output:
- Suppose Sn=∑k=1n 32n3/16n4−k4.
Compute limn → +∞ Sn.
Input:
sum_riemann(32*n^3/(16*n^4-k^4),[n,k])
Output:
2 arctan | ⎛
⎜
⎜
⎝ | | ⎞
⎟
⎟
⎠ | +ln | ⎛
⎝ | 3 | ⎞
⎠ |