Next: Explicit Simplifications Using Identities, Previous: Trigonometric and Hyperbolic Functions, Up: Functions and Variables for Trigonometric [Contents][Index]

#### 10.5.2.2 Options Controlling Simplification

Option variable: %piargs ¶

  Default value: `true`

  When `%piargs` is `true`, trigonometric functions are simplified to algebraic constants when the argument is an integer multiple of \(\pi,\) \(\pi/2,\) \(\pi/4,\) or \(\pi/6.\)

  Maxima knows some identities which can be applied when \(\pi\) , etc., are multiplied by an integer variable (that is, a symbol declared to be integer).

  Examples:

      (%i1) %piargs : false$

      (%i2) [sin (%pi), sin (%pi/2), sin (%pi/3)];
                                      %pi       %pi
      (%o2)            [sin(%pi), sin(---), sin(---)]
                                       2         3

      (%i3) [sin (%pi/4), sin (%pi/5), sin (%pi/6)];
                            %pi       %pi       %pi
      (%o3)            [sin(---), sin(---), sin(---)]
                             4         5         6

      (%i4) %piargs : true$

      (%i5) [sin (%pi), sin (%pi/2), sin (%pi/3)];
                                      sqrt(3)
      (%o5)                    [0, 1, -------]
                                         2

      (%i6) [sin (%pi/4), sin (%pi/5), sin (%pi/6)];
                               1         %pi   1
      (%o6)                [-------, sin(---), -]
                            sqrt(2)       5    2

      (%i7) [cos (%pi/3), cos (10*%pi/3), tan (10*%pi/3),
             cos (sqrt(2)*%pi/3)];
                      1    1               sqrt(2) %pi
      (%o7)          [-, - -, sqrt(3), cos(-----------)]
                      2    2                    3

  Some identities are applied when \(\pi\) and \(\pi/2\) are multiplied by an integer variable.

      (%i1) declare (n, integer, m, even)$

      (%i2) [sin (%pi * n), cos (%pi * m), sin (%pi/2 * m),
             cos (%pi/2 * m)];
                                            m/2
      (%o2)                  [0, 1, 0, (- 1)   ]

  Categories: Trigonometric functions · Simplification flags and variables ·

Option variable: %iargs ¶

  Default value: `true`

  When `%iargs` is `true`, trigonometric functions are simplified to hyperbolic functions when the argument is apparently a multiple of the imaginary unit \(i.\)

  Even when the argument is demonstrably real, the simplification is applied; Maxima considers only whether the argument is a literal multiple of \(i.\)

  Examples:

      (%i1) %iargs : false$

      (%i2) [sin (%i * x), cos (%i * x), tan (%i * x)];
      (%o2)           [sin(%i x), cos(%i x), tan(%i x)]

      (%i3) %iargs : true$

      (%i4) [sin (%i * x), cos (%i * x), tan (%i * x)];
      (%o4)           [%i sinh(x), cosh(x), %i tanh(x)]

  Even when the argument is demonstrably real, the simplification is applied.

      (%i1) declare (x, imaginary)$

      (%i2) [featurep (x, imaginary), featurep (x, real)];
      (%o2)                     [true, false]

      (%i3) sin (%i * x);
      (%o3)                      %i sinh(x)

  Categories: Trigonometric functions · Hyperbolic functions · Simplification flags and variables ·

Option variable: halfangles ¶

  Default value: `false`

  When `halfangles` is `true`, trigonometric functions of arguments `expr/2` are simplified to functions of expr.

  For a real argument \(x\) in the interval \(0 \le x < 2\pi,\) \(\sin{x\over 2}\) simplifies to a simple formula: $$ {\sqrt{1-\cos x}\over\sqrt{2}} $$

  A complicated factor is needed to make this formula correct for all complex arguments \(z = x+iy\): $$ (-1)^{\lfloor{x/(2\pi)}\rfloor} \left[1-\rm{unit\_step}(-y) \left(1+(-1)^{\lfloor{x/(2\pi)}\rfloor - \lceil{x/(2\pi)}\rceil}\right)\right] $$

  Maxima knows this factor and similar factors for the functions `sin`, `cos`, `sinh`, and `cosh`. For special values of the argument \(z\) these factors simplify accordingly.

  Examples:

      (%i1) halfangles : false$

      (%i2) sin (x / 2);
                                       x
      (%o2)                        sin(-)
                                       2

      (%i3) halfangles : true$

      (%i4) sin (x / 2);
                                  x
                          floor(-----)
                                2 %pi
                     (- 1)             sqrt(1 - cos(x))
      (%o4)          ----------------------------------
                                  sqrt(2)

      (%i5) assume(x>0, x<2*%pi)$

      (%i6) sin(x / 2);
                              sqrt(1 - cos(x))
      (%o6)                   ----------------
                                  sqrt(2)

  Categories: Trigonometric functions · Simplification flags and variables ·

Option variable: trigsign ¶

  Default value: `true`

  When `trigsign` is `true`, it permits simplification of negative arguments to trigonometric functions. E.g., \(\sin(-x)\) will become \(-\sin x\) only if `trigsign` is `true`.

  Categories: Trigonometric functions · Simplification flags and variables ·

Next: Explicit Simplifications Using Identities, Previous: Trigonometric and Hyperbolic Functions, Up: Functions and Variables for Trigonometric [Contents][Index]

JavaScript license information