Number of zeros of $f(x)= \frac{1}{2} E\left[ \tanh \left( \frac{x+Z}{2} \right) \right]-\tanh(x)+\frac{x}{2}$ where $Z$ is standard normal

Solution 1:

Not a complete proof, but rather a sketch. First, observe that as $x\to +\infty$, than $\tanh (x) \to 1$, so $f(x)$ asymptotically asymptotically equivalent to $\frac{1}{2} E [1] - 1 + \frac{x}{2} = \frac{x-1}{2}$, so for some large enough positive value of $x$ one has $f(x) > 0$. After that, let's look at the graph of the function and notice that $f'(0)$ must be negative, which is not hard to prove: As $$ \frac{1}{2} E\left[ \tanh \left( \frac{x+Z}{2} \right) \right] = \frac{1}{2} \int_\mathbb{R} \tanh \left( \frac{x+z}{2} \right) \frac{1}{\sqrt{2\pi}} e^{-z^2/2}dz $$ So $$ f'(x) = \frac{1}{2} \int_\mathbb{R} \frac{\partial}{\partial x}\left[ \tanh \left( \frac{x+z}{2} \right)\right] \frac{1}{\sqrt{2\pi}} e^{-z^2/2}dz + \frac{d}{dx} \left[-\tanh (x) + \frac{x}{2}\right] = \\ = \frac{1}{4} \int_\mathbb{R} \frac{1}{\cosh^2 \left( \frac{x+z}{2} \right)} \frac{1}{\sqrt{2\pi}} e^{-z^2/2}dz - \frac{1}{\cosh^2 (x)} + \frac{1}{2} \\ f'(0) = \frac{1}{4} \int_\mathbb{R} \frac{1}{\cosh^2 \left( \frac{z}{2} \right)} \frac{1}{\sqrt{2\pi}} e^{-z^2/2}dz - 1 + \frac{1}{2} \leq \frac{1}{4} \int_\mathbb{R} \frac{1}{\sqrt{2\pi}} e^{-z^2/2}dz - \frac{1}{2} = \frac{1}{4} - \frac{1}{2} = -\frac{1}{4} $$ where the inequality is obtained from $\frac{1}{\cosh^2 \left( \frac{z}{2} \right)} \leq 1 \;\forall z \in \mathbb{R}$. So, it means that $f(x)$ is decreasing in some neighborhood of zero.

So, there exists some $x^+ > 0$ s.t. $f(x^*) > 0$ and some $x^- > 0$ s.t. $f(x^-) < f(0) = 0$. So, by intermediate value theorem (it's also an exercise to check the continuity of $f(x)$) there exists some $x^* \in [x^-, x^+]$ s.t. $f(x^*) = 0$. As $f(x)$ is an odd function, it means that $-x^*$ is also a root.

EDIT: as $\frac{1}{2} - \frac{1}{\cosh^2(x)} \leq f'(x) \leq \frac{3}{4} - \frac{1}{\cosh^2(x)}$ and $f'(0) = 0$, I suppose that with similar methods one can prove that $f$ also has a stationary point somewhere on positive axis, which can help in proving that there are no other roots.

Solution 2:

Claim. The real function $g(x)=x-2\tanh x+\Bbb E\tanh((x+Z)/2)$ has exactly three real zeros.

Proof: Since $\Bbb E\tanh((-x+Z)/2)=\Bbb E\tanh((-x-Z)/2)=-\Bbb E\tanh((x+Z)/2)$, we know that $g$ is odd. As $g(0)=0$, it suffices to show that $g$ has exactly one positive root.

Computing the first derivative, we have $g'(x)>1-2\operatorname{sech}^2x$ since $$\frac d{dx}\Bbb E\tanh\frac{x+Z}2=\frac12\Bbb E\operatorname{sech}^2\frac{x+Z}2>0.$$ Therefore, $g$ is strictly increasing for all $x>\operatorname{arccosh}\sqrt2$, so it suffices to show that $g'$ is strictly increasing on $(0,\operatorname{arccosh}\sqrt2)$; that is, a convexity argument on $g$.

Computing the second derivative, we obtain $g''(x)=4\tanh x\cdot\operatorname{sech}^2x-h(x)$ where \begin{align}h(x)&=-\frac d{dx}\Bbb E\operatorname{sech}^2\frac{x+Z}2\\&=\Bbb E\left[\tanh\frac{x+Z}2\cdot\operatorname{sech}^2\frac{x+Z}2\right]\\&=\int_{-\infty}^\infty\frac{e^{-(z-x)^2/2}\sinh(z/2)}{\cosh^3(z/2)}\,dz\tag1\\&=2e^{-x^2/2}\int_{-\infty}^\infty\frac{e^{-2z^2+2xz}\sinh z}{\cosh^3z}\,dz\\&=2e^{-x^2/2}\int_1^\infty\frac{e^{-2\operatorname{arccosh}^2t+2x\operatorname{arccosh}t}-e^{-2\operatorname{arccosh}^2t-2x\operatorname{arccosh}t}}{t^3}\,dt\tag2\\&=4e^{-x^2/2}\int_0^\infty\frac{e^{-2\operatorname{arccosh}^2(t+1)}\sinh(2x\operatorname{arccosh}(t+1))}{(t+1)^3}\,dt\\&<4e^{-x^2/2}\int_0^\infty\frac{\sinh(2x\operatorname{arccosh}(t+1))}{(t+1)^7}\,dt\tag3\end{align} where

  • in $(1)$, we use the law of the unconscious statistician;

  • in $(2)$, we split the integral into $(-\infty,0)\cup(0,\infty)$ and substitute $t=\cosh z$, and

  • in $(3)$, we use the inequality $\cosh x\le e^{x^2/2}$ for all real $x$ which rearranges to $\exp(-2\operatorname{arccosh}^2t)<1/t^4$ for all $t>1$.

Credits to @KStarGamer for help in the evaluation of this integral! We first exploit the Laplace transform integral identity $$\int_0^\infty\frac{\sinh(2x\operatorname{arccosh}(t+1))}{(t+1)^7}\,dt=\int_0^\infty\mathcal L\left[\sinh(2x\operatorname{arccosh}(t+1))\right](s)\cdot\mathcal L^{-1}[(t+1)^{-7}](s)\,ds.$$ Since $\mathcal L^{-1}[(t+1)^{-7}](s)=s^6e^{-s}/6!$ and \begin{align}\int_0^\infty e^{-st}\sinh(2x\operatorname{arccosh}(t+1))\,dt&=e^s\int_1^\infty e^{-st}\sinh(2x\operatorname{arccosh}t)\,dt\\&=e^s\int_0^\infty\left(e^{-s\cosh u}\sinh u\right)\sinh2xu\,du\\&=e^s\int_0^\infty\frac{2x}se^{-s\cosh u}\cosh2xu\,du\\&=\frac{2x}se^sK_{2x}(s)\end{align} through integration by parts, we are left with $$\int_0^\infty\frac{\sinh(2x\operatorname{arccosh}(t+1))}{(t+1)^7}\,dt=\frac x{360}\int_0^\infty s^5K_{2x}(s)\,ds=\frac{2x}{45}\Gamma(3-x)\Gamma(3+x)$$ using Ramanujan's master theorem and that $K_{2x}$ is a linear combination of modified Bessel functions of the first kind. The reflection formula finally yields $$h(x)<\frac{8\pi x^2(x^4-5x^2+4)}{45e^{x^2/2}\sin\pi x},$$ so a sufficient condition for $g''(x)>0$ is $$\frac{\sinh x}{\cosh^3x}>\frac{2\pi x^2(x^4-5x^2+4)}{45e^{x^2/2}\sin\pi x}\iff p(x)=\frac{2\pi x(x^4-5x^2+4)e^{x^2}}{45\sin\pi x}<1$$ using $\cosh x\le e^{x^2/2}$ and $\sinh x\ge x$. It suffices to show that $(\log p(x))'>0$ since $p$ is positive and $p(\operatorname{arccosh}\sqrt2)<1$. This is equivalent to $$\frac{2x^6-5x^4-7x^2+4}{x(x^4-5x^2+4)}>\pi\cot\pi x$$ which can be written as $$2x+\frac1{x-2}+\frac1{x-1}+\frac1x+\frac1{x+1}+\frac1{x+2}>\sum_{n\in\Bbb Z}\frac1{x-n}$$ using the Mittag-Leffler expansion of $\cot$, which is true for all $0<x<3$ (more than what we need) since $$\sum_{n=-\infty}^{-3}\frac1{x-n}+\sum_{n=3}^\infty\frac1{x-n}=\sum_{n=3}^\infty\frac{2x}{x^2-n^2}<0.\tag*{$\square$}$$