Multi-line equation with a Curly Bracket on the left side in LaTeX

In mathematics, sometimes we write mathematical expressions or functions with different cases or conditions with a Curly Bracket at the beginning of the expressions.

In order to write this in LaTeX, you can use the cases environment provided by the amsmath package. You can use the cases environment like this.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[ f(x)=
\begin{cases}
  1, & -\infty < x < 1 \\
  1-x, & 1 \leq x < 10 \\
  x^2, & \text{otherwise}
\end{cases}
\]
With equation number:
\begin{equation}
f(x)=
\begin{cases}
  1, & -\infty < x < 1 \\
  1-x, & 1 \leq x < 10 \\
  x^2, & \text{otherwise}
\end{cases}
\end{equation}

\end{document}

Output:

multiline equation

Two conditions on different lines for an expression

If you want two conditions on different lines for an expression, then you can use the \multirow command within the cases environment. In this case, you have to load the multirow package. Then use this command Like this.

\multirow{<num_rows>}{*}{<expression>}

Take a look.

\documentclass{article}
\usepackage{amsmath}
\usepackage{multirow}
\begin{document}

\[ f(x)=
\begin{cases}
   \multirow{2}{*}{2 $-x^2$,} & \text{for }0\leq x\leq 1\\
                              & \text{or }0\leq x\leq 1\\
   1-x, & 1 \leq x < 10 \\
   x^2, & \text{otherwise}
\end{cases}
\]
With equation number:
\begin{equation}
f(x)=
\begin{cases}
   \multirow{2}{*}{2 $-x^2$,} & \text{for }0\leq x\leq 1\\
                              & \text{or }0\leq x\leq 1\\
   1-x, & 1 \leq x < 10 \\
   x^2, & \text{otherwise}
\end{cases}
\end{equation}

\end{document}

Output:

multiline equation

Leave a Reply

Your email address will not be published. Required fields are marked *