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

  1.             4.6 Integration
  2.  
  3.     You can find integrals of x^m*e^(x^n), x^m*e^(-x^n),
  4. e^((a*x+b)^n), e^(-(a*x+b)^n), x^m*ln(x)^n, ln(a*x+b)^n, etc., (where m
  5. and n are any real number).        
  6.     It is recommended that to expand the integrand by expand() and/or
  7. by setting the switch expand:=on before symbolic integration.
  8.     If symbolic integration fails, you can define a simple
  9. integral or derivative, (or adding integral into the inte.(x) library),
  10. then do integration again (see Chapter 4.14 Learning from User).
  11.  
  12.         4.6.1 Indefinite Integration
  13.     Find indefinite integrals by
  14.         inte(expr, x)
  15. Note that the arbitrary constant is not represented.
  16.     
  17.     Example 4.6.1. 
  18.         Find indefinite integrals.
  19.  
  20. IN:  assume(a>0), isreal(b):=1
  21. IN:  inte(1/x, x), inte(1/a, a), inte(1/b, b)
  22. OUT: ln(x sign(x)), ln(a), ln(|b|)
  23.  
  24. IN:  inte(sin(x)*e^x, x)
  25. OUT: 1/2 * (sin(x) - cos(x)) * e^x
  26. IN:  inte(sin(x)*cos(x), x)
  27. OUT: (1/2)*sin(x)^2
  28. IN:  inte(x^1.5*exp(x), x)
  29. OUT: ei(1.5, x)
  30.  
  31.     Example 4.6.2. 
  32.         Find indefinite double integrals.
  33.  
  34. IN:  inte(inte(x*y, x), y)
  35. OUT: 1/4 x^2 y^2
  36.  
  37.     Example 4.6.3. 
  38.         Find the line integral.
  39.  
  40. IN:  x:=2*t
  41. IN:  y:=3*t
  42. IN:  z:=5*t
  43. IN:  u:=x+y
  44. IN:  v:=x-y
  45. IN:  w:=x+y+z
  46. IN:  inte(u*d(u,t)+v*d(v,t)+w*d(w,t), t)
  47. OUT: 63 t^2
  48.  
  49.     Example 4.6.4. 
  50.         Integrate x^2*e^x and x^2*e^-x, then expand it by the mean of the
  51. packages "ExpandEi.sm" (expand ei()) and "ExpandGa.sm" (expand gamma()).
  52.  
  53. IN:  inte(x^2*e^x, x)
  54. OUT: ei(2,x)                                 # ei()
  55. IN:  readfile("ExpandEi.sm")
  56. IN:  inte(x^2*e^x, x)
  57. OUT: x^2 e^x - 2 x e^x + 2 e^x               # ei() is expanded
  58.  
  59. IN:  inte(x^2*e^-x, x)
  60. OUT: gamma(2,x)                              # gamma()
  61. IN:  readfile("ExpandGa.sm")           
  62. IN:  inte(x^2*e^-x, x)
  63. OUT: -x^2 e^(-x) - 2 x e^(-x) - 2 e^(-x)     # gamma() is expanded
  64.  
  65.     Defining integrals is similar to defining rules.
  66.     Example 4.6.5
  67.  
  68. IN:  inte(f(x_), x_) := sin(x)
  69. IN:  inte(f(t), t)
  70. OUT: sin(t)
  71.  
  72.         4.6.2 Definite Integration
  73.     Find definite integrals by external functions 
  74.         inte(expr, x from xmin to xmax)
  75.         inte(expr, x from xmin to singularity to xmax)
  76.        
  77.        Example 4.6.6. 
  78.        Find the definite integral of y=exp(1-x) with respect to x taken
  79. from 0 to infinity.
  80.  
  81. IN:  inte(exp(1-x), x from 0 to inf)
  82. OUT: e
  83.  
  84.     Example 4.6.7. 
  85. do discontinuous integration of 1/x^2 and 1/x^3 with discontinuty at x=0.
  86.  
  87. IN:  inte(1/x^2, x from -1 to 2)             # singularity at x=0
  88. OUT: inf
  89. IN:  inte(1/x^3, x from -1 to 1)             # singularity at x=0
  90. OUT: 0
  91. IN:  inte(sqrt((x-1)^2), x from 0 to 2)      # singularity at x=1
  92. OUT: 1
  93.  
  94.         SymbMath usually detect singularity, but sometime it cannot,
  95. in this case you must provide singularity.
  96.         Example:
  97. IN:  inte(1/(x-1)^2, x from 0 to 1 to 2)     # provide singularity at x=1
  98. OUT: inf
  99.  
  100.     Example 4.6.8
  101.         do complex integration.
  102.  
  103. IN:  inte(1/x, x from i to 2*i)
  104. OUT: ln(2)
  105.  
  106.         4.6.3  Numeric Integration: NInte()
  107.     The external function
  108.         ninte(y, x from xmin to xmax)
  109. does numeric integration.
  110.     
  111.     Example 4.6.3.1. 
  112.         Compare numeric and symbolic integrals of 4/(x^2+1) with
  113. respect to x taken from 0 to 1.
  114.  
  115. IN:  ninte(4/(x^2+1), x from 0 to 1)
  116. OUT: 3.1415
  117. IN:  num(inte(4/(x^2+1), x from 0 to 1))
  118. OUT: 3.1416
  119.