I have this equation:
integrate(exp(-x**2), (x, c, -c))=1/2
which should look like this:
How can I find a solution for c
, for example using a library such as sympy?
I have this equation:
integrate(exp(-x**2), (x, c, -c))=1/2
which should look like this:
How can I find a solution for c
, for example using a library such as sympy?
With Sympy you can do the following:
from sympy import *
from sympy.abc import x, c
sol = solve(Eq(integrate(exp(-x**2), (x,c,-c)), S(1)/2))
print("symbolic solution:", sol)
print("numeric solution:", [s.evalf() for s in sol])
Output:
symbolic solution: [erfinv(-1/(2*sqrt(pi)))]
numeric solution: [-0.255449286541000]