Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Simplify an expression (simplify)

Simplify an expression, optionally under assumptions.

With this function, the solver shows the steps whenever it finds them.

How to write it

simplify(expr)

Simplify the expression.

expr
Any expression: a number, a formula, a list or a matrix. Takes an expression.

simplify(expr, assuming = value)

Simplify under an assumption about the variables.

expr
Any expression: a number, a formula, a list or a matrix. Takes an expression.
assuming = value
What to assume about the variables, such as x > 0. Takes a condition, true or false.

Examples

  • sin⁡2(x)+cos⁡2(x)=1\displaystyle \sin^{2}(x)+\cos^{2}(x) = 1
    simplify(sin(x)^2 + cos(x)^2)

    In the solver, simplify(sin(x)^2 + cos(x)^2) gives 1.

    Open in the solver
  • x2−1x−1=x+1\displaystyle \frac{x^{2}-1}{x-1} = x+1
    simplify((x^2 - 1)/(x - 1))

    In the solver, simplify((x^2 - 1)/(x - 1)) gives x + 1.

    Open in the solver
  • x2,x>0=x\displaystyle \sqrt{x^{2}},\quad x > 0 = x
    simplify(sqrt(x^2), assuming = x > 0)

    In the solver, simplify(sqrt(x^2), assuming = x > 0) gives x.

    Open in the solver

Functions its examples use

  • sin

    Sine of an angle in radians.

  • cos

    Cosine of an angle in radians.

  • sqrt

    Square root; sqrt(x) is the power x^(1/2).

  • full_simplify

    Search harder than simplify for a simpler form, under assumptions.

  • subs

    Substitute a rule, or a list of rules, in an expression.

  • resultant

    Resultant of two polynomials in a variable.

  • to_radicals

    Write algebraic numbers, given as roots of polynomials, with radicals.

  • power_expand

    Expand powers and logarithms of products and powers.

  • together

    Combine fractions into one over a common denominator.