A customer on Twitter recently asked why Maple gives the following result:



The issue here is that the t in f(t) is the same as the integration variable. 140 characters is not a lot to work with for a reply, so here is a longer explanation.


First, note that the process of integration treats the integration variable differently than the other variables, so that replacing another variable by the integration variable has a different effect depending on whether the replacement is done before or after the integration is performed. Consider this simple example:


a := int(t, t)



eval(a, t = x)



a := int(x, t)




eval(a, t = x)




In other words, integration does not commute with substitution. This is a fundamental property of integration and in fact, Maple's eval has special rules to take this into account when you ask it to replace the integration variable.  For example, if you evaluate the inert form of the integral at x = y, the substitution is performed explicitly:



eval(Int(x-t, t = 0 .. x), x = y)

Int(y-t, t = 0 .. y)


value(Int(y-t, t = 0 .. y))




However, if you try to evaluate at x = t, the evaluation is delayed until after the integral is evaluated:


eval(Int(x-t, t = 0 .. x), x = t)

eval(Int(x-t, t = 0 .. x), {x = t})



value(eval(Int(x-t, t = 0 .. x), {x = t}))




The eval command knows it shouldn't substitute into an integral when the substitution involves the variable of integration.


However, in the user's example, asking Maple for f(t) is equivalent to substitution directly before the integration is performed, like this:


subs(x = t, Int(x-t, t = 0 .. x))

Int(0, t = 0 .. t)


which of course gives:






Another way to have the two t variables be considered distinct is to explicitly make the integration variable a dummy by declaring it local:


f := proc (x) local t; int(x-t, t = 0 .. x) end proc

Now the ts are treated differently:






Austin Roche

Senior Math Developer



Download integration_variables.mw

Please Wait...