# How to build a smooth "transition function" explicitly?

It is easily shown that the function $$\begin{cases} \exp \left(\frac{1}{x^2-1} \right) & |x| < 1 \\ 0 & \text{otherwise} \\ \end{cases}$$ is smooth and has compact support in $\mathbb R$. I tried playing with it to find a function with the following properties:

a. $f(x)=0$ for $x \le 0$

b. $f(x)=1$ for $x \ge 1$

c. $f$ is monotonically increasing.

d. $f$ is smooth.

Is it possible to find an explicit formula for such $f$?

Let $$h(x) = \left\{\begin{array}{c} 0 & x \leq 0 \\ e^{-1/x} & x > 0 \end{array} \right.$$

Then consider $$g(x) = \frac{h(x)}{ h(x) + h(1-x)}$$

It is smooth because it is the ratio of smooth functions with the denominator never $0$.

To verify it is increasing, we can calculate the sign of the numerator of $g'(x)$ using quotient rule between $0 < x < 1$:

\begin{align} N g'(x) = & h'(x)(h(x) + h(1-x)) - h(x)(h'(x) + h'(1-x)) \\ = & \frac{1}{x^2} h(x) h(1-x) + \frac{1}{(1-x)^2} h(x)h(1-x) \\ > & 0 \end{align}

I've found this other explicit construction of a transition function (I believe it's from Spivak's Calculus on Manifolds).

1. Let $$g(x)=\begin{cases} \exp \left( \frac{1}{x^2-1} \right) & |x|<1 \\ 0 & |x| \geq 1 \end{cases}$$ and let $A:=\int_{-\infty}^\infty g(x) \mathrm{d}x$.

2. The function $$f(x):=\frac{1}{A} \int_{-\infty}^x g(t) \mathrm{d} t$$ satisfies the requirements (up to a simple change of variables of the form $x \mapsto ax+b)$.