Are there other kinds of bump functions than $e^\frac1{x^2-1}$? 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?
 A: 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 :


*

*a roughly flat top "plateau", as in @FallenApart answer

*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:

A: 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.

*

*As an integral of a power series (involving its Fourier transform);

*as a limit to a sequence of functions defined by convolution;

*as “a limit of a sequence of step functions”;

*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).
A: 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}$

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.
A: 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} $$
A: 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.$
A: Here's how you can generate as many different kinds of bump functions as you want, for whatever definition of "kind" you may have:


*

*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$.

*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}$.

*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)}$.

*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.
A: 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.
A: 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.
A: 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.
