### 10.4.1 Expanding transcendental expressions

The texpand or tExpand command expands exponential and trigonometric functions, like simultaneous calling textttexpexpand (see Section 10.3.2), which, for example, expands enx as (ex)n, lnexpand (see Section 10.3.3), which, for example, expands ln(xn) as nln(x), and trigexpand (see Section 10.2.1), which, for example, expands sin(2x) as 2sin(x)cos(x).

- texpand takes expr, an expression containing transcendental or trigonometric functions.
- texpand(expr) expands these functions.

#### Examples

Expand cos(x+y).

texpand(cos(x+y))

cos x cos y−sin x sin y |  |  |  |  |  |  |  |  |  |

Expand cos(3x).

texpand(cos(3*x))

4 cos3x−3 cos x |  |  |  |  |  |  |  |  |  |

Expand sin(3x)+sin(7x)/sin(5x).

texpand((sin(3*x)+sin(7*x))/sin(5*x))

−

2 sin x

⎛ ⎝ | 16 cos4x−12 cos2x+1 | ⎞ ⎠ | sin x

+

28 sinxcos2x

⎛ ⎝ | 16 cos4x−12 cos2x+1 | ⎞ ⎠ | sinx

−

80 sinxcos4x

⎛ ⎝ | 16 cos4x− 12 cos2x+1 | ⎞ ⎠ | sinx

+

64 sinxcos6x

⎛ ⎝ | 16 cos4x−12 cos2x+1 | ⎞ ⎠ | sinx

normal(ans())

4 cos2x−2 |  |  |  |  |  |  |  |  |  |

Expand ex+y.

texpand(exp(x+y))

ex ey |  |  |  |  |  |  |  |  |  |

Expand ln(x y).

texpand(log(x*y))

ln y+ln x |  |  |  |  |  |  |  |  |  |

Expand ln(xn).

texpand(ln(x^n))

n ln x |  |  |  |  |  |  |  |  |  |

Expand ln(e2+e2ln(2)+eln(3)+ln(2)).

texpand(log(e^2)+exp(2*log(2))+exp(log(3)+log(2)))

6+2· 3 |  |  |  |  |  |  |  |  |  |

or:

texpand(log(e^2)+exp(2*log(2)))+ lncollect(exp(log(3)+log(2)))

12 |  |  |  |  |  |  |  |  |  |

Expand ex+y+cos(x+y)+ln(3x2).

texpand(exp(x+y)+cos(x+y)+ln(3*x^2))

cos x cos y−sin x sin y+ex ey+ln | ⎛ ⎝ | 3 | ⎞ ⎠ | +2 ln | ⎪ ⎪ | x | ⎪ ⎪