Opening the book…
Symbolic math is also useful for algebraic manipulation. MATLAB can simplify expressions, expand products, and factor polynomials.
simplify
The simplify function attempts to rewrite an expression in a simpler form.
syms x expr = cos(x)^2 + sin(x)^2; simplified_expr = simplify(expr)
Solution
sBecause cos^2(x) + sin^2(x) = 1, MATLAB should simplify this expression to 1. implified_expr = 1
expand
The expand function multiplies out an expression when possible.
factor
The factor function does the reverse when possible: it rewrites an expression as a product of factors.
syms x myexpr = (x + 2)*(x - 1); expanded_expr = expand(myexpr) factored_expr = factor(expanded_expr)
Solution
expanded_expr = x^2 + x - 2 factored_expr = [x + 2, x - 1]
This page titled 14.8: Simplifying, Expanding, and Factoring Expressions was last modified on Tue, 30 Jun 2026 02:11:43 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Zara Noroozi.
The book could not be loaded just now.