? halfangles;

Calculate

? halfangles;

Calculate

### halfangles

Run Example
```(%i1)halfangles:true;
(%o1)                                true
(%i2) (3-4*cos(2*x)+cos(4*x))/8, expand;
cos(4 x)   cos(2 x)   3
(%o2)                       -------- - -------- + -
8          2       8
(%i3) integrate(cos(4*x)/8, x);
sin(4 x)
(%o3)                              --------
32
(%i4) integrate(cos(2*x)/2, x);
sin(2 x)
(%o4)                              --------
4
(%i5) integrate(3/8, x);
3 x
(%o5)                                 ---
8
(%i6) integrate((3-4*cos(2*x)+cos(4*x))/8, x), expand;
sin(4 x)   sin(2 x)   3 x
(%o6)                      -------- - -------- + ---
32         4        8
(%i7) integrate(sin(x)^4, x), expand;
sin(4 x)   sin(2 x)   3 x
(%o7)                      -------- - -------- + ---
32         4        8
(%i8) integrate(sin(x)^4, x), factor;
sin(4 x) - 8 sin(2 x) + 12 x
(%o8)                    ----------------------------
32
(%i9) sin(x)^3*sin(x)^2, trigreduce, factor;
sin(5 x) - 5 sin(3 x) + 10 sin(x)
(%o9)                  ---------------------------------
16
(%i10) ```
Run Example
```declare(z, [scalar, real]);
(%o1)                                done
(%i2) declare(q, [scalar, real]);
(%o2)                                done
(%i3) declare(a, [scalar, real]);
(%o3)                                done
(%i4) declare(b, [scalar, real]);
(%o4)                                done
(%i5) declare(c, [scalar, real]);
(%o5)                                done
(%i6) declare(d, [scalar, real]);
(%o6)                                done
(%i7) halfangles:true;
(%o7)                                true
(%i8) trigexpand:true;
(%o8)                                true
(%i9) z : 0.5 * q * %pi;
(%o9)                              0.5 %pi q
(%i10) basesin(q) := sin(''z);
(%o10)                   basesin(q) := sin(0.5 %pi q)
(%i11) deltasin(q) := 0.5 * %pi * cos(''z);
(%o11)               deltasin(q) := 0.5 %pi cos(0.5 %pi q)
(%i12) S7(q) := a*q + b*q^3 + c*q^5 + d*q^7;
3      5      7
(%o12)                 S7(q) := a q + b q  + c q  + d q
(%i13) s7diff: derivative(S7(q),q);
6        4        2
(%o13)                   7 d q  + 5 c q  + 3 b q  + a
(%i14) S7p(q) := ''s7diff;
6        4        2
(%o14)              S7p(q) := 7 d q  + 5 c q  + 3 b q  + a
(%i15) trigsimp(trigrat(solve([S7(1)=basesin(1), S7p(0)=deltasin(0), S7p(1)=deltasin(1), S7p(.5)=deltasin(0.5)], [a,b,c,d])));

rat: replaced -0.5 by -1/2 = -0.5

rat: replaced -0.5 by -1/2 = -0.5

rat: replaced -0.5 by -1/2 = -0.5

rat: replaced 0.75 by 3/4 = 0.75

rat: replaced 0.3125 by 5/16 = 0.3125

rat: replaced 0.109375 by 7/64 = 0.109375

rat: replaced 0.25 by 1/4 = 0.25

rat: replaced -0.25 by -1/4 = -0.25

rat: replaced 210.0 by 210/1 = 210.0

rat: replaced 36.0 by 36/1 = 36.0

rat: replaced 0.25 by 1/4 = 0.25

rat: replaced -0.25 by -1/4 = -0.25

rat: replaced 630.0 by 630/1 = 630.0

rat: replaced -18.0 by -18/1 = -18.0

rat: replaced 0.25 by 1/4 = 0.25

rat: replaced -0.25 by -1/4 = -0.25

rat: replaced 90.0 by 90/1 = 90.0

rat: replaced -6.0 by -6/1 = -6.0
11/2                          13/2
%pi      (2     - 18) %pi - 105        (2     + 9) %pi - 315
(%o15) [[a = ---, b = ----------------------, c = - ---------------------,
2                 30                           30
9/2
(2    + 6) %pi - 90
d = -------------------]]
15
(%i16) ```
Run Example
```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
(- 1)             sqrt(1 - cos(x))
(%o4)                 ----------------------------------
sqrt(2)
(%i5)  assume(x>
0, x<
2*%pi);
(%o5)                         [x > 0, 2 %pi > x]
(%i6)  sin(x/2);
sqrt(1 - cos(x))
(%o6)                          ----------------
sqrt(2)
(%i7) ```

### Related Help

Help for Halfangles