# 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

- $\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](https://hilberon.com/?q=simplify%28sin%28x%29%5E2%20%2B%20cos%28x%29%5E2%29)
- $\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](https://hilberon.com/?q=simplify%28%28x%5E2%20-%201%29%2F%28x%20-%201%29%29)
- $\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](https://hilberon.com/?q=simplify%28sqrt%28x%5E2%29%2C%20assuming%20%3D%20x%20%3E%200%29)

## Functions its examples use

- [sin](https://hilberon.com/library/sin)

  Sine of an angle in radians.
- [cos](https://hilberon.com/library/cos)

  Cosine of an angle in radians.
- [sqrt](https://hilberon.com/library/sqrt)

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

## Related functions

- [full_simplify](https://hilberon.com/library/full_simplify)

  Search harder than simplify for a simpler form, under assumptions.
- [subs](https://hilberon.com/library/subs)

  Substitute a rule, or a list of rules, in an expression.
- [resultant](https://hilberon.com/library/resultant)

  Resultant of two polynomials in a variable.
- [to_radicals](https://hilberon.com/library/to_radicals)

  Write algebraic numbers, given as roots of polynomials, with radicals.
- [power_expand](https://hilberon.com/library/power_expand)

  Expand powers and logarithms of products and powers.
- [together](https://hilberon.com/library/together)

  Combine fractions into one over a common denominator.

---
Source: https://hilberon.com/library/simplify
