Basic mathematical operations:
All the basic mathematical operations can be executed on symbolic expressions and variables (example, add, raise to a power, multiply, subtract, divide, etc.).
Here are some illustrations:
>> b + sym('4*x^2')
It can be view from the last illustration that MATLAB will collect like words in such expressions, adding the x2 and 4x2 to answer in 5x2.
The below generates a symbolic expression by passing a string, but the words are not automatically collected:
>> sym('z^3 + 2*z^3')