y:x^2-4;

x:5;

trigrat(y);

Calculate

? trigrat;

Calculate

? trigrat;

Calculate

y:x^2-4;

x:5;

trigrat(y);

Calculate

? trigrat;

Calculate

? trigrat;

Calculate

### trigrat

Run Example
```(%i1)f:1/(1+sin(x))+1/(1-sin(x));
1            1
(%o1)                       ---------- + ----------
sin(x) + 1   1 - sin(x)
(%i2) g:2*(1+tan(x)^2);
2
(%o2)                           2 (tan (x) + 1)
(%i3) f1:trigrat(f);
4
(%o3)                            ------------
cos(2 x) + 1
(%i4) g1:trigrat(g);
4
(%o4)                            ------------
cos(2 x) + 1
(%i5) trigrat(f-g);
(%o5)                                  0
(%i6) ```
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
```eq:diff((sin(x)*cos(x)),x);
2         2
(%o1)                          cos (x) - sin (x)
(%i2) eq2:trigsimp(eq);
2
(%o2)                            2 cos (x) - 1
(%i3) trigrat(eq2);
(%o3)                              cos(2 x)
(%i4) trigsimp(sin(x)^2+cos(x)^2);
(%o4)                                  1
(%i5) ```

Help for Trigrat