Previous Up Next

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).

Examples

Expand cos(x+y).

texpand(cos(x+y))
cos x cos ysin x sin y           

Expand cos(3x).

texpand(cos(3*x))
4 cos 3x−3 cos x           

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

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

16 cos 4x−12 cos 2x+1
sin x
+
28 sin x cos 2x

16 cos 4x−12 cos2x+1
sin x
          
80 sin x cos 4x

16 cos 4x− 12 cos2x+1
sin x
+
64 sin x cos 6x

16 cos 4x−12 cos 2x+1
sin x
          
normal(ans())
4 cos 2x−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 ysin x sin y+ex ey+ln
3
+2 ln
x
          

Previous Up Next