# Give an example of continuously differentiable function that satisfy some properties

Can you give an example of continuously differentiable function that satisfy this properties:

Let $$\{(a_i, b_i)\}_{i=1}^{\infty}$$ be the family of open subintervals of $$[0,1]$$ with rationals endpoints. For each $$i\geq 1$$, let

$$g_i:[a_i,b_i]\to [0,1]$$

be a continuously differentiable function such that

1. $$g_i(a_i)=1$$, $$g_i(b_i)=0$$,
2. $$\lim_{x\to a_i^+} g_i^{\prime}(x)=0$$,
3. $$\lim_{x\to b_i^-} g_i^{\prime}(x)=0$$.

I have tried to make some examples, this is my attempt:

1. $$g_i(x)=\frac{b_i-x}{b_i-a_i}, a_i\leq x \leq b_i$$. But, this function not satisfy properties poin (3) and (4).
2. \begin{align*} g_i(x)=\begin{cases} 1,& a_i\leq x < \frac{a_i+b_i}{2}\\ \frac{16x-4a_i-12b_i}{a_i-b_i},& \frac{a_i+b_i}{2}\leq x < \frac{a_i+3b_i}{4}\\ 0, & \frac{a_i+3b_i}{4}\leq x \leq b_i \end{cases} \end{align*} This function satisfies properties poin (1)-(4), but this is not continuously differentiable.

Finally, I got stuck on finding an example of that function. Any helps will be appreciated.

• Are your intervals disjoint? Apr 28 '21 at 5:01
• @Kavi Rama Murthy I think yes, my intervals are disjoint.. Apr 28 '21 at 6:10
• The functions $$g_i(x):=\cos^2{\pi(x-a_i)\over2(b_i-a_i)}\qquad(i\geq1)$$ would do. – I think you have not properly described your problem, since you also talk about one function that should be constructed. Are you planning to concatenate the $g_i$ somehow? Apr 28 '21 at 7:45
• @Christian Blatter Yes, I will concatenate the $g_i$ with $f_i$, where $f_i$ is defined by $$f_i(x)=\begin{cases} 1, x<a_i\\ g_i(x), a_i≤x≤b_i\\ 0, x>b_i \end{cases}$$, then I will show that $f_i$ is continuously differentiable on $[0,1]$. Okay, I'll try the function that you give. Apr 28 '21 at 8:41

Hint. There are 4 conditions so try a polynomial with 4 c0-efficients, i.e. a cubic $$g(x)=\frac {x-b}{a-b}\cdot (\,A(x-a)^2+B(x-a)+1\,).$$