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

### 5.23.17 Rewriting tan(x) in terms of sin(2x) and cos(2x): tan2sincos2

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

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

#### Example

Input:

tan2sincos2(tan(x))

Output:

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