I am doing an assignment but I do not know how to do this problem. I have the following: $$ f(x)= \begin{cases} 0 & \text{for $x<0$},\\ x & \text{for $x\geq 0$}. \end{cases} $$

We are meant to determine whether it is continuous or not. I do not know why there is like a bracket with a $0$ up top and an $x$ at the bottom, nor do I understand what is meant by for $x \geq 0$. Basically, I do not understand the whole thing. What is this sort of function called so I can do some research on it (I plan to look it up on khan academy)?

  • 10
    $\begingroup$ Piecewise function. $\endgroup$ – barak manos Mar 8 '15 at 9:19
  • 1
    $\begingroup$ This is the positive part function denoted by $f(x)=(x)_+$. In some sense, this is the primitive of the positive part of the sign function. $\endgroup$ – Quickbeam2k1 Mar 8 '15 at 9:20

As others have mentioned, what you have is called a piecewise function. This literally means "pieces" of your function are defined differently.

For $$ f(x)= \begin{cases} 0 & \text{for $x<0$},\\ x & \text{for $x\geq 0$}, \end{cases} $$ it may help you to actually draw what the function $f(x)$ looks like for some sample values. For example, the following is what your $f(x)$ looks like on the interval $-5\leq x\leq 5, 0\leq y\leq 5$:

$\color{white}{Please do center this}$enter image description here

Added: It may help (for the OP) to know that the following block of code (Mathematica) was used to generate the figure above: Plot[Piecewise[{{0, x < 0}, {x, x >= 0}}], {x, -5, 5}]

You can see the effect on Wolfram|Alpha if you like (and you can toy around with the parameters to see how things might change if you so desire).

  • 1
    $\begingroup$ Note that, after the 'bracket', you need to read in rows (it may look like a matrix, but it is not) $\endgroup$ – Sanchises Mar 8 '15 at 16:39

In general, as barak manos said, this is a piecewise function. It's a function that we define using a certain expression for some $x$ and another one for some other $x$. For example, what is $f(x)=|x|$? You know that if $x\ge 0$, which means $x\in [0,+\infty )$, then $|x|=x$ and if $x\le 0$, which means $x\in (-\infty ,0]$, then $|x|=-x$. So: $$ f(x)=|x| = \begin{cases} x & x\ge0, \\ -x & x<0. \end{cases} $$

Same thing goes for your function: to calculate the value of $f(x)$ for a certain $x$, you must first see what condition your $x$ satisfies. For example, $-3<0$ thus $f(-3)=0$.


just to be pedantic, there is no such thing as a "piecewise function", i.e. "piecewise" doesn't name a class of functions but rather a way to simply describe functions by case distinction. Every function (that can be described anyhow) can be (trivially) described as "piecewise" e.g. the function $f:\mathbb{R}\to \mathbb{R}$ with $f(x)=x^2$ could written as $$ f(x)=\begin{cases} x^2\text{ if } x<0\\ x^2 \text{ otherwise} \end{cases} $$

I think what causes trouble with such descriptions is the fact that most beginners in math do think of functions as some kind of "algebraic term with variables" and not of abstract objects that could be described in many ways..

  • $\begingroup$ It would be worthy of note that though "piecewise function" is not really a well-defined subset of functions, terms like "piecewise linear" and "piecewise smooth" are precise terms describing the intrinsic nature of a function rather than their definitions. (Though "piecewise smooth" isn't necessarily non-smooth, as your example illustrates) $\endgroup$ – Milo Brandt Mar 8 '15 at 21:52

What is this sort of function called ?

This is the ramp function.

  • $\begingroup$ That may be. (You are correct, to be clear) But, Op asked about this type of function, and the answer is piecewise. Not all piecewise functions are ramp. $\endgroup$ – JTP - Apologise to Monica Mar 8 '15 at 19:08
  • 2
    $\begingroup$ @JoeTaxpayer: Contrary to popular opinion, I am not a mind reader, so I can't possibly be expected to guess what the OP “really” meant to ask. Aside from that, I am also a former engineering student. Studying the response of a system to various basic inputs, such as the afore-mentioned ramp function, as well as a few others $($ Dirac impulse, step function, etc.$)$ forms a major part of our education. $\endgroup$ – Lucian Mar 8 '15 at 20:40
  • $\begingroup$ Fair enough, I have a BSEE, and recognized the function, but expected he wanted the general answer. Not a big deal. $\endgroup$ – JTP - Apologise to Monica Mar 8 '15 at 22:04

This is an example of a piecewise function.

The big bracket means that the function is evaluated differently depending on what domain $x$ is in.

When $x < 0$ then $f(x) = 0$.

When $x \geq 0$ then $f(x) = x$.

Continuous functions are functions that do not have any gaps.

This function is continuous.

An example of a function that is not continuous would be

$$ f(x)= \begin{cases} 0 & x<0\\ 1 & x\geq 0 \end{cases} $$ This is not continuous because there is a gap between the line segments at $x = 0$.

  • $\begingroup$ For a more technical definition of continuity see Weierstrass definition of continuity. en.wikipedia.org/wiki/… $\endgroup$ – sav Mar 8 '15 at 9:39
  • 1
    $\begingroup$ Are you sure that $$ f(x)= \begin{cases} 0 & x<0\\ x & x>0. \end{cases} $$ is not continuous? $\endgroup$ – MattAllegro Mar 8 '15 at 9:57
  • 1
    $\begingroup$ @MattAllegro Good point $lim_{x->c}f(x) =f(c)$ is definition of continuous function $\endgroup$ – sav Mar 8 '15 at 10:23

This function may be defined as $f\colon\Bbb R\to\Bbb R$, $$f(x)=\mathrm{max}(0,x).$$ It is $f(x)=x$ for all $x$ greater or equal to $0$, hence it is $f(x)=0$ for $x=0$.

It is continuous in $0$ (check the definition of continuity for real functions of one real variable), hence it is continuous over all $\Bbb R$: before $0$ it is a constant function and after $0$ it is the identity function.

The derivative $f'(x)$ is not continuous in $0$ instead.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.