home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / calculat / sm30a.zip / SYMBMATH.H40 < prev    next >
Text File  |  1993-11-07  |  4KB  |  120 lines

  1.           4.8  Sums, Products, Series and Polynomials
  2.  
  3.     You can compute partial, finite or infinite sums and 
  4. products. Sums and products can be differentiated and integrated. You 
  5. construct functions like Taylor polynomials or finite Fourier series.  
  6. The procedure is the same for sums as products so all examples will
  7. be restricted to sums.  The general formats for these functions are:
  8.         sum(expr, x from xmin to xmax)
  9.         sum(expr, x from xmin to xmax step dx)
  10.         prod(expr, x from xmin to xmax)
  11.         prod(expr, x from xmin to xmax step dx)
  12. The expression expr is evaluated at xmin, xmin+dx, ...  up to the last
  13. entry in the series not greater than xmax, and the resulting values
  14. are added or multiplied.  The part "step dx" is optional and defaults 
  15. to 1.  The values of xmin, xmax and dx can be any real number.
  16.  
  17. Here are some examples:
  18.      sum(j, j from 1 to 10)   
  19. for 1 + 2 + .. + 10.
  20.       sum(3^j, j from 0 to 10 step 2)  
  21. for 1 + 3^2 + ... + 3^10.
  22.       Here are some sample Taylor polynomials:
  23.     sum(x^j/j!, j from 0 to n)  
  24. for exp(x).
  25.     sum((-1)^j*x^(2*j+1)/(2*j+1)!, j from 0 to n)
  26. for sin(x) of degree 2*n+2.
  27.  
  28.     Remember, the 3 keywords (from, to and step) can be replaced by
  29. the comma ,.
  30.         
  31.         4.8.1.  Partial Sum
  32.     The function
  33.         partsum(f(x),x)
  34. finds the partial sum (symbolic sum).
  35.  
  36.     Example 4.8.1.1.
  37. Find the sum of 1^2 + 2^2 ... + n^2.       
  38.  
  39. IN:  partsum(n^2, n)
  40. OUT: 1/6 n (1 + n) (1 + 2 n)
  41.  
  42.         4.8.2  Infinite Sum 
  43.     The function
  44.         infsum(f(x),x)  
  45. finds the infinite sum, i.e. sum(f(x), x from 0 to inf).
  46.     Example:
  47.  
  48. IN:  infsum(1/n!, n)
  49. OUT: e
  50.  
  51.         4.8.3.  Series 
  52.     The external functions 
  53.         series(f(x), x)
  54.         series(f(x), x, order)
  55. to find the Taylor series at x=0. The arguement (order) is optional and 
  56. defaults to 5.
  57.     
  58.     Example 4.8.3.1. 
  59. Find the power series expansion for cos(x) at x=0. 
  60.  
  61. IN:  series(cos(x), x)
  62. OUT: 1 - 1/2 x^2 + 1/24 x^4
  63.  
  64.     The series expansion of f(x) is useful for numeric calculation
  65. of f(x). If you can provide derivative of any function of f(x) and f(0),
  66. you may be able to calculate the function value at any x, by series
  67. expansion. Accurary of calculation depends on the order of series
  68. expansion. Higher order, more accuracy, but longer calculation time.
  69.     
  70.     Example 4.8.3.2. 
  71. calculate f(i), knowing f'(x)=-sin(x) and f(0)=1.
  72.  
  73. IN:  f'(x_) := -sin(x)
  74. IN:  f(0) := 1
  75. IN:  f(x_) := eval(series(f(x), x))         #  must eval()
  76. OUT: f(x_) := 1 - 1/2 x^2 + 1/24 x^4
  77. IN:  f(i)
  78. OUT: 37/24
  79.  
  80.                 4.8.4  Polynomials
  81.         Polynomials are automately sorted in order from low to high.
  82.         You can pick up one of coefficient of x in polynomials by
  83.                 coef(poly, x^n)
  84.         e.g.
  85. IN:  coef(x^2+5*x+6, x)
  86. OUT: 5
  87.  
  88.         Note that you cannot pick up the coefficient of x^0 by coef(y,x^0).
  89.         You can pick up one of coefficient of x in polynomials with
  90. order < 5 by
  91.                 coef(poly, x,n)
  92.         e.g.
  93. IN:  coef(x^2+5*x+6, x,0)
  94. OUT: 6
  95.  
  96.         You can pick up all of coefficients of x in polynomials with
  97. order < 5 by
  98.                 coefall(poly, x)
  99.         e.g.
  100. IN:  coefall(x^2+5*x+6, x)
  101. OUT: [6, 5, 1]                    # 6 + 5*x + x^2
  102. IN:  coefall(a*x^2+b*x+c, x)
  103. OUT: [c, b, a]                    # symbolic values of coefficients
  104.  
  105.         You can pick up the highest order of x in polynomials with
  106. order < 5 by
  107.                 order(poly, x)
  108.         e.g.
  109. IN:  order(x^2+5*x+6, x)
  110. OUT: 2
  111.  
  112.         You can factor polynomials in order < 5 with respect with x by
  113.                 factor(poly, x)
  114.         e.g.
  115. IN:  factor(x^2+5*x+6, x)
  116. OUT: (2 + x) (3 + x)
  117.  
  118.         Note that Shareware version of SymbMath cannot do this factor as
  119. it lacks solve().
  120.