Dancing Rectangles! – Building an Interactive Riemann Sum Demo in Desmos

||| Jump to Video ||| Jump to the Interactive Demonstration |||

I’ve been impressed with the free graphing calculator Desmos.com for quite a while now. It offers a very simple interface that is not intimidating to new users while providing a number of features to create interesting interactive graphical demonstrations quickly. There are many great graphing tools out there, but I can’t think of another one that so easily supports both instructors and students, and so quickly gets one creating interesting content. Since I have begun using it more and many people are now thinking about making more (or all) of their classes available online, I wanted to make a video to share some of its features.

A Few Thoughts on Desmos

This isn’t a paid promotion; the folks at Desmos are not aware of my existence. Desmos has simply become my preferred tool for single-variable Calculus demonstrations. It works very well for anything involving plane graphs, but it does have its limitations: it is not for programming the way Mathematica, Maple, or Sage are; it doesn’t even support three-dimensional graphs like Apple’s built-in software Grapher does; it doesn’t handle Euclidean geometry the way Geometer’s Sketchpad or Geogebra do; and it is neither a statistical nor an algebra engine.

Some of Desmos’ power is fairly intuitive and easily accessible. For example, when you create a variable, it is immediately clear that you can animate it, since Desmos shows you a little “play” button. When you graph a point in the plane, if that point is defined in terms of some variables, then Desmos makes it clear that you can drag that point around to modify those variables. Other powerful features of Desmos take a little more digging to find. Lists, for example, enable you to work with multiple objects at once. To a mathematician, they are like “indexing variables in action” — similar to what computer programmers call iterators — objects that let you loop through each element of a list. And, as you might hope, Desmos naturally supports variable length lists; so if I have a variable n and I create a list i = [1...n], then as I modify n, the list i changes with it. When I create an expression like y = (a + iD), this will create n different graphs, one for each value of i.

Screenshot showing desmos inputs and graph with Riemann sums and additional data displayed.
A demonstration of Riemann Sums in Desmos.

When I realized how easily I could drop Desmos interactive demonstrations into Blackboard (SUNY Oneonta’s Learning Management System), I started exploring Desmos’ Activities (available through teacher.desmos.com). Activities are designed to support classroom interaction, both student-student and student-teacher, and they provide a greater level of control over what students see. They allow you to create prompts where you can provide instructions or ask questions of students, and students can input information through a variety of tools. Input may be used as part of the demonstration (such as setting the number of rectangles in a Riemann sum or clicking a button to swap between using right endpoints and left endpoints), or it may be responses shared and discussed among the class. Different components of an activity can feed into each other through a simple scripting system to help build sophisticated demonstrations. From what I have seen, Desmos activities continue the pattern established by graphs of being easy to dive into while offering deep functionality for sophisticated interactions. Hopefully I’ll talk more about them in another post!

You can include both graphs and activities in any page that can include an HTML iframe. Blackboard supports this, as do (I think) most learning management systems. So if you are creating an online course, you might be interested in how quickly you can create an interactive demonstration and drop it into your course.

Video Walk-through

Here is the video where I walk through creating a Riemann Sum demonstration. Don’t judge me too harshly — it’s my first, and incredibly awkward, foray into content creation!

Video walking through the creation of a Riemann Sum demonstration in Desmos.

Riemann Sum Interactive Graph

If you open the demonstration graph at: https://www.desmos.com/calculator/m2bcvvnxpq you will be able to modify and save your own copy. Below is an embedded version. In this embedded version, you cannot access the console to make changes (you can if you use the link above), but you can still modify the manipulatives by dragging points on the graph. In this example, you can move the points (a,f(a)) and (b,f(b)) along the graph, and drag the points for n and s back and forth to change their values.