# solve equation of erf

I used @ndomes' method of using numeric functions, but I still wind up unable to prove that erf... == erf...:

sage: var('x sigma mu')
sage: assume(sigma > 0)
sage: eq3 = (-erf((sqrt(2)*mu - sqrt(2)*x)/(2*sigma)) == -erf((sqrt(2)*(mu - x))/(2*sigma)))
sage: show(eq3)
sage: show(bool(eq3))


$\newcommand{\Bold}[1]{\mathbf{#1}}-\text{erf}\left(\frac{\sqrt{2} \mu - \sqrt{2} x}{2 \, \sigma}\right) = -\text{erf}\left(\frac{\sqrt{2} {\left(\mu - x\right)}}{2 \, \sigma}\right)$

$\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{False}$

This slightly simpler equation works correctly however:

sage: eq4 = (-erf((sqrt(2)*mu - sqrt(2)*x)/(sigma)) == -erf((sqrt(2)*(mu - x))/(sigma)))
sage: show(eq4)
sage: show(bool(eq4))


$-\text{erf}\left(\frac{\sqrt{2} \mu - \sqrt{2} x}{\sigma}\right) = -\text{erf}\left(\frac{\sqrt{2} {\left(\mu - x\right)}}{\sigma}\right)$

$\mathrm{True}$

What's going on here?? Is it related to being unable to reduce inverse_erf(erf()) below?

sage: solve(erf(x) == erf(y), x)[0].simplify_full()
x == inverse_erf(erf(y))

edit retag close merge delete

Sort by ยป oldest newest most voted

I use a python function returning a numerical solution:

f(t) = (1/sqrt(2*pi))*e^(-t^2/2)

F(x) = integral(f,t,-oo,x)

def F_inverse(p):
return find_root(F(x) == p, -10, 10)


To let Sage prove that both solutions are the same use bool

eqn = (erf(-(sqrt(2)*mu-sqrt(2)*t)/(2*sigma)) == erf(-(sqrt(2)*mu)/(2*sigma)+(sqrt(2)*t)/(2*sigma)))
eqn; bool(eqn)

more

Thanks, that helped, some. Could you take a look at my updated question? I'm still having issues.

( 2013-12-28 06:00:43 -0600 )edit

See Trac 11349 - this is probably only in Maxima. You may find this ask.sagemath question helpful, though not symbolically - it has some mpmath hints.

more

I don't know enough about how this works; will fixing the sage enhancement allow this expression to be simplified, considering that Maxima won't simplify it?

( 2013-12-28 21:44:17 -0600 )edit