Tag Archives: CDF file

Making visible the abstraction in algebraic notation

The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome. The source code is the Mathematica Notebook Handmade Exp Tree.nb, which is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.

Algebraic notation

Algebraic notation contains a hidden abstract structure coded by apparently arbitrary conventions that many college calculus students don't understand completely. This very simple example shows one of the ways in which calc students may be confused:

  1. $x+2y$
  2. $(x+2)y$

Students often mean to express formula 2 when they write something like \[x\!\!+\!\!2\,\,\,\,y\] (with a space).  This is a perfectly natural way to write it. But it is against the rules, I presume because in handwriting it is not clear when you mean a space and when you don't. 

Formula 1 can also be written as $x+(2y)$, and if it were usually written that way students (I predict) would be less confused.   Always writing it this way would exacerbate the clutter of parentheses but would allow a simple rule:

Evaluate every expression inside parentheses first, starting with the innermost.

Using trees for algebra

Writing algebraic expressions as a tree (as in computing science)

  • makes it obvious what gets evaluated first
  • uses no parentheses at all.

An example of using the tree of an expression to do calculations is available in Expressions.nb (requires Mathematica) and Expressions.cdf (requires CDF player only) on my Mathematica website.  I could imagine using tree expressions instead of standard notation as the normal way of doing things. That would require working on Ipads or some such and would take a big amount of investment in software making it intuitive and easy to use.  No, I am not going to embark on such an adventure, but I think it ought to be attempted.  (Brett Victor has many ideas like this.)

Transforming algebraic notation into trees

The two manipulable diagrams below show the algebraic notation being transformed into tree form.  I expect that this will make the abstract structure more concrete for many students and I encourage others to show it to their students.  Note that the tree form makes everything explicit.>

After I return from a ten-day trip I will explore the possibility of making the expression-to-tree transformer turn the expression into an evaluable tree as in Expressions.nb and Expressions.cdf.  In the I hope not to distant future students should have access to many transformers that morph expressions from one form into another.  Such transformers are much more politically correct than Optimus Prime.

Offloading chunking and Computable algebraic expressions in tree form are earlier posts related to this post.


Send to Kindle

Case Study in Exposition: Secant

The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome. The source code comes from several Mathematica notebooks lists in the References. The notebooks are available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.

Pictures, metaphors and etymology

Math texts and too many math teachers do not provide enough pictures and metaphors to help students understand a concept.  I suspect that the etymology of the technical terms might also be useful. This post is an experimental exposition of the math concept of “secant” that use pictures, metaphors and etymology to describe the concept.

The exposition is interlarded with comments about what I am doing and why.  An exposition directly aimed at students would be slimmer — but some explanations of why you are doing such and such in an exposition are not necessarily out of place every time!

Secant Line

The word “secant” is used in various related ways in math.  To start with, a secant line on a curve is the unique line determined by two distinct points on the curve, like this:

The word “secant” comes from the Latin word for “cut”, which came from the Indo-European root “sek”, meaning “cut”.  The IE root also came directly into English via various Germanic sound changes to give us “saw” and “sedge”.

The picture

Showing pictures of mathematical objects that the reader can fiddle with may make it much easier to understand a new concept.  The static picture you get above by keeping your mitts off the sliders requires imagining similar lines going through other pairs of points. When you wiggle the picture you see similar lines going through other pairs of points.  You also get a very strong understanding of how the secant line is a function of the two given points.  I don’t think that is obvious to someone without some experience with such things.

This belief contains the hidden claim that individuals vary a lot on how they can see the possibilities in a still picture that stands as an example of a lot of similar mathematical objects.  (Math books are full of such pictures.)  So people who have not had much practice learning about possible variation in abstract structures by looking at one motionless one will benefit from using movable parametrized pictures of various kinds.  This is the sort of claim that is amenable to field testing.

The metaphor

Most metaphors are based on a physical phenomenon.  The mathematical meanings of “secant” use the metaphor of cutting.  When the word “secant” was first introduced by a European writer (see its etymology) in the 16th century, the word really was a metaphor.   In those days essentially every European scholar read Latin. To them “secant” would transparently mean “cutting”.  This is not transparent to many of us these days, so the metaphor may be hidden.

If you examine the metaphor you realize that (like all metaphors) it involves making some remarkably subtle connections in your brain.

  • The straight line does not really cut the curve.  Indeed, the curve itself is both an abstract object that is not physical, so can’t be cut, and also the picture you see on the screen, which is physical, but what would it mean to cut it?  Cut the screen?  The line can’t do that.
  • You can make up a story that (for example) the use was suggested by the mental image of a mark made by a knife edge crossing the plane at points a and b that looks like it is severing the curve.
  • The metaphor is restricted further by saying that it is determined by two points on the curve.   This restriction turns the general idea of secant line into a (not necessarily faithful!) two-parameter family of straight lines.  You could define such a family by using one point on the curve and a slope, for example.  This particular way of doing it with two points on the curve leads directly to the concept of tangent line as limit.

Secant on circle

Another use of the word “secant” is the red line in this picture:

This is the secant line on the unit circle determined by the origin and one point on the circle, with one difference: The secant of the angle is the line segment between the origin and the point on the curve.  This means it corresponds to a number, and that number is what we mean by “secant” in trigonometry.

To the ancient Greeks, a (positive) number was the length of a line segment.

The Definition

The secant of an angle $\theta$ is usually defined as $\frac{1}{\cos\theta}$, which you can see by similar triangles is the length of the red line in the picture above.

In many parts of the world, trig students don’t learn the word “secant”. They simply use $\frac{1}{\cos\theta}$.

This illustrates important facts about definitions:

  • Different equivalent definitions all make the same theorems true.
  • Different equivalent definitions can give you a very different understanding of the concept.

The red-line-segment-in-picture definition gives you a majorly important visual understanding of the concept of “secant”.  You can tell a lot from its behavior right off (it goes to infinity near $\pi/2$, for example).

The definition $\sec\theta=\frac{1}{\cos\theta}$ gives you a way of computing $\sec\theta$.  It also reduces the definition of $ \sec\theta$ to a previously known concept.

It used to be common to give only the $ \frac{1}{\cos\theta}$ definition of secant, with no mention of the geometric idea behind it.  That is a crime.  Yes, I know many students don’t want to “understand” stuff, they only want to know how to do the problems.  Teachers need to talk them out of that attitude.  One way to do that in this case is to test them on the geometric definition.


This idea was known to the Arabs, and brought into European view in the 16th century by Danish mathematician Thomas Fincke in “Geometria Rotundi” (1583), where the first known use of the word “secant” occurs.  I have not checked, but I suspect from the title of the book that the geometric definition was the one he used in the book.

It wold be interesting to know the original Arabic name for secant, and what physical metaphor it is based on.  A cursory search of the internet gave me the current name in Arabic for secant but nothing else.

Graph of the secant function

The familiar graph of the secant function can be seen as generated by the angle sweeping around the curve, as in the picture below. The two red line segments always have the same length.


Mathematica notebooks used in this post:


Send to Kindle

Some demos of families of functions

I have posted on abstractmath.org a CDF file of families of functions whose parameters you can control interactively. It is fascinating to play with them and see phenomena you (or at least I) did not anticipate.  Some of them have questions of the sorts you might ask students to discuss or work out.  Working out explanations for many of the phenomena demand some algebra skills, and sometimes more than that.

The Mathematica command that sets up one of the families looks like this:

Plot[{Sin[a x], a Cos[a x]}, {x, -2 Pi, 2 Pi},
PlotRange -> {{-4, 4}, {-4, 4}}, PlotStyle -> {Blue, Red},
AspectRatio -> 1], {{a, 1}, -4, 4, Appearance -> “Labeled”}]

It would be straightforward to make a command something like

PlotFamily[functionlist, domain, plotrange]

with various options for colors, aspect ratio and so on that would do these graphs.  But I found it much to easy to simply cut and paste and put in the new inputs and parameters as needed.

This sort of Mathematica programming is not hard if you have an example to copy, but you do need to get over the initial hump of learning the basic syntax.   I know of no other language where it would be as easy as the example above to produce an interactive plot of a family of functions.

But many people simply hate to learn a new language.  If this sort of interactive example turns out to be worthwhile, someone could design an interface that would allow you to fill in the blanks and have the command constructed for you.  (I could say the same about some of other cdf files I have posted on this blog recently.) But that someone won’t be me.  I have too much fun coming up with new ideas for math  exposition to have to spend time working out all the details.  And all my little experiments are available to use under the Creative Commons License.

I would appreciate comments and suggestions.


Send to Kindle

Picturing derivatives

The CDF files in G&G posts no longer work. I have been unable to find out why.I expect to produce another document on abstractmath.org that will include this example and others. A link willl be posted here when it is done.

This is my first experiment at posting an active Mathematica CDF document on my blog. To manipulate the graph below, you must have Wolfram CDF Player installed on your computer. It is available free from their website.

This is a new presentation of old work. It is a graph of a certain fifth degree polynomial and its first four derivatives.

The buttons allow you to choose how many derivatives to show and the slider allows you to show the graphs from x=-4 up to a certain point.

How graphs like this could be used for teaching purposes

You could show this in class, but the best way to learn from it would be to make it part of a discussion in which each student had access to a private copy of the graph.  (But you may have other ideas about how to use a graph like this.  Share them!)

Some possible discussion questions:

  1. Click button 1. Now you see the function and the derivative. Move the slider all the way to the left and then slowly move it to the right.  When the function goes up the derivative is positive.  What other things do you notice when you do this?
  2. If you were told only that one of the functions is the derivative of the other, how would you rule out the wrong possibility?
  3. What can you tell about the zeroes of the function by looking at the derivative?
  4. Look at the interval between x=1.5 and x=1.75.  Does the function have one or two zeroes in that interval?  On my screen it looks as if the curve just barely  gets above the x axis in that interval.  What does that say about it having one or two zeroes?  How could you verify your answer?
  5. Click button 2.  Now you have the function and first and second derivatives.  What can you say about maxima, minima and concavity of the function?
  6. Find relationships between the first and second derivatives.
  7. Now click button 4.  Evidently the 4th derivative is a straight line with positive slope.  Assume that it is.  What does that tell you about the graph of the third derivative?
  8. What characteristics of the graph of the function can you tell from knowing that the fourth derivative is a straight line of positive slope?
  9. What can you say about the formula for the function knowing that the fourth derivative is a straight line of positive slope?
  10. Suppose you were given this graph and told that it was a graph of a function and its first four derivatives and nothing else.  Specifically, you do not know that the fourth derivative is a straight line.  Give a detailed explanation of how to tell which curve is the function and which curve is each specific derivative.

Making this manipulable graph

I posted this graph and a lot of others several years ago on abstractmath.org.  (It is the ninth graph down).  I fiddled with this polynomial until I got the function and all four derivatives to be separated from each other.  All the roots of the function and all its derivatives are real and all are shown.  Isn’t this gorgeous?

To get it to show up properly on the abmath site I had to thicken the graph line.  Otherwise it still showed up on the screen but when I printed it on my inkjet printer the curves disappeared. That seems to be unnecessary now.

Mathematica 8.0 has default colors for graphs, but I kept the old colors because they are easier to distinguish, for me anyway (and I am not color blind).

Inserting CDF documents into html

A Wolfram document explains how to do this.  I used the CDF plugin for WordPress.  WordPress requires that, to use the plugin, you operate your blog from your own server, not from WordPress.com.  That is the main reason for the recent change of site.

The Mathematica files are New5thDegreePolynomial.nb and New5thDegreePolynomial.cdf on my public folder of Mathematica files.  You may download the .cdf file directly and view it using CDF player if you have trouble with the embedded version. To see the code you need to download the .nb file and open all cells.

Here are some notes and questions on the process.  When I find learn more about any of these points I will post the information.

  1. At the moment I don’t know how to get rid of the extra space at the top of the graph.
  2. I was surprised that I could not click on the picture and shrink or expand it.
  3. It might be annoying for a student to read the questions above and have to go up and down the screen to see the graph.  I had envisioned that the teacher would ask the questions and have the students play with the graph and erupt with questions and opinions.  But you could open two copies of the .cdf file (or this blog) and keep one window showing the graph while the other window showed the questions.
  4. Which raises a question:  Could it be possible to program the graph with a button that when pushed would make the graph (only) appear in another window?

Other approaches

  1. I have experimented with Khan Academy type videos using CDF files.  I made a screen shot and at a certain point I pressed a button and the graph appropriately changed.   I expect to produce an example video which I can make appear on this blog (which supposedly can show videos, but I haven’t tried that yet.)
  2. It should be possible to have a CDF in which the student saw the graph with instructional text underneath it equipped with next and back buttons.  The next button would trigger changes in the picture and replace the text with another sentence or two.  This could be instead of spoken stuff or additional to it (which would be a lot of work).  Has anyone tried this?


My reaction to Khan Academy was mostly positive.  One thing that struck me that no one seems to have commented on is that the lectures are short. They cover one aspect (one definition or one example or what one theorem says) in what felt to me like ten or fifteen minutes.  This means that you can watch it and easily go back and forth using the controls on the video display.  If it were a 50-minute lecture it would be much harder to find your way around.

I think most students are grasshoppers:  When reading text, they jump back and forth, getting the gist of some idea, looking ahead to see where it goes, looking back to read something again, and so on.  Short videos allow you to do this with spoken lectures. That seems to me remarkably useful.

Send to Kindle

Riemann clouds improved

In my post Playing with Riemann Sums I showed a couple of clouds of points, each representing a particular Riemann sum for a particular function.   I have extended the code in a couple of ways.

The new code is in the Mathematica notebook and CDF file called MoreRiemann in the Mathematica section of abstractmath.   The .nb form is a Mathematica Notebook, which requires Mathematica to run and allows you to manipulate the objects and change the code in the notebook as you wish.  In particular, you can rerun the commands generating the clouds to get a new random result.  The .cdf file contains the same material and can be viewed using Mathematica CDF Player, which is available free here.  Both files have several other examples besides the ones shown below.

As always, my code is one-time code to show the ideas, but it is available freely via the Creative Commons Attribution – ShareAlike 3.0 License. I hope people will feel free to develop it further for use in teaching or for their own purposes.

Below is a cloud for \int_0^2 \sqrt{4-x^2} dx, the area of a quarter circle of radius 2, which is \pi.  The blue dots are arbitrary random Riemann sums with mesh shown on the horizontal axis and value on the vertical axis.  The partitions and the point in each subinterval are both random.  The red dots are arbitrary Riemann sums with random partitions but using the midpoint for value.

The next cloud shows random blue dots with the same meaning as above.  The red dots are Riemann sums with uniform subintervals evaluated at midpoints.  Possible discussion question for both of the clouds above:

  • Why do the red dots trend upward?

The following cloud is like the cloud above  with the addition of green dots representing uniform partitions evaluated at the left endpoint or right endpoint. (But the mesh scale is extended, giving different proportions to the picture.)

Of course the left endpoint gives the upper sums and the right endpoint gives the lower sums.

  • Explain the slight downward curvature of both green streaks.
  • Explain the big gap between the blue dots and the green dots.  (Requires some machinations with probability.)
  • Would there be blue dots a lot nearer the green dots if I ran the command asking for many more blue dots?

(These are idle questions I haven't thought about myself, but I'll bet they could be turned into good projects in analysis classes.)

Here is a cloud for \int_0^{\pi}\sin x dc with everything random for the blue dots and random partitions but midpoints for the red dots.

  • Why do these red dots trend upward?

The cloud below is for the same integral but uses uniform subintervals for the midpoint and adds green points for both the left endpoint and the right endpoint of uniform subinterval.

  • Why on earth do all the green dots trend downward???

This is a similar picture for \int_0^1 x^2 dx.  There are red dots but they are kind of drowned out.

And finally, here is \int_{\frac{1}{2}}^2 \frac{1}{x} dx:

Send to Kindle