I wish to write a piecewise function with several cases, where it has a certain definition for one set of specified $x$ values, another definition for another set of $x$ values, etc, then one final definition for all remaining values of $x$. It loosely looks like this:

$y = \begin{cases} f(x) & \quad \text{if}\ x = n_1, n_2, n_3, ... \\ g(x) & \quad \text{if}\ x = m_1, m_2, m_3, ... \\ h(x) & \quad \text{for all other values of}\ x \end{cases}$

My question is: is there a better way to write "for all other values of $x$" in this context?

  • 5
    $\begingroup$ How about 'otherwise' $\endgroup$
    – Empy2
    Aug 8, 2018 at 8:36
  • 2
    $\begingroup$ "otherwise" is quite common for the last line $\endgroup$
    – postmortes
    Aug 8, 2018 at 8:37

1 Answer 1


Use the word otherwise,$$y = \begin{cases} f(x) & \quad \text{if}\ x = n_1, n_2, n_3, ... \\ g(x) & \quad \text{if}\ x = m_1, m_2, m_3, ... \\ h(x) & \quad \text{otherwise} \end{cases}$$

  • 1
    $\begingroup$ Note that doing it this way, it looks strange (at least to me) if "otherwise" doesn't cover "most" of the cases (or at least a amount comparable to the other cases, like "if $x>0$" and "otherwise"). For instance, $$f(x) = \cases{x^2 \sin(1/x)&if $x\neq 0$\\0&otherwise}$$feels wrong, somehow. I would use "if $x = 0$" instead, or swap the two cases, having the "if $x = 0$" case on top and "otehrwise" on the bottom (which also looks strange, for some reason). $\endgroup$
    – Arthur
    Aug 8, 2018 at 8:42
  • $\begingroup$ It is OK, relax, sometimes correctness has its own beauty. $\endgroup$ Aug 8, 2018 at 8:56
  • $\begingroup$ @Arthur This is only true if there is a general formula or short list of values for $x$ in the 'other' case. If $x$ can be expressed in such a manner I would consider that preferable notation regardless of set sizes. However I'm interested in the specific case where such notation isn't possible, and I have to instead resort to something synonymous with 'other'. $\endgroup$
    – Ulysses
    Aug 8, 2018 at 10:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .