# How I Teach Calculus: Computers.

Walking through parking lots is interesting to me.  Say what you will, but it occurred to me to bring it up in one of my math classes.  What’s the shortest path through a parking lot?

The safest approach, perhaps, but not the shortest: 280 feet.

Many shorter paths exist by walking diagonally through the lot.

This route is only 250 feet.

This one's 240 feet

230 feet! Is this the optimal solution?

To decide that this is absolutely the best path, mathematically, might take quite a bit of work.  I actually never got around to figuring out how I would represent it mathematically – it’s just so much easier to plug it into Google Maps and use the measurement tool.  In the field, you can kind of just pick a direction and things work out ok.  The hours of work to represent and solve this as a math problem are not worth the effort – the penalty of guessing and being a little wrong is, what, 15 seconds?

And yet, a lot of math problems – especially the “applications” or “real world” problems – ask students to do a tremendous amount of work to get an answer that they could have guessed at in a few seconds.

# The Mystery of the Paper Box

“You’re making a box out of paper,” the textbook explains.  Your hands clench and your knuckles whiten.  Should the box have a top, or will it be open? How much paper will you get? How much does the paper cost… per square inch?!?

“The box has no top.” You hold your breath, waiting for the next blow.  “You have a piece of paper that’s 8.5 x 11 and you’re going to cut four squares out of it.”  Your mind is racing.  The words form in your mind almost before you can read them off the page: “What are the dimensions of the box with the largest possible area?”

When you flip to the back of the book, you see that the publisher recommends creating a formula that represents the area of the eventual box in terms of the length of the sides of the squares you’ll cut out.  Find the derivative of that equation, find the zero of that derivative, and use that zero to determine the final dimensions.  The best solution in many students’ minds, however, is to guess a length between one and three inches. You’d probably be within 10% of the perfect answer, and you’d finish ten minutes sooner.  If you suggest that a different solution is best, you’d better have a very apparent benefit analysis ready, or your students will stop trusting you, check out of your class, and start asking “how much are these problems worth in our grades?”

The benefit of learning about derivatives (or skill xyz) is not apparent when the penalty for guessing is so low.  One solution some books attempt is to making the units bigger.  A farmer is mowing his field, and wants to find the best path, given that his baler can hold 5 tons of hay.  Now we’re not talking about 15 seconds: this could save a full day of work!  This is much more interesting, except:

1. By guessing, the farmer can get pretty close to the optimal solution right away.  After a few harvests, he or she will have refined it to the best path.  Your computation forgot to factor in the turning radius of the tractor and the soggy ground in the southwest corner, so he or she would probably have to make these adjustments anyway.
2. It seems possible that none of your students will ever harvest hay in their entire lives.

# My Best Solution (TL;DR)

The goal is to make the benefit of learning <skill x> apparent to students so that they will want to learn it.  The best solution I’ve ever found is in showing students how to program a computer to do all of the textbook problems for them.  Geogebra is a programming environment that students can use effectively after a few minutes of training, and in my experience people love making computers do work for them.  The math comes to the forefront because now we’re making paper boxes out of a piece of paper of any size.  Now the students aren’t learning math to figure out what size to make a box (BORING) but instead they’re learning math to figure out how to get a computer to do their homework (FUN).  They’re not doing work by hand for twenty similar problems (TEDIOUS), they’re generalizing and finding patterns that the computer can make visual for them (ILLUMINATING). They’re not talking about farmers or engineers doing some problem (IRRELEVANT AND OVERLY SIMPLIFIED) but they’re learning to identify patterns and make computers work for them (REAL-LIFE DETAIL, OVERWHELMINGLY RELEVANT).

David Cox has a lot of posts about Geogebra, and I’ve written a few other articles explaining different parts of geogebra too.  If you teach math or any kind of numerical analysis, I implore you to learn to use Geogebra or another programming environment and bring it into your classrooms.  As long as the electricity and lithium hold up (fingers crossed) programming is going to be hugely important to your students.  As an added benefit, programming will let you go farther and deeper in your classes because students will get that delicious, stone-cold, 100% accurate feedback that only a computer can give.

## 13 thoughts on “How I Teach Calculus: Computers.”

1. I love the general idea here and I can see myself totally doing something like this next year. I don’t know if I agree with the “none of the students will every harvest hay” argument. One problem I enjoy for optimization that doesn’t relate to most students’ future occupation is the optimal shape of a can. Guessing there might give you a good answer (though intuition isn’t perfect on this one) but a company could lose tons of money if they are even off by a bit. And then you can have discussions about why all cylindrical items aren’t shaped like that (the complications you mentioned in your plowing story). Thank you for the idea to get the STUDENTS to do the programming in GeoGebra.

1. I think it’s great for students to think about problems that other people have – I might argue that that skill is more important than all of the math they’ll ever study. Thinking about farmers’ problems, though, won’t necessarily convince a student far removed from farmers that he or she should learn math.

I too love the can problem, and I think it’s *perfect* for students to tackle in Geogebra. You could start them off with a ggb file that already has a cylinder of variable height and radius. I have suggestions at http://larkolicio.us/blog/?p=220 and you can check out Jon Ingram’s instructions in the comments at the bottom.

2. Thanks for sharing! This is the first time I’ve come across your blog.

I really like this approach because you’re allowing students to identify patterns and begin to make generalizations that will help them find a deeper understanding. Something I don’t think happens nearly enough in math classrooms.

I’m just wondering how you begin to extend this to address those “trickier” questions that we always see come up in calculus? You know, the ones with that one little different thing that isn’t always easy to see at first (sorry for my lack of a concrete example, it has been a while since I’ve dealt with any calculus).

Also, how do you assess the understanding of your students when you do this? Is it easy to monitor their progress using Geogebra? (Forgive me, I’ve never used it with students). If you give quizzes, tests, or exams, do you allow your students to use Geogebra?

1. Assessing students who use computers can be easier because the computers help the students craft a perfect product. If a student is a little bit wrong, when they check their program against 20 sample problems, they’ll notice that there’s an error. When they adjust their work, they can quickly check again. That kind of feedback usually requires work from a teacher, so there’s a time savings there. Your students can show off their work by embedding their ggb file in a webpage or something and emailing it to you – you can assess whether they’re correct by running the same sample problems through it!

I did let students use geogebra on many tests, but it required careful thought… Once they learned that geogebra can find derivatives automatically, tests around derivatives have to be pretty well engineered. Occasionally, to save time for myself, I’d just say, “No computers on this one, sorry,” but always felt a little weird: they’ll always have their computers at any job that requires derivatives. For preps for which I had more time, I came up with better questions that required understanding of the steps of finding derivatives (e.g. only give them a few data points instead of the full function).

1. Alright, I think I’m going to try to apply this idea over the course of my student teaching in the next 4 months. Not sure exactly how it will look, since I’m not doing Calculus, but I think the idea is transferable to other math courses. I’ll be sure to let you know how it goes.

3. A possible follow up, once they’ve programmed an optimum-finder, re: guessing (” You’d probably be within 10% of the perfect answer, and you’d finish ten minutes sooner.”): the concavity at the optimum is a measure of how good your guess has to be. Or, if you have a computed solution, how much money do you lose if you can’t for some reason make a can exactly that shape. To me this is a more interesting use of f” than just “is it a min or a max”.

4. Hi, I’ve been reading your posts for a while now, finally jumping into the fray.

I have one more thing to add to the “why programming is awesome” list: it gives the student ownership. When a student finished their bookwork, they are happy because it is over and there’s no more problems they have to do; when a student finishes a program, they are happy because they have created something they can claim as their own.

Also, if teaching is the best way to learn, what could be a better student than a computer, which always does exactly what you tell it to do without any questions!

1. Fantastic point, Drew! Let them put it on a website to boot, and they’ll have a showcase of interactive applications. At first, it was really surprising to me just _HOW MUCH_ students were proud of their programs, and I think you’ve really touched on an important part of it. Thanks!

5. I love the idea. Because I teach Math 8 to 12 (but not calculus), I saw this as an activity to do when learning the Pythagorean Thm, or, if you layer a grid over this image, the distance formula.

Couldn’t help but think of this when I saw your image: http://bit.ly/pHVw1w (if only it was on aerial view of the parking lot)

1. This might be great for pythagorean theorem practice. I hadn’t thought of the parking lot thing as an activity for class – what kind of framework would it need to make it compelling? What would the question be, and how would you get the students into it?

1. I think the math is compelling in itself. I would present the first two paths and challenge students to find a better solution. Challenging students to find the best solution might get students into it. The questions “How do you know that you have found the shortest path? How can you prove it to your partner?” might lead to interesting conversations.

The parking lot does provide a hook or context, even if no one would actually solve this problem using the Pythagorean Thm in the real-world…

… Well, almost no one. I once met a colleague from another school at a pub and we disagreed over who’s school was closer. On our coasters were diagrams of right triangles and calculations. I can only imagine what the waitress was thinking (reminds me of that “plus a constant” joke).

1. But this is the problem. You’d spend all math class on it doing calculations just to find out that your first guess was either right or off by half a second. I don’t think the math is definitely compelling in this situation, and it may be too hard to scale up to computer programming situations. You could always scale up to farmers, I suppose!

2. Another variation on this…

I have a few Rush Hour puzzles in my class so I might use these. Have students create their own parking lots and find the shortest paths.