Message Boards Message Boards


[✓] Get table and List plot for different range of values?

Posted 10 months ago
4 Replies
1 Total Likes

I am numerically integrating a function x^2 from -5 to 5

NIntegrate[x^2, {x, -10, 10}, Method -> "LocalAdaptive"]

Between this -5 to 5, i want to find many integrand values from various ranges, say integrand value from -5 to -4.9, integrand value from -4.9 to -4.8, integrand value from -4.8 to -.4.7, ............. till integrand value from 4.9 to 5.

Is there a way i can represent it in a table, or array, or manipulate and then plot or list plot it?

4 Replies
Table[NIntegrate[x^2, {x, lb, lb + .1}], {lb, -10, 9.9, .1}]

Thank you. But when i try to plot it,it doesn't give me the desired axes. Is there a way i can plot it with the output integrand values in the y axis and the various ranges corresponding to those integrating values (-10 to -9.9, -9.9 to -9.8 ....) in the x axis?

Table[{lb + 0.05, NIntegrate[x^2, {x, lb, lb + .1}]}, {lb, -10, 
  9.9, .1}]

Worked perfectly. Thank you so much

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract