### The Maxima on-line user's manual

Algebra Calculator

#### Halfangles

-- 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 < x < 2*%pi` the sine of the half-angle simplifies to a simple formula:

sqrt(1 - cos(x)) ---------------- sqrt(2)

A complicated factor is needed to make this formula correct for all complex arguments <z>:

realpart(z) floor(-----------) 2 %pi (- 1) (1 - unit_step(- imagpart(z))

realpart(z) realpart(z) floor(-----------) - ceiling(-----------) 2 %pi 2 %pi ((- 1) + 1))

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;
(%o1)                                false
(%i2) sin(x/2);
x
(%o2)                               sin(-)
2
(%i3) halfangles:true;
(%o3)                                true
(%i4) sin(x/2);
x
floor(-----)
2 %pi
sqrt(1 - cos(x)) (- 1)
(%o4)                 ----------------------------------
sqrt(2)
(%i5) assume(x>0, x<2*%pi)\$
(%i6) sin(x/2);
sqrt(1 - cos(x))
(%o6)                          ----------------
sqrt(2)```

```(%o1)                                true
(%i2) ```

? halfangles;

Calculate

? halfangles;

Calculate