# How to write cases in LaTeX?

I want to write following system of equation in my paper, but I don't know how:

Here is a code that I've tried, but it does not work:

R\geqslant R_t \equiv \begin{cases} \frac{r_{t+1} (1-W(k_t)}{f'(k{t+1}
\lambda} &\mbox{if } k_t < K(\lambda) \\
\frac{r_{t+1}}{f'(k_{t+1})} & \mbox{if } k_t\geqslant K(\lambda)
\end{cases}


Any suggestions will be very helpful. Thanks

• Excuse me but the code is different from the image. Have I understood well? – Sebastiano Feb 25 '19 at 13:17
• Consider accepting one of the provided answers if your question is solved (check mark on the left hand side of the answers). – Dr. Manuel Kuehner Feb 25 '19 at 13:44
• I don't understand what you were having trouble with. The only error I got compiling was about \geqslant. What about didn't work? Or were you wanting to get something closer to your image than you have? I would say that your code gives a better output than that image. – Teepeemm Feb 25 '19 at 16:57

I would load the mathtools package, which is a superset of the amsmath package, and employ that package's dcases* environment.

\documentclass{article}
\usepackage{mathtools} % for 'dcases*' env.
\begin{document}
$R\ge R_t \equiv \begin{dcases*} \frac{r_{t+1}}{f'(k_{t+1})}\frac{1-W(k_t)}{\lambda} & if k_t < K(\lambda)\,, \\[1ex] \frac{r_{t+1}}{f'(k_{t+1})} & if k_t\ge K(\lambda)\,. \end{dcases*}$
\end{document}

• Is this command better than the usual cases command? – knzhou Feb 25 '19 at 16:38
• @knzhou - I wouldn't say that dcases is necessarily better than cases, certainly not in the sense of it being *always and everywhere" better than cases. The d in dcases denotes "automatic display-style math mode. It's handy if one has to typeset expressions such as \frac, which might look a whole lot better when rendered in display-style math mode rather than in text-style math mode. Conversely, cases is much more parsimonious, space-wise, than dcases. If conserving space is an important criterion, by all means go with cases. – Mico Feb 25 '19 at 16:44
• Makes sense, thanks! I was just asking in case cases had been declared obsolete by people in the know for some reason, like how $...$ is supposed to be strictly better than $$...$$. – knzhou Feb 25 '19 at 16:50

Welcome to TeX.SE. Here my (fast) proposal from your original code:

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}

\begin{document}
$R\geqslant R_t \equiv \begin{cases} \dfrac{r_{t+1} (1-W(k_t))}{f'(k{t+1} \lambda)} &\mbox{if } k_t < K(\lambda) \\ &\\ \dfrac{r_{t+1}}{f'(k_{t+1})} & \mbox{if } k_t\geqslant K(\lambda) \end{cases}$
\end{document}


EDIT: By correct comment of @Yorgos:

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
$R\geqslant R_t \equiv \begin{cases} \dfrac{r_{t+1} (1-W(k_t))}{f'(k{t+1} \lambda)} & \text{if } k_t < K(\lambda) \\ &\\ % blank row \dfrac{r_{t+1}}{f'(k_{t+1})} & \text{if } k_t\geqslant K(\lambda) \end{cases}$
\end{document}

• i don't think that mbox is necessary, since & aligns. also i prefer equation environment, since it allows for numbering the equation – Yorgos Feb 25 '19 at 13:09
• @Yorgos I accept your suggestion correctly. I have only taken the code from the user. :( – Sebastiano Feb 25 '19 at 13:11
• I believe that the k{t+1} term in the first denominator should be changed to k_{t+1}. – Mico Feb 25 '19 at 13:22
• @Mico Thank you very much for edit and all ....You're right for you comment. – Sebastiano Feb 25 '19 at 15:58