How to find a differentiable function with bounded derivative satisfying some boundary conditions? I am trying to find an example, preferably an explicit one, of a differentiable function $g:\mathbb{R}\rightarrow \mathbb{R}$ satisfying the following conditions:


*

*$\displaystyle g(0)=0, g(1)=1, g(-1)=-1;$

*$\displaystyle g^\prime(1)=g^\prime(-1)=\frac{1}{2};$

*$\displaystyle g^\prime(x)\geq\frac{1}{2} \quad \forall x\in [-1,1].$
The function $g(x)=x$ satisfies the first and the last conditions, but we need to modify it, at least locally around the points $x=\pm1$, to meet the constraints about derivatives at the end points. It is plausible that this can be done with some smooth additive modifier functions, but explicit examples may not be easy to find.
 A: Focus on constructing the derivative $h=g'$ first. It must meet certain requirements: $\int_0^1 h =1 = \int_{-1}^0 h$, etc., but all these can be fulfilled with a piecewise linear function with breaks at $0,-1,1$. Then integrate and get $g$.
A: Following the useful hint of $\textbf{Gerry Myerson}$ we give the solution of my question.
Let $g(x)=a\arctan(bx)$. We will choose $a,b\in \mathbb{R}$ satisfying the given conditions. We observe that
$$
\begin{cases}
g(0)=0&\\
g(1)=1&\\
g(-1)=-1&
\end{cases}
\Longleftrightarrow \quad
a\arctan(b)=1.
$$
and 
$$
g^{\prime}(x)=\frac{ab}{1+b^2x^2}\geq \frac{ab}{1+b^2}=g^{\prime}(1)=g^{\prime}(-1) \quad \forall x\in [-1,1], \forall a,b>0
$$
Therefore, to accomplish our goal it suffices to choose $a,b>0$ such that
$$
\textbf{(I)}\quad
\begin{cases}
a\arctan(b)=1,&\\
\frac{ab}{1+b^2}=\frac{1}{2}.&
\end{cases}
$$
Let 
$$
h(b)=\displaystyle\frac{2b}{1+b^2}-\arctan(b), \quad b\in (0, +\infty)
$$
Since $h(b)$ is continuous on $(0, +\infty)$, $h(1)=1-\frac{\pi}{4}>0$ and
$$
\lim_{b\rightarrow +\infty}h(b)=-\frac{\pi}{2}<0
$$
there exists $b>0$ such that $h(b)=0$. Hence there exists $a,b >0$ satisfying $\textbf{(I)}$.
A: The candidate $g(x)=x$ is otherwise ok, but fails the conditions $g'(\pm1)=1/2$. A natural idea is to add a term that vanishes at $x=0$ and $x=\pm1$, but fixes the values of those derivatives.
The polynomial $r(x)=x^3-x$ is the simplest function vanishing at the critical points $x=0,x=\pm1$. There is no guarantee that using its multiple as a correction term should work, but, lo and behold:

*

*The derivative $r'(x)=3x^2-1$ takes value $2$ at both points $x=\pm1$.

*So the polynomial
$$ g(x)=x-\frac14r(x)=\frac54x-\frac14x^3$$
has the correctt derivative at the points $x=\pm1$ and the correct value at the points $x=0$, $x=\pm1$.

*Furthermore,
$$g'(x)=\frac54-\frac34x^2\ge\frac54-\frac34=\frac12$$ for all $x\in[-1,1]$.

The plot of this polynomial $g(x)$ surely resembles the picture that anyone who thought about this question had in mind.

A: Using the Fundamental Theorem you know that $\displaystyle\int_{-1}^1 g'(x) dx = 2.$ Plotting the known points of $g'$ together with the constraint shows that half of this area is accomodated by a rectangular box. The other half is easily obtained by constructing an isoceles triangle of area one to sit on top of it. You can check that the resulting $g$ has the remaining desired properties.
A: You may be able to find values of $a$ and $b$ such that $y=a\arctan bx$ works. 
