Simplify Symbolic Expression

Simplify symbolic expressions in Live Editor

Description

The Simplify Symbolic Expression task enables you to interactively simplify or rearrange symbolic expressions. The task automatically generates MATLAB® code for your live script. For more information about Live Editor tasks, see Add Interactive Tasks to a Live Script (MATLAB).

Using this task, you can:

  • Perform algebraic simplification of symbolic expressions.

  • Rewrite expressions in terms of another function.

  • Expand algebraic expressions.

  • Combine terms of identical algebraic structure.

  • Generate the code used to simplify or rearrange expressions.

Related Functions

The code that Simplify Symbolic Expression generates to simplify expressions uses these functions.

Open the Task

To add the Simplify Symbolic Expression task to a live script in the MATLAB Editor:

  • On the Live Editor tab, select Task > Simplify Symbolic Expression.

  • In a code block in your script, type a relevant keyword, such as simplify, symbolic, rewrite, expand, or combine. Select Simplify Symbolic Expression from the suggested command completions.

Parameters

Specify the simplification method from the drop-down list:

Simplification MethodDescription
SimplifyPerform algebraic simplification.
Simplify fractionSimplify symbolic rational expressions.
RewriteRewrite expressions in terms of another function.
ExpandExpand expressions and simplify inputs of functions by using identities.
CombineCombine terms of identical algebraic structure.

Specify the computational effort used for the Simplify method from the drop-down list:

Simplification EffortDescription
MinimumMinimum effort with fastest computation time (can return most complicated result)
LowLow effort with faster computation time
MediumMedium effort with normal computation time
HighHigh effort with slower computation time
FullFull effort with slowest computation time (can return simplest result)

Select this check box to not expand special functions for the Expand method. This option expands the arithmetic part of an expression, such as powers and roots, without expanding trigonometric, hyperbolic, logarithmic, and special functions.

Select this check box to apply purely algebraic simplifications to give simpler solutions for the Expand method, which could lead to results not generally valid. This option applies mathematical identities that are convenient, but do not always hold for all values of variables. In some cases, this option can lead to simpler results that are not equivalent to the initial expression.

Introduced in R2020a