I am trying to integrate e^(-x) from 0 to 1 using sympy but I am getting the following error:
ValueError: Invalid limits given: ((exp(-x), 0, 1),)
Here is my code:
from sympy import *
x = Symbol('x')
exact_value = integrate(exp(-x), (exp(-x), 0, 1))
Following the documentation the only problem is the tuple you establish as a limit (exp(-x), 0, 1), since it has to be (x, 0, 1) following the previously mentioned structure.
So the edited code would be:
from sympy import *
x = Symbol('x')
exact_value = integrate(exp(-x), (x, 0, 1))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With