2

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.

Thanks in advance for your help.

  • 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
1

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.

enter image description here

\documentclass{article}
\usepackage{array}
\newcolumntype{C}{>{{}}c<{{}}} % for columns with binary and relational operators
\newcolumntype{R}{>{\displaystyle}r}

\begin{document}
\[
\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}
\]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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