Find monotonic function with boundary constraints I need to find a function $f(x) \in \mathbb{R}$ where $x \in [0, T]$ with the following conditions:

*

*Monotonic function

*Class $C^4$ i.e. differentiable at least 4 times

*$f(0) = 0$

*$f(T) = 1$

*$\dot{f}(0) = 1$

*$\dot{f}(T) = 1$

*$\ddot{f}(0) = 0$

*$\ddot{f}(T) = 0$

*$\dddot{f}(0) = 0$

*$\dddot{f}(T) = 0$

*$\ddddot{f}(0) = 0$

*$\ddddot{f}(T) = 0$
I tried with a polynomial function with high enough degree, imposing all the initial and final conditions, but it always come up non-monotonic.
Any tip?
 A: Too long for a comment, but not a full solution.
This solution is quite complicated and only works for $T > 1$ (but should be modifiable for $T \in (0, 1)$), but it is the only one I have been able to come up. Note that for this function, the 4 above can be replaced by any other positive integer, i.e. the function is $C^{\infty}$ and $f^{(n)}(0) = f^{(n)}(L) = 0$ for all $n \in \mathbb N$, which suggest that there must be a simpler solution.
I started with
$$
g_L \colon [0, L] \to [0, 1], \ 
x \mapsto \begin{cases}
x, & \text{if } x \in \left[0, \frac{1}{2}\right), \\
\frac{1}{2}, & \text{if } x \in \left[\frac{1}{2}, L -\frac{1}{2}\right], \\
x - L + 1, & \text{if } x \in \left(L - \frac{1}{2}, L \right].
\end{cases}
$$
Note that the value of $\frac{1}{2}$ is chosen pretty arbitrarily.
It looks like this (for $L = 2.2$):

It clearly fulfils all above mentioned properties and is monotonically increasing, except not being differentiable at two points.
We now remedy this by "smoothing out the kinks".
For the first kink (I leave the second one to you) consider $h(x) = \exp(-x^{-1}) \cdot \mathbb{1}_{x > 0}(x)$ and $p(x) := \frac{h(x)}{h(x) + h(1 - x)}$, which  are in $C^{\infty}$ (but not analytical).
Now consider the smoothed version
$$
f_L \colon [0, L] \to [0, 1], \ 
x \mapsto \begin{cases}
x, & \text{if } x \in \left[0, \frac{1}{4}\right), \\
\frac{1}{2} p\left(\frac{10 x + 1}{7}\right)\cdot p(5 -  5x), & \text{if } x \in \left[\frac{1}{4}, \frac{1}{2}\right), \\
\frac{1}{2}, & \text{if } x \in \left[\frac{1}{2}, L -\frac{1}{2}\right], \\
x - L + 1, & \text{if } x \in \left(L - \frac{1}{2}, L \right],
\end{cases}
$$
which looks like this

I am not sure if $f_L$ is $C^{\infty}$ at $x = \frac{1}{4}$, but there definitely is a way to properly smoothen $g_L$ out.
A: Let us look for a polynomial $f$ satisfying the conditions. Let $\dot{f}=1+p$. Putting $p(x)=Ax^4(x-T)^4q(x)$ for some constant $A$, and $f(x)=\int_0^x 1+p(t)dt$, we satisfy all conditions but $f(T)=1$ and the monotonicity. The latter is satisfied iff $1+p(x)\ge 0$ for all $x\in [0,T]$.
One of the simplest choices for $q$ is to put $q\equiv 1$. Then we have $1=f(T)=T+\tfrac{AT^9}{630}$, which gives $A$. When $T\le 1$, $A\ge 0$ and all conditions are satisfied. If $A<0$ then the minimum $m=1+A\left(\tfrac T2\right)^8$ of $1+p(x)$ is attained when $x=\tfrac T2$. Then $m=\tfrac{315-187T}{128 T}$, and the conditions are satisfied when $m\ge 0$, that is when $T\le \tfrac {315}{187}$. It this range of $T$ sufficient for your needs or should we try to extend it using a more complex $q$?
A graph of $f$ for $T=\tfrac {315}{187}$:

A: Follows a MATHEMATICA script which generates a polynomial feasible function. Here
n = polynomial degree,
xmax = L,
px = found polynomial
n = 11;
xmax = 1.7;
Clear[p, x, px]
p[x_] := Sum[Subscript[a, k] x^k, {k, 1, n}]
r1 = {D[p[x], x] - 1, D[p[x], x, x] - 0, D[p[x], x, x, x] - 0, D[p[x], x, x, x, x] - 0} /. {x -> 0};
r2 = {p[x] - 1, D[p[x], x] - 1, D[p[x], x, x] - 0, D[p[x], x, x, x] - 0, D[p[x], x, x, x, x] - 0} /. {x -> xmax};
rs = Join[r1, r2];
dx = 1/(2 n);
dp = D[p[x], x];
rest = Table[dp >= 1/n, {x, dx, xmax - dx, dx}];
restrs = Join[rest, Thread[rs == 0]];
vars = Table[Subscript[a, k], {k, 1, n}];
sol = FindInstance[restrs, vars];
If[Length[sol] > 0, {px = p[x] /. sol; Plot[px, {x, 0, xmax}], dpx = D[px, x]; Plot[{dpx, 0}, {x, 0, xmax}], px}, Print["Increase n"]
]

Constraints verification
{D[px, x] - 1, D[px, x, x] - 0, D[px, x, x, x] - 0,  D[px, x, x, x, x] - 0} /. {x -> 0}
{px - 1, D[px, x] - 1, D[px, x, x] - 0, D[px, x, x, x] - 0, D[px, x, x, x, x] - 0} /. {x -> xmax}
rest /. sol

