### 10.2.4 Putting together sine and cosine of the same angle

The tcollect or tCollect command linearizes trigonometric expressions in terms of sin(nx) and cos(nx) and combines sines and cosines of the same angle.

- tcollect takes 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

tcollect(sin(x)+cos(x))

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

tcollect(2*sin(x)*cos(x)+cos(2*x))

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