I'm trying to integrate this function in Python:
I = integral(integral( g(y) * ln[f(x,y)/g(y)] dx) dy) where g(y) = integral(f(x,y)dx) from 0 to 1
eq = lambda x: x #NOTE: want to be able to be able to input any equation
f = lambda x,y: math.exp(-1.0*(eq(x)-y)**2)
g = lambda y: integrate.quad(f, 0, 1, args=(1,))[0]
combined = lambda x, y: g(y) * math.log(f(x,y) / g(y))
combInt = lambda y: integrate.quad(combined, 0,1, args=(1,))[0]
I = integrate.quad(combInt, -np.inf, np.inf)[0]
However, when I ran my code, I found that "g" was constant, and "I" was negative. Am I using the quad function incorrectly? How can g be constant?