Q: Writing an equation with two domains? How do I write the following in LaTeX:


A: As @Mico and @oliversm pointed out, there are two basic ways to do this.
Solution 1: using the cases package
\documentclass{article}
\usepackage{cases}

\begin{document}
\begin{numcases}{f(x)=}
  x, & \( x \geq 0\) \nonumber \\
  0, & \( x < 0 \)   \nonumber
\end{numcases}
\end{document}

Solution 2: using the cases environment of the amsmath package.
\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
f(x) = 
\begin{cases}
  x, & x \geq 0 \\
  0, & x < 0
\end{cases}
\]
\end{document}


Both give the same result, although the use of the cases package seems to typeset the result a bit lower on the page than using the amsmath cases environment. Personally, I like the former because you don't have to remember to go into display mode before. Choose the one you prefer.

A: Found it, using cases
\documentclass{article}
\usepackage{cases}

\begin{document}

   \begin{numcases}{f(x)=}
  x, \: \: \: \: x \geq 0                           \\
  0, \: \: \: \: x < 0             
\end{numcases} 


\end{document}

