home *** CD-ROM | disk | FTP | other *** search
- 7.8 Sums and Products
-
- Users can compute partial, finite or infinite sums and
- products. Sums and products can be differentiated and integrated. You
- construct functions like Taylor polynomials or finite Fourier series.
- The procedure is the same for sums as products so all examples will
- be restricted to sums. The general formats for these functions are:
-
- sum(expr, x from xmin to xmax step dx)
- prod(expr, x from xmin to xmax step dx)
-
- The expression expr is evaluated at xmin, xmin+dx, ... up to the last
- entry in the series not greater than xmax, and the resulting values
- are added or multiplied. The part "step dx" is optional and defaults
- to 1. The values of xmin, xmax and dx can be any real number.
-
- Here are some examples:
- sum(j, j from 1 to 10)
- for 1 + 2 + .. + 10.
- sum(3^j, j from 0 to 10 step 2)
- for 1 + 3^2 + ... + 3^10.
- Here are some sample Taylor polynomials:
- sum(x^j/j!, j from 0 to n)
- for exp(x).
- sum((-1)^j*x^(2*j+1)/(2*j+1)!, j from 0 to n)
- for sin(x) of degree 2*n+2.
-
- The package SUM.sm should be included before computing
- partial and infinite sums, and the package PRODUCT.sm should be
- included before computing partial and infinite products (see 8.8
- Infinite Sum Package).
- Remember, the keywords "from", "to" and "step" can be
- replaced by the comma (,).
-