I've only seen the bump function $e^\frac1{x^2-1}$ so far. Where could I find examples of functions $C^∞$ on $\mathbb{R}$ that are zero everywhere except on $(-1,1)$?

Are there others that do not involve the exponential function? Are there any with a closed form integral? Is there a preferred function?

  • $\begingroup$ This question would be better if it were worded more precisely, for example by including the information in the first sentence of Robert Israel's answer below. $\endgroup$ Commented Jan 23, 2012 at 6:06
  • $\begingroup$ See math.meta.stackexchange.com/questions/34547/… $\endgroup$ Commented Feb 4, 2022 at 21:18

9 Answers 9


There is even simpler example from this book of Loring Tu.

You simply start with $$f(t)=\left\{\begin{array}{lr} 0&t\leqslant 0\\ e^{-1/t}&t>0 \end{array}\right..$$ Then you define $$g(t)=\frac{f(t)}{f(t)+f(1-t)}$$ and shift it to the right by creating $$h(t)=g(t-1).$$ To make it symmetric you put $$k(t)=h(t^2)$$ and finally to make it look like bump function you put $$\rho(t)=1-k(t).$$ It will look like this

$\hspace{4,5cm}$ enter image description here

As you can tell from the picture, Loring Tu covered more general case (he even generalised this construction to smooth manifolds of arbitrary dimension).

For more details and picutres go to Tus book.

BONUS I created plots of functions $f,g,h,k,\rho$ in this geogebra sheet. Enjoy.

  • $\begingroup$ who are a and b here? 1 and 2? $\endgroup$ Commented Mar 14 at 15:33
  • 1
    $\begingroup$ @GabrielPalau in the example that I gave, these a=1, and b=2. Look at the geogebra sheet at the end of my answer $\endgroup$ Commented Mar 14 at 15:37

Presumably what you want is a function that is $C^\infty$ on $\mathbb R$, nonzero on $(-1,1)$ and zero elsewhere. It's convenient to use something involving the exponential function because it's nonzero everywhere but goes to faster than any polynomial at $-\infty$ and it's easy to differentiate. If you really want to avoid the exponential function, you might try something like $$\frac{1}{I_0(1/(1-x^2))}$$ for $-1 < x < 1$ where $I_0$ is a modified Bessel function of order $0$.

For an example that has a closed-form antiderivative, you might try $$ \frac{\left( {x}^{2}+1 \right)\ {{\rm e}^{{\frac {4x}{{x}^{2}-1}}}}}{\left( \left( {x}^{2}-1 \right) \left( 1+{{\rm e}^{{\frac {4x}{{x}^{ 2}-1}}}} \right)\right)^2} $$

  • $\begingroup$ +1 Nice antiderivative. How did you come up with it? $\endgroup$
    – jnm2
    Commented Jan 23, 2012 at 13:29
  • 4
    $\begingroup$ I worked backwards: start with a nice "ramp" function and take its derivative. $\endgroup$ Commented Jan 23, 2012 at 17:26
  • 4
    $\begingroup$ Funny, I wanted a ramp function so my first idea was to integrate a bump function. Therefore this question. ;-) $\endgroup$
    – jnm2
    Commented Jan 23, 2012 at 22:54
  • $\begingroup$ I am curious to know whether $f(x) = e^{\frac{-1}{(x^2 -1)^2 } $ is still a bump function? It seems to me that it is. $\endgroup$
    – user209663
    Commented Jun 14, 2019 at 15:46

Here's how you can generate as many different kinds of bump functions as you want, for whatever definition of "kind" you may have:

  1. Start with any function $f(x)$ that grows faster than all polynomials, i.e. $\forall N, \ \lim_{x\to\infty}\frac{x^N}{f(x)}=0$. Example: $e^x$.
  2. Then consider the function $g(x)=\frac1{f(1/x)}$. This is a function that is flatter than all polynomials near zero, i.e. $\forall N,\ \lim_{x\to0}\frac{g(x)}{x^N}=0$. This is a a smooth non-analytic function. For our example, we get $e^{-1/x}$.
  3. Consider the function $h(x)=g(1+x)g(1-x)$. This, after zeroing out stuff outside the interval $(-1,1)$, is a bump function. For our example, $e^{2/(x^2-1)}$.
  4. Scale and transform to your liking.

Just do this with different "kinds" of growth functions $f$, and you'll get different "kinds" of bump functions $h$. So here are some functions I could generate with this method -- try to guess which functions they're from:

$$\begin{array}{l} h(x) = {e^{2/({x^2} - 1)}} \\ h(x) = (1 + x)^{1/(1 + x)}(1 - x)^{1/(1 - x)} \\ h(x) = \frac1{\frac1{1 + x}!\frac1{1-x}!} \\ h(x)=e^{-[\ln^2(1+x)+\ln^2(1-x)]} \end{array}$$

And the more rapidly your $f(x)$ grows, the nicer your bump function $h(x)$ looks.

Here's a Desmos applet to try this with different functions $f$: desmos.com/calculator/ccf2goi9bj.

If you're interested in smooth non-analytic functions, have a look at my post What's with e^(-1/x)? On smooth non-analytic functions: part I.

  • $\begingroup$ I was experimenting with your functions and I believe that $$h(x) = e^{-\log^2(1-x^2)}$$ is also a bump function. $\endgroup$
    – Joako
    Commented Nov 27, 2021 at 17:45
  • $\begingroup$ Also this related functions $$h(x) = e^{-\text{atanh}(x)^2}$$ and $$h(x) = e^{-\text{atanh}(x^2)^2}$$ $\endgroup$
    – Joako
    Commented Nov 27, 2021 at 18:21
  • $\begingroup$ Also $$h(x) = e^{-\log^2(\text{sinc}(\pi x))}$$ $\endgroup$
    – Joako
    Commented Nov 27, 2021 at 18:42

All of these involve breaking up the domain by inequalities and, whether visible or not, involve something no simpler that the exponential function. The original one-sided version is $$ f(x) = e^{-1/x} \; \mbox{for} \; x > 0 $$ but $$ f(x) = 0 \; \mbox{for} \; x \leq 0. $$

You can get a bump from this by multiplication with $$ g(x) = f( 1 + x) \cdot f(1 - x) $$

You get a smoothed step function from $$ h(x) = \int_{- \infty}^x \; g(t) dt $$

You get a plateau bump function, constant in the middle, from $$ p(x) = h(x + A) \cdot h(A -x) $$ for some $A > 1.$

We can prove some properties of this sort of thing. It has no removable singularity at the points where it is not real analytic, at best it has an essential singularity or possibly is not even defined in any neighborhood of the point in $\mathbb C.$

  • $\begingroup$ Can we construct $\rho$ such that up to its $p$th derivatives, where $p\in\mathbb{N},$ are controlled by prescribed constants? $\endgroup$
    – Idonknow
    Commented Dec 28, 2017 at 16:04

Even if that was not specifically asked for by the OP's question, two features that some people are looking for in a bump function are :

  1. a roughly flat top "plateau", as in @FallenApart answer
  2. a simple enough function that one can remember.

Here is a simple way to do so: $$ f(x) = \begin{cases} 0, \; \forall x \notin ]-1,1[\\ \exp\left(\frac{1}{x^{2n}-1}\right), \; \forall x \in ]-1,1[ \end{cases} $$ with $n\in\mathbb{N}$. For $n\in \{1,2,3,...,20\}$ this looks like this: enter image description here

  • $\begingroup$ Noé AC: here I have asked if the function you show could be used in the limit as a representation of the unitary step function... maybe you can answer it. $\endgroup$
    – Joako
    Commented Nov 27, 2021 at 19:01

Juan Arias de Reyna (2017) shows the existence of a bump function with the characteristics you mention. The paper is in the arXiv (1702.05442 [math.CA]). Specifically, as he says, it is a smooth function $\varphi$ such that

(a) $\mathrm{supp}(\varphi) = [-1,1]$,

(b) $\varphi(t) > 0$ for any $t \in (-1, 1)$,

(c) $\varphi(0) = 1$,

(d) and there is a constant $k > 0$ such that for any $t \in \mathbb{R}$

$$\varphi'(t) = k(\varphi(2t+1) - \varphi(2t-1))$$

(e) later is shown that must be $k=2$.

That is, a function that is non-null around zero, is 1 at zero, and satisfies that funny condition. That condition, as a matter of fact, comes from the intuition that such a bump function's derivative looks like two transformed copies of the original function.

Though there's no neat formula for the function, the author gives four different expressions for it.

  1. As an integral of a power series (involving its Fourier transform);
  2. as a limit to a sequence of functions defined by convolution;
  3. as “a limit of a sequence of step functions”;
  4. as the measure of a subset of $[0,1]^{\mathbb{N}}$ parametrized by its argument – also, this way of looking at the function lets you interpret it as a probability, or a measure in itself (see the paper for details).

This are all quite involved, but the proposed function has the benefit of being entirely constructive, as opposed to the usual ones. Bear in mind, splitting the line based on inequalities is usually non-constructive (though in this case they might be).

  • 1
    $\begingroup$ It is a scaled&displaced version of the Fabius function, a function that is "infinitely differentiable function that is nowhere analytic" $\endgroup$
    – Joako
    Commented May 29, 2023 at 14:08
  • $\begingroup$ Actually is $$f(x)=\begin{cases} F(x+1),\quad |x|<1\\ 0, |x|\geq 1\end{cases}$$ with $F(x)$ the Fabius function, also known as the Rvachëv function $\endgroup$
    – Joako
    Commented Jun 17, 2023 at 19:59

Let ${ a \lt b }.$ We can try constructing an ${ f \in \mathcal{C} ^{\infty} (\mathbb{R}) }$ which is ${ \gt 0 }$ on ${ (a,b) }$ and ${ 0 }$ everywhere else.

Any such $f$ is a bit interesting : All left hand derivatives ${ f ^{(j)} (a -) }$ are $0$ so all ${ f ^{(j)} (a) }$ are $0.$ Hence all Taylor polynomials ${ P _n (x) = f(a) + f'(a) (x-a) + \ldots + \frac{f ^{(n)} (a)}{n!} (x-a) ^n }$ are $0,$ even though $f$ is nonzero as a function on every ${ (a - \delta, a + \delta) }.$

It suffices to find a ${ g \in \mathcal{C} ^{\infty} (\mathbb{R}) }$ which is ${ \gt 0 }$ on ${ (0, \infty) }$ and $0$ everywhere else.

If ${ g _1, g _2 }$ are two such functions (not necessarily distinct), then ${ g _1 (x - a) g _2 (b - x) }$ would work : It is ${ \mathcal{C} ^{\infty} }$ on $\mathbb{R},$ is $0$ when ${ x \leq a }$ or ${ x \geq b },$ and is $\gt 0$ on $(a,b).$

It suffices to find a ${ h : (0, \infty) \to \mathbb{R} _{\gt 0} }$ which is ${ \mathcal{C} ^{\infty} }$ and such that ${ h(t), \frac{h(t)}{t}, \frac{h'(t)}{t}, \frac{h ^{(2)} (t)}{t}, \ldots }$ all go to $0$ as $t \to 0 ^{+}$

Because then the function which is $h(x)$ on $(0, \infty)$ and $0$ everywhere else is a valid $g.$
Also notice if ${ h _1, h _2 }$ are two such functions and ${ \alpha \gt 0 },$ so are ${\alpha h _1, h _1 + h _2 }$ and ${ h _1 h _2 }.$

Looking for valid $h$ :
We must have ${ \lim _{t \to 0 ^+} \frac{h(t)}{t} = 0 },$ ie ${ \lim _{x \to \infty} x h(\frac{1}{x}) = 0 },$ ie ${ \lim _{x \to \infty} \dfrac{x}{ { \color{purple}{(\frac{1}{ h( \frac{1}{x} ) } )} } } = 0. }$
So maybe setting ${ { \color{purple}{\frac{1}{ h (\frac{1}{x}) }} } = e ^x },$ ie setting ${ h(t) = e ^{- \frac{1}{t} } },$ would work ? We can check it does.

Each ${ \frac{ h ^{(k)} (t) }{t} }$ is an ${ \mathbb{R}- }$combination of finitely many terms of the form ${ e ^{- \frac{1}{t} } t ^{\nu} }$ (with ${ \nu \in \mathbb{Z} }$). Further ${ \lim _{t \to 0 ^{+}} e ^{-\frac{1}{t}} t ^{\nu} = \lim _{x \to \infty} e ^{-x} x ^{-\nu} = 0}$ for every integer $\nu.$

There are many more valid $h.$ For example, the above verification suggests a riskier guess of ${ { \color{purple}{\frac{1}{ h (\frac{1}{x}) }} } = e ^{x ^j} x ^k }$ ${ (j, k \in \mathbb{Z}; j \gt 0), }$ ie ${ h(t) = e ^{ -\frac{1}{t ^j} } t ^k }$ ${ (j, k \in \mathbb{Z}; j \gt 0) }$ could've also worked. A similar verification shows it does work.

Eg: Let ${ a \lt b }.$ Take ${ h _1 (t) = e ^{ - \frac{1}{ t ^2 } } \frac{1}{t ^3} }$ and ${ h _2 (t) = e ^{ - \frac{1}{t} } \frac{1}{t ^2} }$ and consider the corresponding $g _1, g _2.$ Now we see the function, given by ${ \frac{1}{ (t-a) ^3 (b-t) ^2} e ^{ - \frac{1}{(t-a) ^2} } e ^{- \frac{1}{b-t} } }$ on $(a,b)$ and $0$ everywhere else, is ${ \mathcal{C} ^{\infty} }$ on $\mathbb{R}.$

As in Will Jagy's answer, we can get plateau bump functions from these.

  • $\begingroup$ Do you think these kind of functions could be candidates to solve $\varphi'(t)=k\left(\varphi(2t+1)-\varphi(2t-1)\right),\,\varphi(0)=1,\, \varphi(t)=0\,\forall |t|\geq 1$? (from here). $\endgroup$
    – Joako
    Commented Apr 7, 2022 at 18:10
  • $\begingroup$ Ah, interesting ! Intuitively it doesn't seem so $\endgroup$ Commented Apr 8, 2022 at 5:34

I believe that many of the bump functions $\in C_c^\infty$ given in the answers could be defined in the whole $\mathbb{R}$ instead of piecewise by using a slight modification of the answer given by @José Carlos Santos: I believe is been "informally proved" here that the following function is a bump function $\in C_c^\infty$ that is not defined piecewise: $$f(x) = \left(1-x^2+ \sqrt{\left(1-x^2\right)^2}\right)\exp\left(-\frac{x^2}{1-x^2}\right)$$

If the triangular function is defined as: $$\Lambda(x) = \frac{1}{2}\left(|1+x|+|1-x|-2|x| \right)$$

It looks like for bump functions $b(x)$ defined piecewise in $x \in [-1,\,1]$, their domain could be extended by using $g(x) = b(x)\Lambda(x^n)$ with integer $n \geq 2$. Above I have used $\Lambda(x^2) = 1-x^2+|1-x^2|$. Also positive powers of $\Lambda^m(x^n), m\in\mathbb{Z}^+$ will work.


You can take the limit of convolving step functions of length $2^-n$ for $n$ positive integers. The limit exists since each point is eventually left constant. The support will be an interval of length $1$, and since each convolution kills the derivatives of order n, the limit is a smooth function, since it can be written as a convolution with a $C^{n}$ function for arbitrarily large $n$.

Alternatively, since smooth bump functions have Fourier transforms, we can note that their Fourier transform is determined by being expressible as a convolution with the sinc function and falling off faster than any inverse polynomial at high frequencies.

Also, there is a variation on this where you start directly with triangle functions $\mathrm{max}(0,1 - 2^n|x|)$ to keep everything intuitionistic, and to also get for free that you have a partition of unity at all steps.


You must log in to answer this question.

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