with(Student:-Calculus1): with(Maplets): with(Elements): RiemannSumMaplet := Maplet( Window['W1']( [ ["Enter a function", TextBox['myF']( value = "cos(x)", width = 6), "a = ", TextBox['a']( value = "0", width = 3), "b = ", TextBox['b']( value = "4", width = 3)], ["Number of partitions", Slider['S1']( 0..100, 20, 'majorticks'=20, 'minorticks'=5, 'snapticks'='false')], [Plotter['P']( height = 400, width = 400)], [MathMLViewer['Sum']( height = 75, width = 250 ), DropDownBox['C']([ blue, green, black, brown, turquoise ])], [Button['B1']( "Show Riemann Sum", onclick = 'ShowTheSum')] ] ), Action['ShowTheSum']( Evaluate('Sum' = 'MathML:-Export(ApproximateInt( myF, x=a..b, method=left, output=sum, partition=S1))'), Evaluate('P' = 'ApproximateInt( myF, x=a..b, method=left, output=plot, boxoptions=[color=C], partition=S1, title="")') ) ): Display( RiemannSumMaplet );