# How I Teach Calculus: A Comedy (Programming Loops)

Once, during a math department meeting (the only one I’ve ever actually attended) I mentioned that we should probably stop teaching 90% of what we teach and start using computers to actually do math that’s interesting.^{1}

Later that year, I walked by a classroom that was dividing polynomials by other, albeit lesser, polynomials despite being able to use a computer to be able to circumvent this process entirely by making it absolutely obsolete. The fact that my students can’t vocalize that is the tragedy. (read the section on math battles from *The Story of Sqrt(-1)* by Nahim)

Here’s someone more successful that myself saying the say thing with a cooler accent:

I took some heat in the Global Math Department a few nights ago about this, and I’ve taken some time to think about it. I suppose it comes across as unprofessional to say that certain techniques are “stupid” or “not worth teaching,” but, as was said to me at a party in 2003: “Shit, if I can numerically integrate in Mathematica, why would I ever bother to take Calc 2?” We were those people that have fights like that. Actually, I was just smoking and grilling the ribs and the smart kids were talking about integrals (I failed calculus the first time I took it, and I pretended to understand instead of asking questions; I was NOT a product of SBG)

A bit naive, because those skills obviously inform on an abstract level, but I’m not prepping mathematicians here, I’m prepping humans who need to be able to think mathematically. I literally can’t think of anything more mathematically thinky than teaching a computer how to walk around an ellipse.

A what?

YAY AN EXAMPLE

# Did you know that calculating the circumference of an ellipse is hard to do?

Like, way harder than the circumference of a circle? I didn’t.

I’m just now getting my students into the happy elf-land of angry-about-not-knowing that is pure math, and when this question popped up–from a student!–we were arguing about whether it was worth it to memorize the volumes/surface area formulas for various shapes when a kid accidentally said circumference of an ellipse. Woops!

They got a bit creative. They Googled, but it’s un-googlable! No one knows! The answers the kids found through their usual channel were noteasy.

They tried:

This makes no sense, by units, which was a fun conversation.

We began to talk about ways to circumvent the problem.

How do you measure distance? I walk? I use a map? I get out a measuring tape?

How can we train the computer to do that? And the ellipse-walk was born. Here’s the Processing code:

//estimate circumference of ellipse

float a = 36.0; //horizontal

float b = 9.0; //vertical

float y, x2, y2, d;

float answer = 0.0;for(float i=0.0; i<(a-0.01); i += 0.01){

y = b*sqrt(1-(i*i)/(a*a));x2 = i+0.01;

y2 = b*sqrt(1-(x2*x2)/(a*a));d = sqrt(0.0001+(y2-y)*(y2-y));

answer = answer + d;

}answer = 4*answer;

print(answer);

We have since written programs that do the following:

- Calculate factorials (with a fun talk about ordering nothing, 0!=1)
- Perform Newton’s method for finding zeroes (we were optimizing at the time)
- Perform the Babylonian method (Because it amazes me!)
- Finally, most importantly, DEFINITE NUMERICAL INTEGRATION.

Basically, we’ve done an exercise regimen in looping. Really, I want my students to see computers as a tool to supplement their analytic creativity.

Sometimes you have to pity Issac and Gottfried, really, you did that many iterations by hand?

1. This is crawling the webernets right now, and is awesome. Also, KA is doing some good work with code, but in the end KA still just doesn’t get it. Learning boring shit faster is still, well, you get it.

Dan Anderson October 31, 2012 - 9:58 am

I love programming as much as the next guy, but

“A bit naive, because those skills obviously inform on an abstract level, but I’m not prepping mathematicians here”

What’s wrong with prepping mathematicians?

andrew October 31, 2012 - 4:56 pm

There’s nothing wrong with prepping mathematicians, but that’s the curricular focus of K-12 mandatory mathematics. I’d like to see a “prepping mathematicians” curriculum, which would hopefully look more like Lockhart’s Measurement than the Common Core, but that’s not the current mandate.

Every school is different, but when mine makes the STEM push, they discuss math’s role as the vocabulary for expressing and solving problems across multiple fields. If that’s even a goal, not necessarily the only one, then we should at least be using the best tools that 1998 had to offer.

Matt October 31, 2012 - 6:24 am

Should students be memorizing math techniques or should they be thinking about how the math should work? I think it’s a lot easier (at least in my experience it was) to fake your way through math the first way by memorizing ‘tricks’ and ‘math songs’ than it is to attempt to fake your way through explaining what exactly the computer needs to be doing in order to arrive at the answer. The second way requires an understanding of the underlying the steps, and purposes of various functions. You have to understand how to tell the computer (in Excel, for example) what you want it to do for you (maybe not always true with Wolfram).

Michelle B. October 21, 2012 - 3:23 pm

Doing it on the computer and all would be nice, but who’s going to fund it and fund training for the teachers and update the technology from year to year. We can’t even afford interactive white boards for teacher, any training right now, and often times I don’t even have money for paper- where is this money supposed to come from.

I teach in a public high school and at a local community college and IN BOTH we have to basically do as we are told according to the curriculum.

If this guy really believe what he thinks- why doesn’t he provide all the computers and technology we need in school for free if he really believes it!

Shawn Cornally October 22, 2012 - 5:40 pm

http://education.wolfram.com/

http://www.computerbasedmath.org/

Looks like he’s trying? Or were you talking about me? In which case, I do have a non-profit that distributes computers to students in need in the Iowa City area.

Shawn Cornally October 22, 2012 - 5:41 pm

Also, maybe you could spear-head some grant writing in your area? There’s always money out there for this sort of thing; getting it distributed equitably is the work of local agents like yourself. Need help? Email me, I’d love to help.

andrew October 31, 2012 - 7:07 am

When the semester has started and you’re in the classroom, the budget question is real and in-your-face. But if you step back even a tiny bit, I don’t think it’s really a hurdle. Yeah, many schools aren’t purchasing or supporting interactive white boards. But when it omes down to it, IWBs are an incredibly specialized and hardware intensive tool that runs ON TOP OF the general purpose computing infrastructure. What Conrad/Shawn/nerds are discussing is the fact that the lowest level use of the General Purpose Computing infrastructure is computation. Finding a computer that can drive a particular flavor o IWB is way more difficulty and expensive than finding a computer that math it up in Python/Ruby/Scheme/Processing.

If it’s Halloween, that fact doesn’t change the conditions for your semester exam. But it should suggest that *finding* computers for students to use isn’t the primary hurdle.

The question about training is more significant, but as a math teacher who gets paid for tech training and integration, I think math teachers come at this a bit backwards. We’re too ofte looking for ways the tech tools can help prod kids along towards our predefined goals of what math fluency looks like. We do need training, but we need *math* training. If you went through your math grad/undergrad work without computational tools, you need to go back and look at that material again through a different lens. It’s not just that computational tools make certain problems easier; they make certain problems NOT PROBLEMS.

Noah October 20, 2012 - 9:19 am

When I do an indefinite integral I can see patterns and connections that would be lost if I stuck solely to definite numerical integration. A few examples: the connection between the surface area of a sphere and the volume of a sphere; the path independence of work by a conservative force; how the field by a charged rod along its bisector is similar to that of an infinite rod at small distances and similar to that of point charge at large distances; that by symmetry arguments I know certain integrals of complicated odd functions must be zero; etc. Finding an actual number for the final answer is kind of boring to me. Similarly, the idea that one can find a good approximation to the answer by literally adding up a lot of tiny pieces is less interesting to me than the discovery that in some cases there exists an accumulator function that can be described concisely and that has a second meaning.

Shawn Cornally October 31, 2012 - 6:09 am

Right. But. Um. Those examples are from a person who already gets it. I’m not trying to be contentious. And, all of those examples are awesome bits of math reasoning, but very few of them require the blinding frustration of trigonometric substitution or partial fractions. Why wouldn’t a math curriculum rooted in programming bust out pencil and paper when necessary instead of the other way around?

andrew October 31, 2012 - 7:14 am

My reference point in this debate is the first few weeks of analysis. Is there something that removes the need for students to grapple with equivalence classes of Cauchy Sequences or Dedekind cuts? No, because those are constructions that have huge double value for young mathematicians. Those arguments showcase the foundations of an analytic framework by exploring/exploding a familiar context.

Notably, those classes came for me *after* the mechanical/numerical calc sequence. They were the “welcome to real math, kid” classes, where secrets were revealed to me primarily because I had publicly declared that I wasn’t interest in sullying my math knowledge by anything so base as

solving problems.I’m not sold on that solution. I don’t think group theory and analysis need to be sequestered away. But given that structure, shouldn’t we use the best/strongest problem solving tools available in those “mundane” classes?

Kelly Holman October 19, 2012 - 5:57 pm

Thinking out loud, and considering that I haven’t done calculus since I’ve been outside the box:

In my experience, if students don’t go through a process and get their hands dirty, they don’t really know how it works or when to use it or which method is best for a particular situation. Not that they have to always do it by hand, but at least enough to understand how it works. Maybe I’m biased because I often do things by hand when I could use technology, but the more I do something, the more deeply I understand.

How far does this go? Computers can solve an ugly equation in a second, but would you stop requiring that students learn how to do it themselves? Could a student handle your calculus class if they depended on a calculator to do all their algebraic manipulation?

I use computers for tedious jobs like calculating standard deviation or factorial of 100. But when I do algebraic manipulation or solve a complicated geometry question I notice things during the process. I see the similarity to something else and make a connection and have a eureka moment and I’m in awe of how the whole system fits together so perfectly. Maybe that’s because I love math, but I want to make it possible for other people to love it too.

Maybe this is a difference between a math-oriented point of view vs. physics-oriented. But I wonder, if students don’t learn how to do things like prove theorems and integrate messy functions, who will come up with the future breakthroughs in math? Computers just do what you tell them, they don’t notice something interesting about the intermediate step, or go on a tangent when they get stuck.

What I would find amazing, that I think would suit both sides of this debate, is having students program a computer to do the dirty work. If they can teach a computer to do integrals, they sure understand it.

Shawn Cornally October 31, 2012 - 6:10 am

I think the assumption that programming is not “getting your hands dirty” is based on a false premise, but I see your point. [generalization alert] As with everything it teaching, is the nuance of pedagogy that matters, not the standards, the medium, or what have you.

Jay October 19, 2012 - 8:34 am

I’m not really sure how the system works in the US, but do you really have the luxury as a teacher to decide for yourself what to teach your students? As a norwegian teacher I agree that polynomial divison might not be the most valuable thing to teach, but if I don’t, how are the students supposed to answer the polynomial divison problems that show up on their exams?

Shawn Cornally October 19, 2012 - 11:17 am

Lots of us don’t have exit exams. In lots of states you have total control what to teach, but that’s slipping away rapidly.