Smooth Logarithm at zero/one with special conditions As part of a bigger problem it turned out that the function
$$V: \Bbb R \rightarrow [0,\infty ), \,  V(x) := \begin{cases} 0 &:  x \leq 1 \\ \log(x) &: x > 1 \end{cases}$$
would help me alot if it was smooth or rather $C^2$. There would be a way out of this by taking/searching a new function $\varphi: \Bbb{R} \rightarrow [0,\infty) $ instead of $V$ with the following conditions for a $\varepsilon > 0$:


*

*$\varphi|_{(-\infty,1-\varepsilon] \cup [1+\varepsilon,\infty)} = V$

*$\varphi \geq V $

*$\varphi \in C^2(\Bbb R)$


How can I show the existence of such an $\varphi$?
 A: You can try a connection polynomial with the following constraints:


*

*$p(1-\epsilon)=p'(1-\epsilon)=p''(1-\epsilon)=0$,

*$p(1+\epsilon)=\log(1+\epsilon),p'(1+\epsilon)=\dfrac1{1+\epsilon},p''(1+\epsilon)=-\dfrac1{(1+\epsilon)^2}$,
defined over $[1-\epsilon,1+\epsilon]$, and $V$ elsewhere.
As there are six constraints, you will need a quintic polynomial. The equations to determine the coefficients are linear.
There is no a priori guarantee that the polynomial will remain positive in the required range, but I wouldn't be surprised that this occurs naturally.
A: This will describe a function $\varphi$ whose domain is $[0,\infty),$ for which $\varphi(x)$ is equal to $0$ if $0 \le x \le 1-\varepsilon,$ equal to $\log x$ it $1-\varepsilon\le x,$ and is in $C^\infty,$ i.e. it has continuous derivatives of all orders at every point.
However, I am not yet entirely happy with it, since I would like to see it as convex, i.e. concave upward, on the interval whose endpoints are $1\pm\varepsilon.$ And I suspect that can be done without a very large amount of additional work.
Start with this function: 
$g_1(x) = \begin{cases} 0 & \text{for } x\le 0, \\ e^{-1/x} & \text{for } x>0. \end{cases}$ This is obviously $C^\infty$ on $\mathbb R\smallsetminus \{0\}.$ That it has continuous derivatives of all orders at $0$ takes some work to show. I seem to recall a proof by induction on the order of the derivative, after a substitution, but I don't remember the details.
Let $g_2(x) = g_1(x)g_1(a-x)$ for some $a>0.$ This is a $C^\infty$ function that is positive for $0<x<a$ and $0$ for $x$ elsewhere.
Then let $\displaystyle g_3(x) = \begin{cases} \displaystyle \left. \int_0^x g_2(u)\,du \right/\!\!\int_0^a g_2(u)\,du & \text{for } x\ge 0, \\[6pt] 0 & \text{for } x<0. \end{cases}$  This is a $C^\infty$ function that is equal to $0$ for $x\le0,$ equal to $1$ for $x\ge a,$ and between $0$ and $1$ for $0<x<a.$
For some $b>2a,$ let $g_4(x) = g_3(x) g_3(b-x).$ Then $g_4(x)$ is equal to $0$ for $x\le0$ or $x\ge b,$ equal to $1$ for $a\le x\le b-a,$ and between $0$ and $1$ for $0<x<a$ or $b-a<x<b.$
Let $g_5(x) = g_4(x-(1-\varepsilon)),$ with $a=\varepsilon/2$ and $b = 2\varepsilon.$ Then $g_5$ is a $C^\infty$ function equal to $0$ for $x\le0$ or $x\ge2\varepsilon,$ equal to $1$ for $\varepsilon/2\le x\le 3\varepsilon/2\le 2\varepsilon,$ and between $0$ and $1$ in the two intervals between.
Let $g_6(x) = 1 - g_5(x).$
Next, let $\varphi(x) = V(x) g_6(x).$
A: Try a convolution with a function of small width and great height
(: Richard P. Feynman in Space-Time Approach to Quantum Electrodynamics ).
Name this function $\delta(x)$ (not quite by coincidence). The simplest one is this:
$$
\delta(x) = \begin{cases}
0 & \mbox{for} & x \le \epsilon \\
1/(2\epsilon) & \mbox{for} & -\epsilon \le x \le +\epsilon \\
0 & \mbox{for} & x \ge +\epsilon
\end{cases}
$$
The geometry of $\,\delta(x)\,$ is a rectangle with height $1/(2\epsilon)$ and width $2\epsilon$ ,
resulting in an area $1$, thus establishing that the function $\,\delta(x)\,$ is normed.
Now define:
$$ \overline{V}(x) = 
\int_{-\infty}^{+\infty} \delta(x-t)\,V(t)\,dt
= \frac{1}{2\epsilon} \int_{x-\epsilon}^{x+\epsilon} V(t)\,dt
$$
With $\,\int \ln(t)\,dt = t\ln(t)-t$ . Then we have
for $\,x \le 1-\epsilon$ :
$$
\overline{V}(x) = \frac{1}{2\epsilon}\int_{x-\epsilon}^{x+\epsilon} 0 \,dt = 0
$$
for $\,1-\epsilon \le x \le 1+\epsilon$ :
$$
\overline{V}(x) =
\frac{1}{2\epsilon}\int_{x-\epsilon}^1 0 \,dt + \frac{1}{2\epsilon}\int_1^{x+\epsilon}\left[t\ln(t)-t\right]dt =
\left[(x+\epsilon)\ln(x+\epsilon)-(x+\epsilon)+1\right]/(2\epsilon)
$$
for $\,x \ge 1+\epsilon$ :
$$
\overline{V}(x) = \frac{1}{2\epsilon}\int_{x-\epsilon}^{x+\epsilon}\left[t\ln(t)-t\right]dt =
\left[(x+\epsilon)\ln(x+\epsilon)-(x-\epsilon)\ln(x-\epsilon)\right]/(2\epsilon)-1
$$
Sketch of the original $\,V(x)\,$ and its smoothed approximation $\,\color{red}{\overline{V}(x)}$ :

In this picture eps $\epsilon\,$ and viewport are defined as:

  eps : double = 1;
  xmin := -2; xmax := 5;
  ymin := -0.1; ymax := 2.9;

