Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

If I have a multivariable integration like

NIntegrate[x^2 + y^2, {x, 1, 5}, {y, 6, 10}]

But I need to plot its result in terms of x . Then how to do it ?

share|improve this question
The result of the integration is a constant independent of x,y ? –  b.gatessucks Aug 26 '12 at 17:25
What you have there is a constant... –  Guess who it is. Aug 26 '12 at 17:25
Do you mean something like With[{int = Integrate[x^2 + y^2, {y, 6, 10}, {x, 0, t}]}, Plot[int, {t, 0, 10}]]? –  The Toad Aug 26 '12 at 17:27
Exactly !!! Thanks man! Trying that @R.M –  Mush Aug 26 '12 at 18:11

2 Answers 2

up vote 2 down vote accepted

I think this would be your answer :

Data = Integrate[x^2 + y^2, {x, 0, t}, {y, 6, 10}]; Plot[Data, {t, 0, 6}]

and this would be your Graphic :

enter image description here

share|improve this answer

DSaad's answer above is correct. You can use symbolic integration to get the formula. The solution when using numeric integration (NIntegrate instead of Integrate) is more complicated. You must use ?NumericQ to delay the evaluation of the numeric integral:

myFunction[t_?NumericQ]:= NIntegrate[x^2 + y^2, {x, 0, t}, {y, 6, 10}]; 
Plot[myFunction[t], {t, 0, 6}]

To see why ?NumericQ is needed here, please see this.

share|improve this answer
I assume you meant NIntegrate, not Integrate in the definition of myFunction? –  rcollyer Jun 6 '13 at 18:47
yes. Sorry about that. –  Searke Jun 7 '13 at 19:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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