Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Lazy evaluation of symbolic integration

I am confused by the output for the following code

var('x,u,w')

F(x)=integral((min_symbolic(u,0)-1/2)*exp(x*u),u,-1,1)
G(x)=F(x)
H(w)=F(w)

print("F:",F)
print("G:",G)
print("H:",H)

The output I am getting is

F: x |--> 1/2*integrate((2*min(0, u) - 1)*e^(u*x), u, -1, 1)
G: x |--> 1/2*integrate((2*min(0, u) - 1)*e^(u*x), u, -1, 1)
H: w |--> 1/2*(3*w*e^(-w) + 2*e^(-w) - 1)/w^2 - 1/2*(w*e^w + 1)/w^2

The output for H is what I am actually after, but I am wondering why it is different from the output for F and G, whether this is the intended behaviour and what is the official way to influence the evaluation/non-evaluation of such a symbolic integral expression.

Also this behaviour must have changed at some point in the recent past, breaking some of my existing code as a result.