Products & Services Solutions Academia Support User Community Company

Learn more about Symbolic Math Toolbox   

expand - Symbolic expansion of polynomials and elementary functions

Syntax

expand(S)

Description

expand(S) writes each element of a symbolic expression S as a product of its factors. expand is often used with polynomials. It also expands trigonometric, exponential, and logarithmic functions.

Examples

Expand the expression:

syms x;
expand((x-2)*(x-4))

The result is:

ans =
x^2 - 6*x + 8

Expand the trigonometric expression:

syms x y;
expand(cos(x+y))

The result is:

ans =
cos(x)*cos(y) - sin(x)*sin(y)

Expand the exponent:

syms a b;
expand(exp((a+b)^2))

The result is:

ans =
exp(2*a*b)*exp(a^2)*exp(b^2)

Expand the expressions that form a vector:

syms t;
expand([sin(2*t), cos(2*t)])

The result is:

ans =
[ 2*cos(t)*sin(t), cos(t)^2 - sin(t)^2]

See Also

collect, factor, horner, simple, simplify, syms

  


Free Symbolic Math Interactive Kit

See how symbolic computations can help you find analytical solutions to math and engineering problems.

Get free kit

Trials Available

Try the latest version of symbolic math products.

Get trial software
 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS