# Showing the Steps in Solving a Linear Equation

I am trying to find some LaTeX code that would show the steps in solving a linear equation (NOT a system of linear equations). For example, to solve 3x-2y=-1, I want to write:

 3x - 2y = -1
-3x           - 3x
__________________
- 2y = -3x - 1

- 2y = -3x - 1
-----  -------
-2      -2

y = 3x + 1
--   --
2    2


I'm sorry that I can't provide an MWE, because I don't know which LaTeX function to use.

• Are you missing one or more horizontal rules? What's the spacing you're looking for? – TH. Jun 30 '17 at 3:42
• @Ethan : have a look to "systeme", a nice package with a lot of examples easy to read. – pzorba75 Jun 30 '17 at 3:46
• @TH. - I think the OP was trying to provide a visual distinction between fraction bars (the dashed lines) and "ordinary" horizontal rules (the solid line). – Mico Jun 30 '17 at 5:38

Here's a solution that uses the array package (and its \newcolumntype and \extrarowheight macros) and an array environment. Observe the (typographic) distinction between unary and binary uses of the - (minus) symbol.
\documentclass{article}
$\setlength\arraycolsep{0pt} \setlength\extrarowheight{3pt} \begin{array}{RCRCRCR} 3x & - & 2y & = & \multicolumn{3}{R}{-1} \\ -3x & & & & -3x \\ \hline \multicolumn{3}{R}{-2y} & = & -3x & - & 1 \\[2.5ex] \multicolumn{3}{R}{\frac{-2y}{-2}} & = & \multicolumn{3}{R}{\frac{-3x-1}{-2}}\\[3ex] & & y & = & \frac{3x}{2} & + & \frac{1}{2} \\ \end{array}$