# [Tex/LaTex] How to write conditional equations with one-sided curly brackets

best practicesequations

I want to write a conditional expression such as the following.

What is the best way to express such conditional expressions in Latex?

I think this is a job for cases from the amsmath package

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$f(x)= \begin{cases} \frac{x^2-x}{x},& \text{if } x\geq 1\\ 0, & \text{otherwise} \end{cases}$
\end{document}


or if you would prefer a displaystyle fraction, then you could use dcases from the mathtools package, which extends (and loads) the amsmath package.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
$f(x)= \begin{dcases} \frac{x^2-x}{x},& \text{if } x\geq 1\\ 0, & \text{otherwise} \end{dcases}$
\end{document}