# Need help with an equation

I have little trouble with my TeX course. I've already completed all the assignments except one. Yesterday I was up until 4AM and still didn't get it right.

Maybe someone could give me some guidelines or even the code? I would really appreciate it!

Here is what I have so far and what would be ideal:

I used tables to create this, but I'm getting the feeling that it's a wrong approach.

PS.

What would be correct to use for doing these (I don't know what they're called in English).

I've used \left, \right and \start{array} so far, but it somehow doesn't feel right.

-

I wanted to try my hand at this with Plain-format, because the example seemed (to me) to lack consistency. That is, only the very last entry above the \hrule got an alignment. So here's what it'd look like if the rest of them are aligned:

\def\myeqalign#1{\openup-1\jot\eqalign{#1}}% negate the cumulative \openup1\jot
\let\To\Rightarrow
\myeqalign{% creates a 2-col align (1st col flush-right, 2nd flush-left), % which starts off with \openup1\jot \omit% omit the align preamble for this col, 'cause we don't want flush-right \left\{\myeqalign{y&=2x-5\cr4x-2y-10&=0\cr}\right.\To\hfill\cr \noalign{\smallskip}% insert a small vertical skip between the rows \To\left\{\myeqalign{2x-y-5=0\cr4x-2y-10=0}\right. \left|\matrix{\cdot(-2)\cr\cdot1}\right| +\myeqalign{-4x+2y+10&=0\cr4x-2y-10&=0\cr}\cr\noalign{\hrule} 0=0\,}


Whereas, if I am trying to mimic the "This is what I need"-part:

\myeqalign{\omit\cases{y=2x-5\cr4x-2y-10=0}\;\To\hfil\cr\noalign{\medskip} \To\cases{2x-y-5=0\cr4x-2y-10=0}\enspace\left|\matrix{\cdot(-2)\cr\cdot1}\right|\enspace +\myeqalign{-4x+2y+10&=0\cr4x-2y-10&=0}\cr\noalign{\hrule} 0=0}
\bye


There are additional differences with both horizontal and vertical spacing.

To wrap it up, Plain's \matrix centers its column contents, with columns \quad apart from eachother. \eqalign has two columns; first flush-right, second flush-left. \cases has two columns; first flush-left in math-mode, and the second in text-mode, \quad apart.

Regardless of which one you'll use (and I'm pretty sure this includes LaTeX's equivalents), you'll always end up using \halign (horizontal alignment) "under the hood", which can be thought of as a table.

-
• You could use a cases environment

• You can use aligned, such as

\left\{\begin{aligned} ... \end{aligned}\right.

• An array environment for the whole structure would be ok. In contrast to tabular, array works in math mode.

-

The whole thing is a one column array with left alignment; there are two rows and a \hline to separate the result which is

\multicolumn{1}{r@{}}{0=0}


For the system you can do

\left\lbrace\begin{array}{l}
first equation\\
second equation
\end{array}\right.


The second row of the main array is made of an arrow, a system, another array with different delimiters, the + symbol, and a final array with no delimiters.

$\begin{array}{l} \left\lbrace\begin{array}{l} y = 2x - 5 \\ 4x - 2y - 10 = 0 \end{array}\right.\Rightarrow \\[\bigskipamount] \Rightarrow \left\lbrace\begin{array}{l} 2x - y + 5 = 0 \\ 4x - 2y - 10 = 0 \end{array}\right. \ \left|\begin{array}{c} \cdot (-2) \\ \cdot (1) \end{array}\right| + \begin{array}{r} -4x +2y -10 = 0 \\ 4x -2y -10 = 0 \end{array} \\ \hline \multicolumn{1}{r}{0 = 0} \end{array}$

-

I used an array with three centered columns and vertical lines separating columns one and two, and two and three and other nested array environments; \multicolumn was used to suppress the vertical lines in the first and in the third rows, and to get the alignment for the last row:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\begin{array}{@{}c|c|c} \multicolumn{1}{@{}c}{% \left\lbrace\begin{array}{l} y = 2x - 5 \\ 4x - 2y - 10 = 0 \end{array}\right.\Rightarrow} & \multicolumn{1}{c}{} & \\ \Rightarrow\left\lbrace\begin{array}{l} 2x - y + 5 = 0 \\ 4x - 2y - 10 = 0 \end{array}\right. & \begin{array}{c} \cdot (-2) \\ \cdot (1) \end{array} & +\begin{array}{r} -4x +2y -10 = 0 \\ 4x -2y -10 = 0 \end{array} \\ \hline \multicolumn{3}{r}{0 = 0} \end{array}$

\end{document}


EDIT: corrected the last pair of equations. EDIT2: suppressed a superfluous column.

-
Why is the outer array made of four columns? And why the empty \multicolumn's? Less is more. :) –  egreg May 26 '11 at 22:52
@egreg: I was just about to eliminate the superfluous column. The empty \multicolumn is to prevent the vertical line in the first row between columns two and three. –  Gonzalo Medina May 26 '11 at 22:57
Thank you thank you! This is just what I needed. –  Priit Pihus May 27 '11 at 12:20