Rewriting tan(x) in terms of cos(2x) and sin(2x): tan2cossin2

### 6.23.18 Rewriting tan(x) in terms of cos(2x) and sin(2x): tan2cossin2

The tan2cossin2 command replaces tan(x) by 1−cos(2x)/sin(2x) in an expression.

- tan2cossin2 takes one argument:
  expr, an expression containing trigonometric functions.
- tan2cossin2(expr) returns expr with anything of the form tan(x) replaced by 1−cos(2x)/sin(2x).

Example.
Input:

tan2cossin2(tan(x))

Output:

1−cos | ⎛ ⎝ | 2 x | ⎞ ⎠
sin | ⎛ ⎝ | 2 x | ⎞ ⎠