How to construct a bump function ends at different value? May I ask how to construct a ''bump'' function ends at different value? For example: $\Psi\colon [0,1] \to [0,1]:$
$$ \Psi (x) = 
  \begin{cases}
    0 & \quad \text{for $0 \leq x < 1/3$}\\
    ??? & \quad  \text{for $1/3 \leq x < 1/2$}\\
   1 & \quad \text{otherwise}
  \end{cases}$$
 A: Take $$g(t)=\left\lbrace
\begin{array}{ll}
 \exp\left(-1/t^2 \right) & t>0 \\
 0 & t\leq 0
\end{array}\right.$$
Now define
$$\phi(t) = \left(\int_{-1}^{t}h(\tau)d\tau\right)\cdot \left(\int_{-1}^{t}h(\tau)d\tau\right)^{-1} $$
with
$$h(t) = g(1+t)\cdot g(1-t)$$
Now take a look at
$$f(x) = \phi\left(\frac{R+r-2\|x-a\|}{R-r}\right)$$
Hence function is equals to $0$ for $\|x-a\|\geq R$ and $1$ for $\|x-a\|\leq r$, i.e.
$$f(x)=\left\lbrace
\begin{array}{ll}
1 & \|x-a\|\geq R\\
0 & \|x-a\|\leq r
\end{array}\right.$$
and for all $x$ with $r<\|x-a\|<R$ it it increasing from $0$ to $1$
Furthermore $f$ is actually a $\mathcal{C}^{\infty}$-function. Your part is just to find convenient values for $r$, $R$ and $a$ so that $f$ fullfills your requirements.
A: Let $\varphi$ be a $C^\infty$ function on $\mathbb R$ such that $\varphi(x) = 0$ for $x\leq 0$ and $\varphi(x)\not = 0$ for $x>0$. An example is
$$
\varphi(x) = \left\{\begin{array}{ll}
0 & x\leq 0, \\
e^{-1/x} & x>0.
\end{array}\right.
$$
Now put
$$
\psi(x) = {\varphi(x)\over \varphi(x) + \varphi(1-x)}.
$$
Since the denominator never vanishes, $\psi \in C^\infty(\mathbb R)$. You can easily check, moreover, that $\psi(x) = 0$ for $x\leq 0$ and $\psi(x) = 1$ for $x\geq 1$.
Once you have $\psi$, constructing your $\Psi$ is easy: Just define
$$
\Psi(x) = \psi(6x-2).
$$
