Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

definite_integral of max function

The following code returns 1/2, however it can be easily verified that $$\int_0^1 \max(x,\ 1-x)\,{\rm d}x = \frac34.$$ What's wrong?

from sage.symbolic.integration.integral import definite_integral
var('x')
definite_integral(max(x,1-x),x,0,1)