# Smooth flattening of a function near zero with control over derivatives

I have a smooth function, say $$f: \mathbb R \rightarrow \mathbb R$$, such that $$f' \rightarrow 1$$ as $$x \rightarrow \infty$$ but there is a neighbourhood of zero in which $$f' < 0$$, possibly with a singularity (e.g. $$-\sqrt{x}$$). Is there a way to "flatten" the function in a neighbourhood of zero but keep its behaviour at infinity?

For instance, the function in my head looks like:

$$F(x) = \begin{cases} 1, &|x| < R_1 \\ g, &R_1 \leq |x| < R_2 \\ f, &|x| \geq R_2. \end{cases}$$

So $$F'$$ is zero where $$f' < 0$$, has the behaviour of $$f'$$ at infinity, and should have behaviour "close to" the behaviour of $$f'$$ in between. In particular I would like $$\inf F'$$ close to $$0$$ if possible (since $$f' \rightarrow 1$$ and $$F' = 0$$ in a neighbourhood of zero) or at least $$\inf F' = -\epsilon$$ for some arbitrarily small $$\epsilon$$.

In my mind $$g$$ is some sort of slow interpolation (e.g. $$t/C \times f + (1 - t/C)$$ for some large constant $$C$$) between $$1$$ and $$f$$. My question is: does there exist a smooth function $$F$$ which has derivatives (possibly uniformly) controlled by $$f$$? I'm not sure how to make this intuition into an actual smooth function and estimate the derivative near the endpoints/whether this intuition is actually correct. (I also feel this might be a known result/common construction so perhaps someone knows.)

EDIT: I think I gave the wrong impression with the idea of "bad". I have edited the question to be a bit more precise, sorry.

• Do you want to only modify it at all near zero, or is a small change away from zero acceptable? If the latter, look up the term "mollifier".
– Ian
Commented Jun 30, 2022 at 13:57
• Thanks for the comment - I thought about your comment and realised the question wasn't as specific as I had in mind. The specific applicaton I have in mind is that $f' \rightarrow 1$ but $f' < 0$ in a neighbourhood of zero. Ideally I would like $\inf F' = 0$ or that there is some acceptable loss $\inf F' = -\epsilon$ for some $\epsilon > 0$ arbitrarily small. I was trying to give a more general application but I think it wasn't well explained. I'll edit the question accordingly. Commented Jun 30, 2022 at 14:09
• A mollifier will probably do more or less what you want.
– Ian
Commented Jun 30, 2022 at 18:04
• So the idea is to define $F$ in the way I have it and then mollify? And this should smooth out the endpoints? I will give this a try. Commented Jun 30, 2022 at 21:59
• You can probably just mollify what you started with immediately, unless you specifically care about it being flat near 0.
– Ian
Commented Jun 30, 2022 at 22:37

You can use a partition of unity to make such a function $$F$$. More precisely, let $$\{\psi_1,\psi_2\}$$ be a smooth partition of unity subordinate to the cover $$U_1=(-2,2),U_2=\mathbb R\smallsetminus[-1,1]$$ of $$\mathbb R$$. The important point is that $$\psi_1,\psi_2$$ take values in $$[0,1]$$, $$\psi_1(x)+\psi_2(x)=1$$ for each $$x\in \mathbb R$$, and $$\mathrm{supp} (\psi_j)\subset U_j$$ for each $$j = 1,2$$. In particular, $$\psi_2(x) = 1$$ when $$|x|>2$$ and $$\psi_2(x) = 0$$ when $$|x|<1$$.
Setting $$F(x) = f(x)\psi_2(x)$$ gives the desired function since $$F'(x) = 0$$ for $$|x|<1/2$$ and $$F'(x) = f'(x)$$ for $$|x|>3$$. The graph of $$F(x)$$ agrees with the graph of $$f(x)$$ for $$|x|>2$$ and it smoothly flattens out and equals $$0$$ in a neighborhood of $$0$$.
A similar definition $$F(x) = f(x)\psi_2(x) + g(x)\psi_1(x)$$ for any function $$g(x)$$ gives a function which agrees with $$f(x)$$ for all large values of $$x$$ and that agrees with $$g(x)$$ for all small values of $$x$$.