File:Riemann Sum.gif

Uploaded by Berto
Upload date 2022-08-24T08:44:46Z
MIME type image/gif
Dimensions 1075 × 359 px
File size 4.5 MB

Summary

Description
English: A "Riemann integral" is an intuitive but rigorous way to define the area below a curve by approximating it as the sum of a bunch of rectangles. As the width of the rectangles goes to zero, this sum converges to the desired area.
Date
Source https://twitter.com/j_bertolotti/status/1562066595442315267
Author Jacopo Bertolotti
Permission
(Reusing this file)
https://twitter.com/j_bertolotti/status/1030470604418428929
GIF development
InfoField
 This diagram was created with Mathematica.

Mathematica 13.1 code

f[x_] := (BesselJ[0, x] + 0.5)/1.5
\[Delta]values = Table[10^x, {x, 1, Log[10, 0.05], -1./100}];
frames = Table[
   sum = Table[{\[Delta]min, Total@Table[ f[j*\[Delta]min]*\[Delta]min, {j, 1, 10/\[Delta]min}]}, {\[Delta]min, Select[\[Delta]values, # > \[Delta] &]}];
   Grid[{{
      Plot[f[x], {x, 0, 10}, PlotStyle -> {Thick, Black} , AxesStyle -> {Black, Thick}, AxesLabel -> {"x", "y"}, LabelStyle -> {Bold, Black, FontSize -> 14}, PlotRange -> {{0, 10}, {0, 1}}, Epilog -> {Orange, Opacity[0.25], EdgeForm[Directive[Thick, Orange, Opacity[0.5]]], Table[Rectangle[{j*\[Delta], 0}, {(j + 1)*\[Delta], f[j*\[Delta]]}], {j, 0, 10/\[Delta]}]}, ImageSize -> 400]
      ,
      ListLogLinearPlot[sum, Joined -> True, PlotStyle -> {Thick, Black}, Axes -> False, Frame -> True, FrameLabel -> {"Sampling interval size", "Total area of rectangles"}, LabelStyle -> {Bold, Black, FontSize -> 14}, PlotRange -> {{0.05, 10}, {0, 4.1}}, ImageSize -> 400]
      }}]
   , {\[Delta], \[Delta]values}];
ListAnimate[frames]

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Captions

Visual rapresentation of the Riemann sum converging to the area below a curve

Items portrayed in this file

depicts

23 August 2022

image/gif

Category:Animated GIF files Category:CC-Zero Category:Calculus Category:Images with Mathematica source code Category:PNG created with Mathematica Category:Self-published work