simple - Search for simplest form of symbolic expression

Syntax

r = simple(S)
[r,how] = simple(S)

Description

r = simple(S) tries several different algebraic simplifications of the symbolic expression S, displays any that shorten the length of S's representation, and returns the shortest. S is a sym. If S is a matrix, the result represents the shortest representation of the entire matrix, which is not necessarily the shortest representation of each individual element. If no return output is given, simple(S) displays all possible representations and returns the shortest.

[r,how] = simple(S) does not display intermediate simplifications, but returns the shortest found, as well as a string describing the particular simplification. r is a sym. how is a string.

Examples

Expression

Simplification

Simplification Method

cos(x)^2+sin(x)^2

1

simplify

2*cos(x)^2-sin(x)^2

3*cos(x)^2-1

simplify

cos(x)^2-sin(x)^2

cos(2*x)

combine(trig)

cos(x)+ (-sin(x)^2)^(1/2)

cos(x)+i*sin(x)

radsimp

cos(x)+i*sin(x)

exp(i*x)

convert(exp)

(x+1)*x*(x-1)

x^3-x

collect(x)

x^3+3*x^2+3*x+1

(x+1)^3

factor

cos(3*acos(x))

4*x^3-3*x

expand

See Also

collect, expand, factor, horner, simplify

  


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