I am studying a proof in a differential geometry book where the author use a a smooth function satisfying some properties. Here is what it is claimed. $\forall 0 < \epsilon < \pi$ there exists a $C^{\infty}$-function $f : [0,1] \rightarrow \mathbb{R}$ satisfying the following properties
$f(x)=0$, near $0$
$f(x)= \pi - \epsilon$, near $1$
$0 \leq f(t) < \pi - \epsilon, \forall t$
$0 \leq f'(t) < \pi $
I was not able to show that such a function exists (althought it seems obvious). Here is what I have done.
I first define the bell shaped function $f$ as follows
$ f(x) = \begin{cases} c \cdot exp(\frac{-1}{1-(2x-1)^2}) & x \in (0,1) \\ 0 & else \\ \end{cases} $
Where $c = \frac{1}{\int_{- \infty}^{\infty} f(x) dx}$
It can be shown that $f$ is $C^{\infty}$. Now I set $h(x)= \int_{- \infty}^{x} f(t) dt$. Then I have that $h(x)=0$ if $x<0$ and that $h(x)=1$ if $x>1$. Also we have $0 < h(x) <1$.
My idea was now to find two parameters $a$ and $b$, possibly depending on $\epsilon$ and to do the same construction, but on an open interval $I \subset (0,1)$. Do I need to find out an explicit expression for $I$ ? Then I did the following construction
$ f(x) = \begin{cases} c \cdot exp(\frac{-1}{1-((2+\eta)x-(1+\kappa))^2}) & x \in I \\ 0 & else \\ \end{cases} $
The constant $c$ being defined as the value of the integral, just like before. Then I tried to set $h(x)= (\pi - \epsilon) \int_{- \infty}^{x} f(t) dt$
By taking the restriction of $h$ on $[0,1]$ I have constructed a function which satisfies properties 1 to 3 but unfortunately not the last one...
Did I make a mistake in my calculation ? Is there an easier way to show the existence of such functions ?
Many thanks for your help