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 most often used only with polynomials, but also expands trigonometric, exponential, and logarithmic functions.

Examples

expand((x-2)*(x-4)) returns

 x^2-6*x+8

expand(cos(x+y)) returns

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

expand(exp((a+b)^2)) returns

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

expand([sin(2*t), cos(2*t)]) returns

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

See Also

collect, factor, horner, simple, simplify, syms

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS