Enter the following code into an input cell in a worksheet, and evaluate the cell:
var('x, y') expr = (y - 7) / (x^2 + 1) == x^3 - 5 print("Expression:") expr.show() print("Two ways of multiplying both sides:") show(expr.multiply_both_sides(x^2 + 1)) show(expr * (x^2 + 1)) # also divide_both_sides expr = expr * (x^2 + 1) print("Two ways of adding to both sides:") show(expr.add_to_both_sides(7)) show(expr+7) # also subtract_from_both_sides
The results are shown in the following screenshot:
This example showed how to perform one of the most basic algebraic re-arrangements: performing the same operation on both sides of a relation. We can do this by using methods of the symbolic expression object (add_to_both_sides
, subtract_from_both_sides
, multiply_both_sides
, divide_both_sides
). We can also use the arithmetic operators +
, -
, *
, and /
to perform the same operation on both sides of a relation. Note that these operations return...