Equations
Drawing 2D graph Drawing 3D graph
Drawing geometry figures
Page 1 Page 2
Matrix Fractal Tree Writing notes Symbols Induction Basics Equations system Math environment Accents Venn diagrams
Equations System

Introduction
In this subsection we are going to explain you how to create an equations system, it is not too difficult, but you need to know how to properly use the macro \begin{cases}...\end{cases}. For those who do know what an equations system is, here there is an example:

Math System

Before starting we need to remember that we need a package to let LateX understand the mathematical language that we are going to use in this substection, we need to use the command \usepackage{amsmath} at the beginning of the LaTeX document.
I. Simultaneous Equations
When we want to write more equations at the same time that are connected, we need to put a big {-bracket in front of the 2 or more equations, this notation is called Equation System.
To write this notation in LaTeX is not that complicated, you only need to know how to use properly the macro \begin{cases}...\end{cases}.
Here is an example of a code for a similar equations system as the previous one:

CODE
$$ \begin{cases}
3x + 5y + z = 3\\
7x - 2y + 4z = 4\\
-6x + 3y + 2z = 2
\end{cases} $$


Obviously using the \begin{cases}...\end{cases} macro is not the only way to write an equations system, there are others, like the \begin{array}...\end{array}, and keep in mind that using this macro there is the possibility that LaTeX won't compile at all, for that you need to use another package, \usepackage{array}:

CODE
$$ \left\{
\begin{array}{lr}
3x + 5y + z = 3\\
7x - 2y + 4z = 4\\
-6x + 3y + 2z = 2
\end{array}
\right. $$


Having the output that is like this:

Math System 2

II. Case Definitions
The case definition is used when a definition has more than one case, one example could be this:

Math System 3

This is the example of the sign function of x, where f(x) can get -1,0,1 as different values.
The code for this tipe of function is very similar to the previous codes, you only need to add an f(x) = in front of the system.

CODE
$$ f(x) = sgn(x) =
\begin{cases}
1 & x > 0 \\
0 & x = 0 \\
-1 & x < 0
\end{cases} $$
III. Alignment
As we can see in the second code that has been written, the alignment into the equations system is not the best one, say for example that we want everything aligned with the =, to look like this:

Math System 4

This way the rusults appears much more visible than before.
One way possible to do this would be to put & before the = sign:

CODE
$$\left\{
\begin{array}{lr}
3x + 5y + z &= 3\\
7x - 2y + 4z &= 4\\
-6x + 3y + 2z &= 2
\end{array}
\right. $$


Obviously putting the & sign before any other number or sign will align this sign and numbers.
IV. Test Yourself
Let's see how much you understood so far:

Which macros tou need to use in order to make an equations system in LaTeX?

1) \begin{cases} ... \end{cases}
2)and \begin{array} ... \end{array}


Which simbol do you need to use to align the equations system? where do you have to put it?

You need to use the symbol & and you need to put it in front of the thing that you want to allign in each line.