Definition of the function Consider the function :f(x)=\begin{cases}e^{-\frac{1}{x}}&\text{if }x>0,\\ 0&\text{if }x\le0,\end{cases} defined for every
real number x.
The function is smooth The function
f has
continuous derivatives of all orders at every point
x of the
real line. The formula for these derivatives is :f^{(n)}(x) = \begin{cases}\displaystyle\frac{p_n(x)}{x^{2n}}\,f(x) & \text{if }x>0, \\ 0 &\text{if }x \le 0,\end{cases} where
pn(
x) is a
polynomial of
degree n − 1 given
recursively by
p1(
x) = 1 and :p_{n+1}(x)=x^2p_n'(x)-(2nx-1)p_n(x) for any positive
integer n. From this formula, it is not completely clear that the derivatives are continuous at 0; this follows from the
one-sided limit :\lim_{x\searrow 0} \frac{e^{-\frac{1}{x}}}{x^m} = 0 for any
nonnegative integer
m. By the
power series representation of the exponential function, we have for every
natural number m (including zero) :\frac1{x^m}=x\Bigl(\frac1{x}\Bigr)^{m+1}\le (m+1)!\,x\sum_{n=0}^\infty\frac1{n!}\Bigl(\frac1x\Bigr)^n =(m+1)!\,x e^{\frac{1}{x}},\qquad x>0, because all the positive terms for n \neq m+1 are added. Therefore, dividing this inequality by e^{\frac{1}{x}} and taking the
limit from above, :\lim_{x\searrow0}\frac{e^{-\frac{1}{x}}}{x^m} \le (m+1)!\lim_{x\searrow0}x=0. We now prove the formula for the
nth derivative of
f by
mathematical induction. Using the
chain rule, the
reciprocal rule, and the fact that the derivative of the exponential function is again the exponential function, we see that the formula is correct for the first derivative of
f for all
x > 0 and that
p1(
x) is a polynomial of degree 0. Of course, the derivative of
f is zero for
x f'(0)=\lim_{x\searrow0}\frac{f(x)-f(0)}{x-0}=\lim_{x\searrow0}\frac{e^{-\frac{1}{x}}}{x}=0. The induction step from
n to
n + 1 is similar. For
x > 0 we get for the derivative :\begin{align}f^{(n+1)}(x) &=\biggl(\frac{p'_n(x)}{x^{2n}}-2n\frac{p_n(x)}{x^{2n+1}}+\frac{p_n(x)}{x^{2n+2}}\biggr)f(x)\\ &=\frac{x^2p'_n(x)-(2nx-1)p_n(x)}{x^{2n+2}}f(x)\\ &=\frac{p_{n+1}(x)}{x^{2(n+1)}}f(x),\end{align} where
pn+1(
x) is a polynomial of degree
n = (
n + 1) − 1. Of course, the (
n + 1)st derivative of
f is zero for
x (
n) at
x = 0 we obtain with the above limit :\lim_{x\searrow0} \frac{f^{(n)}(x) - f^{(n)}(0)}{x-0} = \lim_{x\searrow0} \frac{p_n(x)}{x^{2n+1}}\,e^{-1/x} = 0.
The function is not analytic As seen earlier, the function
f is smooth, and all its derivatives at the
origin are 0. Therefore, the
Taylor series of
f at the origin converges everywhere to the
zero function, :\sum_{n=0}^\infty \frac{f^{(n)}(0)}{n!}x^n=\sum_{n=0}^\infty \frac{0}{n!}x^n = 0,\qquad x\in\mathbb{R}, and so the Taylor series does not equal
f(
x) for
x > 0. Consequently,
f is not
analytic at the origin.
Smooth transition functions The function :g(x)=\frac{f(x)}{f(x)+f(1-x)},\qquad x\in\mathbb{R}, has a strictly positive denominator everywhere on the real line, hence
g is also smooth. Furthermore,
g(
x) = 0 for
x ≤ 0 and
g(
x) = 1 for
x ≥ 1, hence it provides a smooth transition from the level 0 to the level 1 in the
unit interval [0, 1]. To have the smooth transition in the real interval [
a,
b] with
a \mathbb{R}\ni x\mapsto g\Bigl(\frac{x-a}{b-a}\Bigr). For real numbers , the smooth function :\mathbb{R}\ni x\mapsto g\Bigl(\frac{x-a}{b-a}\Bigr)\,g\Bigl(\frac{d-x}{d-c}\Bigr) equals 1 on the closed interval [
b,
c] and vanishes outside the open interval (
a,
d), hence it can serve as a
bump function. ==A smooth function that is nowhere real analytic==