Function in sympy

88 views Asked by At

I get the error 'Add' object is not callable' when trying to display an integral with limits. However, works perfectly fine without the use of limits or when differentiating. "Equation" is a randomly generated equation

from random import *
from sympy import * 
from fractions import *

def IntegrateBetweenLimitsQuestion(Equation):
    x, y = symbols('x,y')
    a = 0
    b = 0
    while b == a:#so the limits cannot be the same number
        b = randint(-5,5) #upperlimit
        a = randint(-5,5) #lowerlimit
    LimitQuestion = Integral(Equation(x, a, b))
    return(LimitQuestion)
1

There are 1 answers

0
smichr On

Try slip a comma after Equation: Integral(Equation, (x, a, b))