Riemann Sum and Definite Integral Approximation
2014-04-11 02:01
This applet demonstrates Riemann Sums for approximating definite integrals. Users can input custom functions and intervals, with automatic viewport adjustment. By changing the number of subdivisions, it visually shows how rectangular area sums approach the true area under the curve, helping understand integral concepts and limit processes in calculus.
In collections
微積分
Loading the GeoGebra board and drawing, please wait…
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="4.4" version="4.4.22.0" id="1d61cf3f-d45b-4c04-ba63-1e56bf1a8982" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="786" height="878" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.5797266514806378" orientation="0" />
</panes>
<views>
<view id="4097" visible="false" inframe="true" stylebar="true" location="1,1,1" size="400" window="740,350,700,550" />
<view id="4" toolbar="0 59 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="false" inframe="false" stylebar="true" location="1,1" size="300" window="100,100,600,400" />
<view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 | 1011 || 1008 1009 || 6" visible="false" inframe="false" stylebar="false" location="1,3" size="300" window="100,100,600,400" />
<view id="1" visible="true" inframe="false" stylebar="true" location="0" size="509" window="100,100,600,400" />
<view id="2" visible="false" inframe="true" stylebar="true" location="3" size="200" window="1167,37,250,724" />
<view id="16" visible="true" inframe="false" stylebar="false" location="2" size="250" window="50,50,500,500" />
<view id="32" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="64" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />
</views>
<toolbar show="true" items="0 39 59 | 1 501 67 , 5 19 , 72 | 2 15 45 , 18 65 , 7 37 | 4 3 8 9 , 13 44 , 58 , 47 | 16 51 64 , 70 | 10 34 53 11 , 24 20 22 , 21 23 | 55 56 57 , 12 | 36 46 , 38 49 50 , 71 | 30 29 54 32 31 33 | 17 26 62 73 , 14 66 68 | 25 52 60 61 | 40 41 42 , 27 28 35 , 6" position="1" help="false" />
<input show="true" cmd="true" top="false" />
<dockBar show="true" east="true" />
</perspective>
</perspectives>
<labelingStyle val="3"/>
<font size="12"/>
<graphicsSettings javaLatexFonts="false"/>
</gui>
<euclidianView>
<size width="775" height="463"/>
<coordSystem xMin="x1" xMax="x2" yMin="y1" yMax="y2"/>
<evSettings axes="true" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>
<bgColor r="255" g="255" b="255"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="0" grid="10"/>
<axis id="0" show="true" label="" unitLabel="" tickStyle="1" showNumbers="false"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<euclidianView>
<viewNumber viewNo="2"/>
<size width="775" height="231"/>
<coordSystem xMin="x1" xMax="x2" yMin="y1" yMax="y2"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>
<bgColor r="255" g="255" b="255"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="1" grid="10"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="0"/>
<coordStyle val="0"/>
<angleFromInvTrig val="false"/>
</kernel>
<scripting blocked="false" disabled="false"/>
<construction title="" author="" date="">
<expression label ="f" exp="f(x) = sin(x)"/>
<element type="function" label="f">
<show object="true" label="false"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<ggbscript onUpdate="ZoomIn[x1, y1, x2, y2]"/>
<lineStyle thickness="2" type="10" typeHidden="1"/>
</element>
<element type="numeric" label="a">
<value val="-1.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<element type="numeric" label="b">
<value val="2.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<command name="Integral">
<input a0="f" a1="a" a2="b"/>
<output a0="s"/>
</command>
<element type="numeric" label="s">
<value val="0.9564491424152821"/>
<show object="true" label="false"/>
<condition showObject="showArea"/>
<objColor r="255" g="215" b="0" alpha="0.5"/>
<layer val="0"/>
<labelMode val="1"/>
<lineStyle thickness="1" type="0" typeHidden="1"/>
</element>
<element type="numeric" label="t">
<value val="0.5"/>
<show object="true" label="true" ev="3"/>
<condition showObject="showT"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="0" max="1" absoluteScreenLocation="true" width="100.0" x="654.0" y="175.0" fixed="true" horizontal="true"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
</element>
<command name="Function" var="x">
<input a0="f" a1="a" a2="b"/>
<output a0="g"/>
</command>
<element type="function" label="g">
<show object="true" label="false"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="7" type="0" typeHidden="1"/>
</element>
<element type="numeric" label="n">
<value val="10.0"/>
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="1" max="50" absoluteScreenLocation="true" width="200.0" x="246.0" y="115.0" fixed="true" horizontal="true"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="3" playing="false"/>
</element>
<expression label="dx" exp="(b - a) / n" />
<element type="numeric" label="dx">
<value val="0.3"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<command name="Sequence">
<input a0="a + (k * dx)" a1="k" a2="0" a3="n - 1"/>
<output a0="xs"/>
</command>
<element type="list" label="xs">
<objColor r="0" g="100" b="0" alpha="0.1"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="3"/>
<pointStyle val="-1"/>
</element>
<command name="Sequence">
<input a0="f(Element[xs, k] + (t * dx))" a1="k" a2="1" a3="n"/>
<output a0="ys"/>
</command>
<element type="list" label="ys">
<objColor r="0" g="100" b="0" alpha="0.1"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="3"/>
<pointStyle val="-1"/>
</element>
<command name="Sequence">
<input a0="Polygon[(Element[xs, k], 0), (Element[xs, k] + dx, 0), (Element[xs, k] + dx, Element[ys, k]), (Element[xs, k], Element[ys, k])]" a1="k" a2="1" a3="n"/>
<output a0="p"/>
</command>
<element type="list" label="p">
<show object="false" label="false"/>
<objColor r="0" g="51" b="204" alpha="0.5"/>
<layer val="1"/>
<labelMode val="0"/>
<lineStyle thickness="1" type="0" typeHidden="1"/>
<pointSize val="3"/>
<pointStyle val="-1"/>
</element>
<command name="Textfield">
<input a0="f"/>
<output a0="inputFunction"/>
</command>
<element type="textfield" label="inputFunction">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="15" y="15"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<linkedGeo exp="f"/>
<length val="10"/>
<caption val="f(x) ="/>
</element>
<command name="Textfield">
<input a0="a"/>
<output a0="inputA"/>
</command>
<element type="textfield" label="inputA">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="42" y="62"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<linkedGeo exp="a"/>
<length val="3"/>
<caption val="a ="/>
</element>
<command name="Textfield">
<input a0="b"/>
<output a0="inputB"/>
</command>
<element type="textfield" label="inputB">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="40" y="108"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<linkedGeo exp="b"/>
<length val="3"/>
<caption val="b ="/>
</element>
<command name="Sequence">
<input a0="Element[xs, k] + (t * dx)" a1="k" a2="1" a3="n"/>
<output a0="xs2"/>
</command>
<element type="list" label="xs2">
<objColor r="0" g="100" b="0" alpha="0.1"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<pointSize val="3"/>
<pointStyle val="-1"/>
</element>
<command name="Sequence">
<input a0="Segment[(Element[xs2, k], 0), (Element[xs2, k], Element[ys, k])]" a1="k" a2="1" a3="n"/>
<output a0="segs"/>
</command>
<element type="list" label="segs">
<show object="true" label="false"/>
<condition showObject="showRieman ∧ showT"/>
<objColor r="96" g="96" b="96" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<selectionAllowed val="false"/>
<lineStyle thickness="2" type="10" typeHidden="1"/>
<pointSize val="3"/>
<pointStyle val="-1"/>
</element>
<command name="Sum">
<input a0="p"/>
<output a0="sn"/>
</command>
<element type="numeric" label="sn">
<value val="1.8728682201291784"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="as" exp="(a * s)" />
<element type="numeric" label="as">
<value val="-0.9564491424152821"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<auxiliary val="true"/>
</element>
<expression label="fmin" exp="y(Min[f, a, b])" />
<element type="numeric" label="fmin">
<value val="-0.8414709697251465"/>
<objColor r="68" g="68" b="68" alpha="0.0"/>
</element>
<expression label="fmax" exp="y(Max[f, a, b])" />
<element type="numeric" label="fmax">
<value val="1.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="padx" exp="abs(b - a) / 4" />
<element type="numeric" label="padx">
<value val="0.75"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="x1" exp="Min[a, b] - padx" />
<element type="numeric" label="x1">
<value val="-1.75"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="x2" exp="Max[a, b] + padx" />
<element type="numeric" label="x2">
<value val="2.75"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<command name="Min">
<input a0="0" a1="fmin"/>
<output a0="c"/>
</command>
<element type="numeric" label="c">
<value val="-0.8414709697251465"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<command name="Max">
<input a0="0" a1="fmax"/>
<output a0="d"/>
</command>
<element type="numeric" label="d">
<value val="1.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="pady" exp="abs(c - d) / 4" />
<element type="numeric" label="pady">
<value val="0.46036774243128664"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="y1" exp="c - pady" />
<element type="numeric" label="y1">
<value val="-1.301838712156433"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<expression label="y2" exp="d + pady" />
<element type="numeric" label="y2">
<value val="1.4603677424312866"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
</element>
<element type="button" label="btnPlus">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="1.0"/>
<layer val="0"/>
<labelOffset x="469" y="102"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<ggbscript val="SetValue[n, n+1]"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<file name="/geogebra/gui/images/go-next.png"/>
</element>
<element type="button" label="btnMinus">
<show object="true" label="false" ev="3"/>
<objColor r="0" g="0" b="0" alpha="1.0"/>
<layer val="0"/>
<labelOffset x="197" y="101"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<ggbscript val="SetValue[n, n-1]"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<file name="/geogebra/gui/images/go-previous.png"/>
</element>
<element type="boolean" label="showT">
<value val="true"/>
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="547" y="153"/>
<labelMode val="0"/>
<caption val="取值點"/>
</element>
<element type="boolean" label="showArea">
<value val="true"/>
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="547" y="15"/>
<labelMode val="0"/>
<caption val="積分"/>
</element>
<element type="boolean" label="showRieman">
<value val="true"/>
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelOffset x="548" y="50"/>
<labelMode val="0"/>
<caption val="黎曼和"/>
</element>
<command name="Segment">
<input a0="(a, 0)" a1="(a, f(a))"/>
<output a0="seg1"/>
</command>
<element type="segment" label="seg1">
<show object="true" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="0.8414709848078965" y="0.0" z="0.8414709848078965"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<command name="Segment">
<input a0="(b, 0)" a1="(b, f(b))"/>
<output a0="seg2"/>
</command>
<element type="segment" label="seg2">
<show object="true" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="-0.9092974268256817" y="0.0" z="1.8185948536513634"/>
<lineStyle thickness="2" type="0" typeHidden="1"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<command name="RectangleSum">
<input a0="f" a1="a" a2="b" a3="n" a4="t"/>
<output a0="rieman"/>
</command>
<element type="numeric" label="rieman">
<value val="0.9600452641338934"/>
<show object="true" label="false"/>
<condition showObject="showRieman"/>
<objColor r="51" g="51" b="255" alpha="0.25" fillType="1" hatchAngle="45" hatchDistance="5"/>
<layer val="1"/>
<labelMode val="1"/>
<lineStyle thickness="1" type="0" typeHidden="1"/>
</element>
<element type="button" label="play">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="1.0"/>
<bgColor r="0" g="153" b="255" alpha="255"/>
<layer val="1"/>
<labelOffset x="410" y="143"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<ggbscript val="n=10 StartAnimation[n, true]"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<file name="/geogebra/main/nav_play.png"/>
</element>
<element type="button" label="stop">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="1.0"/>
<bgColor r="255" g="51" b="204" alpha="255"/>
<layer val="1"/>
<labelOffset x="336" y="145"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<ggbscript val="StartAnimation[n, false]"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<file name="/geogebra/main/nav_pause.png"/>
</element>
<expression label="text4" exp=""面積:" + sn + """ />
<element type="text" label="text4">
<show object="true" label="false" ev="3"/>
<objColor r="128" g="128" b="128" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<font serif="true" sizeM="2.0" size="12" style="0"/>
<absoluteScreenLocation x="358" y="80"/>
</element>
<expression label="ab" exp="(a * b)" />
<element type="numeric" label="ab">
<value val="-2.0"/>
<objColor r="0" g="0" b="0" alpha="0.1"/>
<auxiliary val="true"/>
</element>
<element type="button" label="back">
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="1.0"/>
<bgColor r="255" g="127" b="0" alpha="255"/>
<layer val="1"/>
<labelOffset x="264" y="145"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
<ggbscript val="StartAnimation[n, false] n = 10"/>
<font serif="false" sizeM="2.0" size="12" style="0"/>
<file name="/geogebra/gui/images/nav_skipback.png"/>
</element>
<expression label="txtError" exp=""誤差:" + ((100 * abs(s - rieman) / abs(s))) + "%"" />
<element type="text" label="txtError">
<show object="true" label="false"/>
<condition showObject="e"/>
<objColor r="255" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<font serif="true" sizeM="2.0" size="12" style="0"/>
<decimals val="1"/>
<absoluteScreenLocation x="628" y="50"/>
</element>
<expression label="text5" exp=""" + a + """ />
<element type="text" label="text5">
<show object="true" label="false"/>
<condition showObject="showEnds"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<font serif="true" sizeM="2.0" size="12" style="0"/>
<startPoint exp="(a, 0)"/>
<labelOffset x="-6" y="27"/>
</element>
<expression label="text6" exp=""" + b + """ />
<element type="text" label="text6">
<show object="true" label="false"/>
<condition showObject="showEnds"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelMode val="0"/>
<font serif="true" sizeM="2.0" size="12" style="0"/>
<startPoint exp="(b, 0)"/>
<labelOffset x="-5" y="25"/>
</element>
<element type="boolean" label="showEnds">
<value val="false"/>
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelOffset x="547" y="118"/>
<labelMode val="0"/>
<caption val="端點"/>
</element>
<expression label="txtRieman" exp=""s_{" + (LaTeX[n]) + "}=\sum_{k=1}^{n}{f(x_k)\Delta x }=" + (LaTeX[rieman]) + """ />
<element type="text" label="txtRieman">
<show object="true" label="false"/>
<condition showObject="showRieman"/>
<objColor r="0" g="0" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="2.0" size="12" style="0"/>
<decimals val="4"/>
<absoluteScreenLocation x="11" y="9"/>
</element>
<expression label="txtIntegral" exp=""s=\int_{a}^{b}{f(x)dx }=" + (LaTeX[s]) + """ />
<element type="text" label="txtIntegral">
<show object="true" label="false"/>
<condition showObject="showArea"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<bgColor r="255" g="255" b="0" alpha="255"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="2.0" size="12" style="0"/>
<decimals val="4"/>
<absoluteScreenLocation x="468" y="373"/>
</element>
<element type="boolean" label="e">
<value val="false"/>
<show object="true" label="true" ev="3"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="1"/>
<labelOffset x="656" y="15"/>
<labelMode val="0"/>
<caption val="誤差"/>
</element>
</construction>
</geogebra>