I am trying to find a $C^\infty$ function $\phi(t)$ with the following properties.
- $\phi(t) =1$ for $\lvert t \rvert \le 1$
- $\phi(t)$=0 for $t \geq 2$
- $\lvert \phi'(t) \rvert \le 2 $
I have tried the obvious function $\exp\left(\frac{1}{t^2-1} \right)$ as follows.
$$ \phi(t)=\begin{cases} 1 & \mbox{if} & \lvert t \rvert \le 1\\ \exp\left(\frac{1}{t^2-1}\right) & \mbox{if} & -2 < t < -1 \; \mbox{or} \; 1 < t < 2 \\ 0 & \mbox{if}& \lvert t \rvert \geq 2 \end{cases} $$
But I can't seem to get the required bound on the derivative of $\phi(t)$.
Question?: What am I doing wrong here?. How can I adjust/improve this to get the bound I want?. Any suggestions?
Let $f(t) = \begin{cases}e^{-1/t} & t > 0 \\ 0 & t \le 0\end{cases}$, $g(t) = \dfrac{f(2-t)}{f(t-1)+f(2-t)}$, and $\phi(t) = g(|t|)$.
It is well known that $f \in C^{\infty}$.
Since $\max\{t-1,2-t\} \ge \frac{1}{2} > 0$, one of $f(t-1)$ and $f(2-t)$ is strictly positive. The other is non-negative. Hence $f(t-1)+f(2-t) > 0$. Thus, $g \in C^{\infty}$.
Since $g$ is constant near $t = 0$, and $|t|$ is infinitely differentiable at all $t \neq 0$, we have that $\phi \in C^{\infty}$.
If $|t| \le 1$, then $f(|t|-1) = 0$, and so $\phi(t) = g(|t|) = 1$.
If $|t| \ge 2$ then $f(2-|t|) = 0$, and so $\phi(t) = g(|t|) = 0$.
All that remains is to check that $|\phi'(t)| \le 2$
Here is a picture of $\phi(t)$: