Has anyone ever solved an equation for students using algebraic steps?

For example, you start with the equation.

2x+3 = 5

Then you show subtracting 3 from both sides

2x+3 -3 = 5 -3

Then you simplify.


Then you divide both sides by 2.

2x/2 = 2/2

Then you simplify.


Just curious if anyone has ever done this.


It is not difficult. You did not write though, what is your ultimate aim, since the way, how to do what you are asking for depends upon that. I take it, you need something as a demonstration for school children or students. This is the way I interpret your requirement to separate the action from simplification. Otherwise, as you know, Mma does simplification automatically, and to separate one from the other takes some special effort. Anyway, here it is:

Step zero: equation

eq = 2 x + 3 == 5;

For the further technically the trick is related to the fact that any equation has the following TreeForm:


enter image description here

The box entitled "Plus" with the tree coordinate {1} contains the left-hand side of the equation, and that entitled "5" with the coordinate {2} contains it right-hand side, the both are on the level 1. That is,


(*   3 + 2 x  *)


(*   5   *)

This enables one to map any operation onto any equation, in order to apply this operation to its both sides simultaneously, like this:

Map[Operation, equation]

with the following effect:


Let us see, how it works:

Step1: subtraction:

eq2A = Map[HoldForm[Subtract[#, 3]] &, eq]

The result is below. I have to place it as an image, since otherwise it contains lots of boxes:

enter image description here

The HoldForm[] above just prevents the result from the immediate simplification. If one does not care for the simplification, he writes as follows:

    Map[Subtract[#, 3] &, eq]

(*  2 x == 2  *)

Step 2: simplification. It may be simply done by just removing the HoldForm:

    eq2B = eq2A // ReleaseHold

(*   2 x == 2   *)

Step 3: Division. Let us divide the both parts by two and again use the HoldForm construct to prevent the immediate simplification:

eq3A = Map[HoldForm[Divide[#, 2]] &, eq2B]


enter image description here

Again, removing the HoldForm we allow Mma to simplify:

 eq3B = eq3A // ReleaseHold

(*   x == 1   *)


Have fun!

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.