Note that by default in SymPy the base of the natural logarithm is E (capital E). That is, exp(x) is the same as E**x.
Note that by default in SymPy the base of the natural logarithm is E (capital E). That is, exp(x) is the same as E**x.
You should be using exp to represent exponents as opposed to the letter e.
Example, it should be like this:
from sympy import *
x = symbols('x')
print diff(exp(4*x))
This outputs:
4*exp(4*x)
As desired.
Regarding the problem with your code - Without much more else to go on - it seems like you've set e to be a variable somewhere.
Videos
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))
I'm pretty sure you want to integrate over x, not e^-x, so that would be:
exact_value = integrate(exp(-x), (x, 0, 1))
The results is:
1 - exp(-1)