Split parts of an equation over two lines

equations

I have a question concerning equations in Latex. Let's assume there is a simple piecewise function as below (the actual one has terms which are much longer):

enter image description here

As each line runs on for quite a bit, I would like to split the selector over two lines however still aligned with the case. Is this possible?

\begin{equation}
    \label{eqn:c(n)}
    {
        c(n) = \begin{cases}
            f(x)), & $if n=0 where x=1$ \\[1em]
            f(x), & $if n\textgreater0 where x=c(n-1)+n$ \\
        \end{cases}
    }
\end{equation}

This is what I have so far.

Best Answer

I would like to suggest that you employ a cases environment (provided by the amsmath package) and embed in it two array environments.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{amsmath}    % for 'cases' environment
\usepackage{booktabs}   % for '\addlinespace' macro

\begin{document}
\[
C(n)=
\begin{cases}
f(x), & \begin{array}{@{}l@{}}
          n=0\\
          \text{where $x=1$} 
        \end{array} \\ \addlinespace % increase the vertical separation
f(x), & \begin{array}{@{}l@{}}
          n>0\\
          \text{where $x=c(n-1)+n$}
        \end{array}
\end{cases}
\]
\end{document}