Putting together sine and cosine of the same angle: tcollect tCollect

### 6.23.4 Putting together sine and cosine of the same angle: tcollect tCollect

The tcollect command linearizes trigonometric expressions (in terms of sin(n*x) and cos(n*x)) and combines sines and cosines of the same angle.
tCollect is a synonym for tcollect.

- tcollect takes one argument:
  expr, an expression containing trigonometric functions.
- tcollect(expr) returns expr after first linearizing it and then combining sines and cosines of the same angle.

Examples.

- Input:
  tcollect(sin(x)+cos(x))
  Output:

  √ |
  2
  | cos | ⎛ ⎜ ⎜ ⎝ | x− |
  1
  4
  | π | ⎞ ⎟ ⎟ ⎠

- Input:
  tcollect(2*sin(x)*cos(x)+cos(2*x))
  Output:

  √ |
  2
  | cos | ⎛ ⎜ ⎜ ⎝ | 2 x− |
  1
  4
  | π | ⎞ ⎟ ⎟ ⎠