Simplify symbolic rational expressions
Simplify Symbolic Rational Expressions
Simplify two rational expressions by using
syms x y fraction = (x^2-1)/(x+1); simplifyFraction(fraction)
ans = x - 1
fraction = (y*(x^2-1))/((x+1)*(x-1)); simplifyFraction(fraction)
ans = y
Expand Simplified Rational Expression
Create a rational expression. Simplify the expression by using
syms x y fraction = ((y+1)^2*(x^2-1))/((x+1)*(x-1)^2); simplifyFraction(fraction)
ans = (y + 1)^2/(x - 1)
Simplify the same rational expression again. Expand the numerator and denominator of
the resulting fraction by setting
ans = (y^2 + 2*y + 1)/(x - 1)
Simplify Rational Subexpressions of Expressions
Simplify rational expressions by using
syms x expr = ((x^2+2*x+1)/(x+1))^(1/2); simplifyFraction(expr)
ans = (x + 1)^(1/2)
Simplify rational expressions that contain irrational subexpressions instead of variables.
expr = (1-sin(x)^2)/(1-sin(x)); simplifyFraction(expr)
ans = sin(x) + 1
simplifyFraction does not apply algebraic identities to
simplify the rational expression. Show that
not apply standard trigonometric identities.
expr = (1-cos(x)^2)/sin(x); simplifyFraction(expr)
ans = -(cos(x)^2 - 1)/sin(x)
expr — Input
number | vector | matrix | array | symbolic number | symbolic variable | symbolic array | symbolic function | symbolic expression
Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.
exprcan contain irrational subexpressions, such as
simplifyFractionsimplifies such expressions as if they were variables.
simplifyFractiondoes not apply algebraic identities.
You can also simplify rational expressions using the general simplification function
simplifyFraction is more efficient for
simplifying rational expressions.
Introduced in R2011b