Description:
-
This procedure distributes powers over sums and applies expansion formulas for many functions. The main difference between this and the built-in procedure
expand
is that
expands
applies the formulas even in cases when they are not known to be valid. Thus this is a "symbolic" expansion, analogous to the symbolic simplification of
simplify(..., symbolic)
.
-
expand
is the procedure normally used to expand an expression. However, the expansion formulas for certain functions are only valid under restrictive assumptions, and
expand
will not apply them unless Maple knows that these assumptions are valid. For example,
is not always valid (e.g. it is false if
and
are negative reals). Therefore
expand
will only apply it in case
or
is known to be a positive real. This can be made known to Maple by using
assume
.
-
However, in many cases it is inconvenient to make the necessary assumptions, or the assumptions are excessively restrictive (e.g. the expansion formula for ln given above is also valid when
, but
expand
will not use it).
-
To go in the reverse direction, there is the
combine
procedure. Note that some of the sub-procedures of this have symbolic options, e.g.
combine(..., power, symbolic)
.
-
expands
will also expand the arctan function, which
expand
will not. This uses the formulas
and
.
-
There is one case where
expand
will produce an expansion which may be undesirable, and
expands
will not: when
is assumed to be real,
expand(exp(I*a))
results in
, while
expands(exp(I*a))
leaves it as
.
-
This function is part of the
Maple Advisor Database
library.
Examples:
Both
expand
and
expands
produce many of the same expansions.
>
expands((x+1)*(x+2));
>
expands(sin(x+y));
The expansion of the logarithm of a product. This is not always valid, as there may be an additional term
where
is an integer.
>
expand(ln(x*y)),expands(ln(x*y));
The square root of a product. This is not always valid, as there may be a factor of
.
>
expand(sqrt(x*y)),expands(sqrt(x*y));
A power of a power. Again, not always valid (e.g. try it for
).
>
expand((x^(3/2))^(2/3)), expands((x^(3/2))^(2/3));
An expandable arctan.
expand
won't do anything with this, even under conditions that
guarantee its validity.
>
assume(x>0,x<1/4,y>0,y<1/4);
expand(arctan((x+y)/(1-x*y))), expands(arctan((x+y)/(1-x*y)));
A case where
expand
expands but
expands
does not. I think it is better to use
exp
rather than a power of
here, to avoid complications with multivalued functions.
>
assume(x,real); expand(exp(2*Pi*I*x)), expands(exp(2*Pi*I*x));