refine function
Simplify an expression using an assumption.
How to write it
refine(expr, p)
- expr
- Any expression: a number, a formula, a list or a matrix. Takes an expression.
- p
- What to assume, such as x > 0. Takes a condition, true or false.
Examples
refine(sqrt(x^2), x > 0)In the solver,
Open in the solverrefine(sqrt(x^2), x > 0)givesx.
Functions its examples use
- sqrt
Square root; sqrt(x) is the power x^(1/2).
Related functions
- with_assumptions
Evaluate a body under local assumptions.
- assume
Add an assumption about the variables.