CamteX
All guides

System of equations in LaTeX

A system of equations with a brace on the left is written with the cases environment from amsmath. The same environment is used for piecewise functions; put the condition text inside \text.

Two equations

\begin{cases} x + y = 5 \\ 2x - y = 1 \end{cases}
{x+y=52xy=1\begin{cases} x + y = 5 \\ 2x - y = 1 \end{cases}

Piecewise function

|x| = \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases}
x={xif x0xif x<0|x| = \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases}

Common mistakes

See also

Don't want to memorize commands?

Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.

Try it free