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

  1.                 4.2 Simplification
  2.     SymbMath automatically simplifies the output expression. 
  3. You can further simplify it by using the built-in variable last 
  4. in a single line again and again until you are happy with the answer.
  5.         Expressions can be expanded by
  6.         expand(x)
  7.         expand := on
  8.         expandexp := on
  9. Remember that the operation by assignment is global while operation by
  10. function is local. So expand(x) only expands the expression x, but the
  11. switch expand := on expands all expressions between the switch expand :=
  12. on and the switch expand := off. Second difference betwen them is that
  13. the switch expand := on only expands a*(b+c) and (b+c)/p, but does not
  14. expands the power (a+b)^2. The expandexp is exp expand.
  15.  
  16.         Example:
  17. IN:  expand((a+b)^2+(b+c)*p)
  18. OUT: a^2 + 2 a b + b^2 + b p + c p
  19. IN:  expand := on
  20. IN:  (a+b)^2 + (b+c)*p
  21. OUT: (a+b)^2 + b p + c p
  22.  
  23. ---------------------------------------------------------------------
  24. ...............    expand(x) ..........................................
  25. (a+b)^2       to          a^2+2*a*b+b^2
  26. (a+b)^n       to          a^n+ ...... +b^n        n is positive integer
  27. ............... expand(x) and expand := on ..........................
  28. a*(b+c)       to          a*b + a*c
  29. (b+c)/p       to          b/p + c/p
  30. ............... expandexp := on .....................................
  31. e^(a+b)          to      e^a *    e^b    
  32. ---------------------------------------------------------------------
  33. where a+b can be many terms or a-b.
  34.  
  35.         Expressions can be factorized by
  36.         factor(x)
  37.         e.g.
  38. IN:  factor(a^2 + 2*a*b + b^2)
  39. OUT: (a + b)^2
  40.  
  41.         Polynomials of order less than 5 can be factorized by
  42.                 factor(y, x)
  43.         Example.
  44. IN:  factor(x^2+5*x+6, x)
  45. OUT: (2 + x) (3 + x)
  46.         Note that Shareware version of SymbMath cannot do this factor as
  47. it lacks solve().
  48.  
  49.     Example 4.2.1. 
  50.         Reduce sqrt(x^2).
  51.  
  52. IN:  sqrt(x^2)
  53. OUT: x*sign(x)
  54.  
  55.     This output can be further simplified if you know proporties of x.
  56.     A first way is to evaluate x*sign(x) when sign(x) = 1 if x is
  57. positive.
  58.  
  59. IN:  sqrt(x^2)
  60. OUT: x*sign(x)
  61. IN:  subs(last, sign(x) = 1)
  62. OUT: x
  63.  
  64. where a special keyword last stands for the last output, e.g. here last
  65. is x*sign(x).
  66.