Smooth Logarithm at zero/one with special conditions

533 Views Asked by At

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$:

  1. $\varphi|_{(-\infty,1-\varepsilon] \cup [1+\varepsilon,\infty)} = V$
  2. $\varphi \geq V $
  3. $\varphi \in C^2(\Bbb R)$

How can I show the existence of such an $\varphi$?

4

There are 4 best solutions below

2
On BEST ANSWER

There are a lot of possible approximations.

In particular, the variant $$\varphi(x) = \begin{cases} \log(1+a(x-1+\varepsilon)^6+b(x-1+\varepsilon)^5+c(x-1+\varepsilon)^4),\text{ if }x\in(1-\varepsilon, 1 + \varepsilon)\\[4pt] V(x), \text{ otherwise} \end{cases}\tag1$$ $$\varphi'(x) = \begin{cases} \dfrac{6a(x-1+\varepsilon)^5+5b(x-1+\varepsilon)^4+4c(x-1+\varepsilon)^3}{1+a(x-1+\varepsilon)^6+b(x-1+\varepsilon)^5+c(x-1+\varepsilon)^4},\text{ if }x\in(1-\varepsilon, 1 + \varepsilon)\\[4pt] V'(x), \text{ otherwise} \end{cases}$$ $$\varphi''(x) = \begin{cases} \dfrac{30a(x-1+\varepsilon)^4+20b(x-1+\varepsilon)^3+12c(x-1+\varepsilon)^2}{1+a(x-1+\varepsilon)^6+b(x-1+\varepsilon)^5+c(x-1+\varepsilon)^4}-\\[4pt] \dfrac{(6a(x-1+\varepsilon)^5+5b(x-1+\varepsilon)^4+4c(x-1+\varepsilon)^3)^2}{(1+a(x-1+\varepsilon)^6+b(x-1+\varepsilon)^5+c(x-1+\varepsilon)^3)^4},\text{ if }x\in(1-\varepsilon, 1 + \varepsilon)\\[4pt] V''(x), \text{ otherwise} \end{cases}$$ provides conditions in the point $x=1-\varepsilon.$

Other conditions can be presented in the form of \begin{cases} \log(1+64a\varepsilon^6+32b\varepsilon^5+16c\varepsilon^4) = \log(1+\varepsilon)\\[4pt] \dfrac{192a\varepsilon^5+80b\varepsilon^4+32c\varepsilon^3}{1+64a\varepsilon^6+32b\varepsilon^5+8c\varepsilon^4} = \dfrac1{1+\varepsilon}\\[4pt] \dfrac{(480a\varepsilon^4+160b\varepsilon^3+48c\varepsilon^2))(1+64a\varepsilon^6+32b\varepsilon^5+16c\varepsilon^4)-(192a\varepsilon^5+80b\varepsilon^3+32c\varepsilon^2)^2}{(1+64a\varepsilon^6+32b\varepsilon^5+16c\varepsilon^4)^2}\\[4pt] \qquad =-\dfrac1{(1+\varepsilon)^2}, \end{cases} or \begin{cases} 64a\varepsilon^5+32b\varepsilon^4+16c\varepsilon^3 = 1\\[4pt] 192a\varepsilon^5+80b\varepsilon^4+32c\varepsilon^3 = 1\\[4pt] 480a\varepsilon^4+160b\varepsilon^3+48c\varepsilon^2= 0,\\ \end{cases} \begin{cases} a = \dfrac1{32\varepsilon^5}\\[4pt] b = -\dfrac3{16\varepsilon^4}\\[4pt] c = \dfrac5{16\varepsilon^3}. \tag2\end{cases} Therefore, the approximation has form $(1)$ with the coefficients $(2).$

For $\varepsilon = 0.1$ see also Wolfram Alpha.

Aproximation plot


Addition of 09.06.2018

To prove of the condition $2,$ let us consider the polynomial $$P_6(y) = ay^6+by^5+cy^4$$ with the coefficients $(2),$ i.e. $$P_6(y) = \dfrac1{32\varepsilon^5}y^6-\dfrac3{16\varepsilon^4}y^5 +\dfrac5{16\varepsilon^3}y^4 =\dfrac1{32\varepsilon^5}(y^6-6\varepsilon y^5+10\varepsilon^2y^4).$$ Then $$\varphi(x) = \begin{cases} \log(1+P_6(x-1+\varepsilon)),\text{ if }x\in(1-\varepsilon, 1 + \varepsilon)\\[4pt] V(x), \text{ otherwise}. \end{cases}$$ Easy to see that $$P_6(y) = \dfrac1{32\varepsilon^5}y^4\left((y-3\varepsilon)^2+\varepsilon^2\right)\ge0,$$ so condition $2$ is satisfied for $x\le1.$

On the other hand,

$$P_6(2\varepsilon) = \varepsilon,\quad \varphi(1+\varepsilon) = V(1+\varepsilon)$$ and $$\left(P_6(y) - (y+1-\varepsilon)\right)' = \dfrac1{16\varepsilon^5}\left(3y^5-15\varepsilon y^4 +20\varepsilon^2 y^3-16\varepsilon^5\right) = \dfrac1{16\varepsilon^5}\left(y-2\varepsilon\right)^3 (3y^2+3\varepsilon y+2\varepsilon^2)\le0\text{ if } y\in(\varepsilon, 2\varepsilon].$$ These mean that $$P_6(y)\ge y+1-\varepsilon, \text{ if } y\in(\varepsilon, 2\varepsilon],$$ so condition $2$ is satisfied for $x\in(1,1+\varepsilon],$

Proved.

5
On

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.

2
On

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).$

3
On

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)}$ :
enter image description here
In this picture eps $\epsilon\,$ and viewport are defined as:

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