For example, I have the following integral expression:

g[x, y] = Integrate[f[x, y],x]

How can I modify the above expression to achieve the following definite integral:

h[x,y,a_,b_] = Integrate[f[x, y],{x,a,b}]

i.e. I am looking for a method to convert indefinite to definite integral.


2 Answers 2


Let us introduce the following rule:


rule=Integrate[k_[x, y], x] -> Integrate[k[x, y], {x, a, b}];


Integrate[f[x, y], x] /. rule


enter image description here

Have fun!


You did not show a use case of why what you are doing is needed.

An option is to take advantage of Mathematica function name overloading.

h[f_, x_, y_] := Integrate[f[x, y], x]
h[f_, x_, y_, a_, b_] := Integrate[f[x, y], {x, a, b}]

And now you can do

Mathematica graphics

I do not see a reason to make things more complicated, unless the above does not do what you wanted.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.