Finding the maximum of an integral

functionsintegrationoptimization

I am wondering if it is possible to find the maximum ($x_{\text{max}}$, $v_{\text{max}}$), also an approximate one, of this integral as function of $x$: $$v(x)=\int_0^{x+x_0} \frac{\exp \left[-\frac{(x-\tau )^2}{2}\right]}{\sqrt{\tau }} \, d\tau$$

Integrate[
 1/Sqrt[\[Tau]] Exp[-((x - \[Tau])^2/2)], {\[Tau], 0, x + x0}]

where $x_0>0$ and $x > -x_0$. For example, for $x_0=4$, we have varying $x$:

ListPlot[Table[{x, 
   NIntegrate[
    1/Sqrt[\[Tau]] Exp[-((x - \[Tau])^2/2)], {\[Tau], 0, x + x0} /. 
     x0 -> 4]}, {x, -4, 15, 0.1}], Frame -> True, 
 FrameLabel -> {"x", "v(x)"}]

enter image description here

From one side, I tried to find where $dv(x)/dx=0$, using the Leibniz integral rule, for which $$\frac{dv}{dx}=\frac{e^{-\frac{x_0^2}{2}}}{\sqrt{x+x_0}}+\int_0^{x+x_0} \frac{e^{-\frac{1}{2} (x-\tau )^2} (\tau -x)}{\sqrt{\tau }} \, d\tau$$

1/(E^(x0^2/2)*Sqrt[x + x0]) + 
 Integrate[(\[Tau] - x)/(E^((1/2)*(x - \[Tau])^2)*
     Sqrt[\[Tau]]), {\[Tau], 0, x + x0}]

but is seems that things get more complicated. On the other side, having checked that the maximum is near $t=0$, I tried to sobstitute to the integrand in $v(x)$ its Taylor expansion around $t=0$. In this case, the integral can be performed but the result is again much complicated depending on the number of terms kept from Taylor expansion.

If $x_0\rightarrow \infty$, the integral from $0$ to $\infty$ of the Taylor expansion of $$ \frac{\exp \left[-\frac{(x-\tau )^2}{2}\right]}{\sqrt{\tau }}$$ around $x=0$ truncated to the third order term is

$$v(x)\approx -\frac{1}{6} \left(x^2-4\right) \left(2^{3/4} x \, \Gamma \left(\frac{7}{4}\right)+3 \sqrt[4]{2} \, \Gamma \left(\frac{5}{4}\right)\right)$$ The last function has a maximum of $v_\text{maxapprox}=2.52714$ at $x_\text{maxapprx}=0.651579$ with $$x_\text{maxapprox}=\frac{\frac{\sqrt{\sqrt{2} \Gamma \left(\frac{5}{4}\right)^2+\frac{8}{3} \sqrt{2} \Gamma \left(\frac{7}{4}\right)^2}}{2^{3/4}}-\frac{\Gamma \left(\frac{5}{4}\right)}{\sqrt{2}}}{\Gamma \left(\frac{7}{4}\right)}$$ (Numerically, for $x_0 \rightarrow \infty$, the result should be $x_\text{max}=0.7649$ and $v_\text{max}=2.5596$.)

Any help or suggestion, also about the $x_0 \rightarrow \infty$ case, is really welcome.

Best Answer

Using the same approach

Expanded around $x=0$

$$\frac{1}{\sqrt{\tau }}\,\exp \Big[-\frac 12 (x-\tau )^2\Big] =\frac{1}{\sqrt{t}}\,\,e^{-\frac{t^2}{2}}\sum_{n=0}^\infty \frac {a_n}{n!}\,x^n$$ So,as you did, integrating with respect to $\tau$ from $0$ to $\infty$ to face $$v(x)=\sum_{n=0}^\infty b_n\, x^n$$ where $$b_n=\frac {2^{\frac{2n-3}{4} } } {n! }\,\,\Gamma \left(\frac{2n+1}{4} \right)\,\,\left(\sin \left(\frac{\pi n}{2}\right)+\cos \left(\frac{\pi n}{2}\right)\right)$$ is completely defined (as well as its derivatives.

This would be a fast convergent series since $$\left|\frac{b_{n+1}}{b_n}\right|\sim \frac 1{\sqrt n} \left(1-\frac{1}{n}\right)$$

Now, looking for the zero of $$v'_{(p)}(x)=\sum_{n=1}^p n\, b_n\, x^{n-1}$$

$$\left( \begin{array}{cc} p & x_{p} \\ 5 & 0.7957738274686 \\ 6 & 0.7693337827539 \\ 7 & 0.7627696942087 \\ 8 & 0.7645974040264 \\ 9 & 0.7651034151271 \\ 10 & 0.7649737593594 \\ 20 & 0.7649508673876 \\ \end{array} \right)$$

You should notice that, in principle, we do not need to solve the equation since, using power series reversion, we know its formal expression.

Related Question