Equation involving an error and Gaussian functions

95 Views Asked by At

I am looking to solve the following expression for $x$:

$$\int_{0}^x e^{-t^2}dt=2xe^{-x^2}.$$

Multiplication of both sides by $2/\sqrt{\pi}$ yields error function on the LHS, while the RHS contains Gaussian function multiplied by $x$.

I have no idea what to do with this. I would love a closed-form solution or $x$ in terms of functions that are easily computable by MATLAB (like error or Bessel functions), but would be satisfied with a numerical method that is more efficient than searching for a zero of $2xe^{-x^2}-\int_{0}^x e^{-t^2}dt$ (using, say, fzero in MATLAB Optimization Toolbox). Any help?


Looking at the plots, the solution seems to be $x=1$.

If I differentiate both sides, I obtain $e^{-x^2}=2e^{-x^2}+2xe^{-x^2}$, which yields $x=1$. However, is that correct approach? I might be missing something very simple. Can anyone elucidate?

3

There are 3 best solutions below

2
On BEST ANSWER

If you can rapidly compute the special function $\mathrm{Erf}(x)$, then you can rapidly compute the zeros of this function by using Newton's method. If you're trying to find the first-order zeros of a differentiable function $F(x)$, recall that the iteration is

$$ x_1 = x_0 - F(x_0) / F'(x_0)$$

In our case, $F(x) = \tfrac{1}{2} \sqrt{\pi} \mathrm{Erf}(x) - 2x e^{-x^2}$ (e.g. with Matlab), and its derivative is simply $F'(x) = -e^{-x^2} + 4x^2 e^{-x^2}$. Given an initial guess $x_0$, we can plug this into Matlab as

x = x - (sqrt(pi)/2 * erf(x) - 2 * x * exp(-x^2))/(-exp(-x^2) + 4*x^2 * exp(-x^2));

Repeatedly enter this line until convergence. Depending on whether $x_0 < 0.5$ or $x_0 > 0.5$ (not that you cannot use $x_0 = 0.5$), this converges to $0$ and $0.9899...$, and furthermore, it does so in only a few iterations.

0
On

Since there is a symmetry in the function, we can focus on $x$ greater than or equal to $0$, which yields $$e^{x^2}\text{erf}(x)\,x^{-1} = \frac{16}{\pi}$$ $$\sum_{n=0}^{\infty} \frac{x^{2n}}{\Gamma(n+\frac{3}{2})} = \frac{2}{\pi}$$ $$\sum_{n=1}^{\infty}\frac{(2x^2)^n}{(2n+1)!!}= \frac{2+\sqrt{\pi}}{\sqrt{\pi}}$$ These haven't led me anywhere though

0
On

This is not an answer but it is too long for a comment.

As you noticed, the solution is close to $x=1$. So, if you consider the function $$f(x)=\frac{1}{2} \sqrt{\pi } \,\text{erf}(x)-2\, xe^{-x^2} $$ and build the simplest $[1,1]$ Pade approximant at $x=1$, you will get $$f(x)\approx \frac{\frac{\left(22-e \sqrt{\pi } \text{erf}(1)\right) (x-1)}{6 e}+\frac{e \sqrt{\pi } \text{erf}(1)-4}{2 e}}{\frac{1-x}{3}+1}=\frac{1}{2} \sqrt{\pi } \text{erf}(1)+\frac{17-11 x}{e (x-4)}$$ the root of which being $$x=\frac{2 \left(2 e \sqrt{\pi }\, \text{erf}(1)-17\right)}{e \sqrt{\pi }\, \text{erf}(1)-22}\approx 0.98994022$$ Using the $[1,2]$ Pade approximant would give $$x=\frac{2 \left(7 e \sqrt{\pi }\,\text{erf}(1)+e^2 \pi \,\text{erf}(1)^2-98\right)}{3 \left(-4 e \sqrt{\pi } \,\text{erf}(1)+e^2 \pi \, \text{erf}(1)^2-36\right)}\approx 0.98993909$$