Simplification Functions:
There are numerous functions which work with expressions, and simplify the terms. Not all the expressions can be simplified, but the simplify function does anything it can to simplify expressions, involving gathering like terms. For illustration:
>> x = sym('x');
>> myexpr = cos(x)^2 + sin(x)^2
myexpr =
cos(x)^2 sin(x)^2
>> simplify(myexpr)
ans =
1
The functions expand, collect, and factor work with polynomial expressions. The collect function collects the coefficients, for illustration,
>> collect(x^2 + 4*x^3 + 3*x^2)
4*x^2 4*x^3