Skip to content

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

Léela en español

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

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Substitution (subs)

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

How to write it

subs(expr, rules)

expr
Any expression: a number, a formula, a list or a matrix. Takes an expression.
rules
What to put in place of what. Takes a rule, or a list of rules.

Examples

  • subs⁡(x2+1,x→2)=5\displaystyle \operatorname{subs}(x^{2}+1, x \to 2) = 5
    subs(x^2 + 1, x -> 2)

    In the solver, subs(x^2 + 1, x -> 2) gives 5.

    Open in the solver
  • subs⁡(x2+y,[x→1,y→2])=3\displaystyle \operatorname{subs}(x^{2}+y, \left[ x \to 1, y \to 2 \right]) = 3
    subs(x^2 + y, [x -> 1, y -> 2])

    In the solver, subs(x^2 + y, [x -> 1, y -> 2]) gives 3.

    Open in the solver
  • to_radicals

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

  • simplify

    Simplify an expression, optionally under assumptions.

  • together

    Combine fractions into one over a common denominator.

  • resultant

    Resultant of two polynomials in a variable.

  • apart

    Split a rational expression into partial fractions.

  • power_expand

    Expand powers and logarithms of products and powers.