|
Calling Sequence
|
|
expand(expr, expr1, expr2, ..., exprn)
|
|
Parameters
|
|
expr
|
-
|
any algebraic expression
|
expr[1], expr[2], ..., expr[n]
|
-
|
(optional) expressions
|
|
|
|
|
Description
|
|
•
|
The expand command distributes products over sums. This is done for all polynomials. For quotients of polynomials, only sums in the numerator are expanded; products and powers are left alone. See the normal command for dealing with quotients of polynomials.
|
•
|
The expand command also expands most mathematical functions, including AngerJ, BesselI, BesselJ, BesselK, BesselY, Beta, ChebyshevT, ChebyshevU, CylinderD, CylinderU, CylinderV, Dirac, Ei, GAMMA, GegenbauerC, HankelH1, HankelH2, HermiteH, JacobiAM, JacobiCD, JacobiCN, JacobiCS, JacobiDC, JacobiDN, JacobiDS, JacobiNC, JacobiND, JacobiNS, JacobiP, JacobiSC, JacobiSD, JacobiSN, JacobiTheta1, JacobiTheta2, JacobiTheta3, JacobiTheta4, JacobiZeta, KelvinBei, KelvinBer, KelvinHei, KelvinHer, KelvinKei, KelvinKer, LaguerreL, LegendreP, LegendreQ, LerchPhi, Psi, StruveH, StruveL, WeberE, WeierstrassP, WeierstrassPPrime, WeierstrassSigma, WeierstrassZeta, Zeta, abs, arccos, arccosh, arccot, arccoth, arccsc, arccsch, arcsec, arcsech, arcsin, arcsinh, arctan, arctanh, bernoulli, binomial, cos, cosh, cot, coth, csc, csch, csgn, dilog, erf, erfc, euler, exp, factorial, ln, pochhammer, polylog, sec, sech, signum, sin, sinh, tan, and tanh.
|
•
|
The optional arguments expr1, expr2, ..., exprn are used to prevent particular subexpressions in expr from being expanded. To prevent all expressions from being expanded, use the frontend command: frontend(expand, [expr]);
|
•
|
The expand command is extensible: if the procedure `expand/f` is defined, then the call expand(f(x)); calls `expand/f`(x);
|
|
|
Examples
|
|
| (4) |
Do not fully expand an expression.
>
|
|
The expand command will only expand an expression if it is possible.
The expand command works on more advanced functions.
>
|
|
| (11) |
>
|
|
| (12) |
>
|
|
| (13) |
To selectively prevent expansions of subexpressions, it is frequently useful to use indets, to get subexpressions of certain type, and pass the operands of its output as extra arguments to expand.
>
|
|
| (14) |
By default products and functions are expanded.
| (15) |
Avoid expanding sin(a+b)
>
|
|
| (16) |
Avoid expanding the exponential function.
>
|
|
| (17) |
Avoid expanding the exponential and sine functions.
>
|
|
| (18) |
Avoid expanding all functions.
>
|
|
| (19) |
|
|
|