Activity 3

Prepared by Ken Levasseur

Mathematica Code for this activity

Mathematica does not allow  manipulate equations in the same way as the TI calculators.  Here is an alternate approach that resembles the substitution method that students should first learn by hand.

eq1 =  3  x  +  5  y == 17

eq2 =  8  x - 3  y == -8

eq3 = eq2 /. First[Solve[eq1, y]]

Solve[eq3, x]

Solve[eq1 /. Solve[eq3, x], y]

Notes

Output from the Solve function in Mathematica is a list of solutions.  Each solution is a list of replacement rules.  When solving linear equations there will be only one solution.   Applying the function First to the Solve result will remove one level of lists.   Here is how to do that automatically if you anticipate solving linear equations.

LSolve[eqs_, vars_] := First[Solve[eqs, vars]]

For example,

LSolve[3  x + 8  y == 11, y]

LSolve[{eq1, eq2}, {x, y}]