# Trying to make the animation showing the process of integration using Wolfram Mathematica

I'm pretty new here, I'm trying to make a animation of integration in Wolfram Mathematica, but it's getting me a headache I really don't know how to do this.

The point is to ilustrate the process of integration, in one side to use sum by parts (on with the lower heigh and the other with the higher heigh) in some continuos part, so far I was trying to use DiscretePlot, but I wasn't ablee to go far

• Welcome to MSE. Hard to help you because you have not described what exactly you are trying to animate. Please post the code you have tried (as text that can be copied/pasted, not an image). Commented Apr 23, 2021 at 19:29

With

f[x_] = 2 + Cos[x];
step = 3 Pi/20;
fleft[x_] = f[step Floor[x/step]];
fright[x_] = f[step Ceiling[x/step]];


We may plot:

Plot[{f[x], fleft[x], fright[x]}, {x, 0, 3 Pi},
PlotStyle -> {Red, Black, Green}, Filling -> {2 -> {{3}, Yellow}}]


or:

Or do you prefer:

Plot[{f[x], fright[x]}, {x, 0, 3 Pi}, Filling -> Bottom,
Exclusions -> None]
Plot[{f[x], fleft[x]}, {x, 0, 3 Pi}, Filling -> Bottom,
Exclusions -> None]


• Thanks a lot for the answear! I swear to god, this was killing me inside Commented Apr 23, 2021 at 19:53