Online Algebra Calculator
Many of users do not use powerful Maxima computer algebra system for systematic work, but for ad hoc algebraic calculations – equations, functions, matrixes, etc. only. To do this job, it is not useful to download the whole application from a web site.
Function: delete (<expr_1>, <expr_2>)

Function: delete (<expr_1>, <expr_2>, <n>) delete(<expr_1>, <expr_2>) removes from <expr_2> any arguments of its top-level operator which are the same (as determined by "=") as <expr_1>. Note that "=" tests for formal equality, not equivalence. Note also that arguments of subexpressions are not affected.
<expr_1> may be an atom or a non-atomic expression. <expr_2> may be any non-atomic expression. delete returns a new expression; it does not modify <expr_2>.
delete(<expr_1>, <expr_2>, <n>) removes from <expr_2> the first <n> arguments of the top-level operator which are the same as <expr_1>. If there are fewer than <n> such arguments, then all such arguments are removed.
Examples:
Removing elements from a list.
(%i1) delete (y, [w, x, y, z, z, y, x, w]);
(%o1) [w, x, z, z, x, w]Removing terms from a sum.
(%i1) delete (sin(x), x + sin(x) + y);
(%o1) y + xRemoving factors from a product.
(%i1) delete (u - x, (u - w)*(u - x)*(u - y)*(u - z));
(%o1) (u - w) (u - y) (u - z)Removing arguments from an arbitrary expression.
(%i1) delete (a, foo (a, b, c, d, a));
(%o1) foo(b, c, d)Limit the number of removed arguments.
(%i1) delete (a, foo (a, b, a, c, d, a), 2);
(%o1) foo(b, c, d, a) Whether arguments are the same as <expr_1> is determined by "=". Arguments which are equal but not "=" are not removed.
(%i1) [is (equal (0, 0)), is (equal (0, 0.0)), is (equal (0, 0b0))];
rat replaced 0.0 by 0/1 = 0.0 rat replaced 0.0B0 by 0/1 = 0.0B0
(%o1) [true, true, true]
(%i2) [is (0 = 0), is (0 = 0.0), is (0 = 0b0)];
(%o2) [true, false, false]
(%i3) delete (0, [0, 0.0, 0b0]);
(%o3) [0.0, 0.0b0]
(%i4) is (equal ((x + y)*(x - y), x^2 - y^2));
(%o4) true
(%i5) is ((x + y)*(x - y) = x^2 - y^2);
(%o5) false
(%i6) delete ((x + y)*(x - y), [(x + y)*(x - y), x^2 - y^2]);
2 2
(%o6) [x - y ]
There are also some inexact matches for delete. Try ?? delete to see them.
(%o1) true (%i2)