# Tag Archives: Desmos

## Computers vs. People: Writing Math

Readers of this ‘blog know I actively use many forms of technology in my teaching and personal explorations.  Yesterday, a thread started on the AP-Calculus community discussion board with some expressing discomfort that most math software accepts sin(x)^2 as an acceptable equivalent to the “traditional” handwritten $sin^2 (x)$.

From Desmos:

Some AP readers spoke up to declare that sin(x)^2 would always be read as $sin(x^2)$.  While I can’t speak to the veracity of that last claim, I found it a bit troubling and missing out on some very real difficulties users face when interpreting between paper- and computer-based versions of math expressions.  Following is an edited version of my response to the AP Calculus discussion board.

MY THOUGHTS:

I believe there’s something at the core of all of this that isn’t being explicitly named:  The differences between computer-based 1-dimensional input (left-to-right text-based commands) vs. paper-and-pencil 2-dimensional input (handwritten notation moves vertically–exponents, limits, sigma notation–and horizontally).  Two-dimensional traditional math writing simply doesn’t convert directly to computer syntax.  Computers are a brilliant tool for mathematics exploration and calculation, but they require a different type of input formatting.  To overlook and not explicitly name this for our students leaves them in the unenviable position of trying to “creatively” translate between two types of writing with occasional interpretation differences.

Our students are unintentionally set up for this confusion when they first learn about the order of operations–typically in middle school in the US.  They learn the sequencing:  parentheses then exponents, then multiplication & division, and finally addition and subtraction.  Notice that functions aren’t mentioned here.  This thread [on the AP Calculus discussion board] has helped me realize that all or almost all of the sources I routinely reference never explicitly redefine order of operations after the introduction of the function concept and notation.  That means our students are left with the insidious and oft-misunderstood PEMDAS (or BIDMAS in the UK) as their sole guide for operation sequencing.  When they encounter squaring or reciprocating or any other operations applied to function notation, they’re stuck trying to make sense and creating their own interpretation of this new dissonance in their old notation.  This is easily evidenced by the struggles many have when inputting computer expressions requiring lots of nested parentheses or when first trying to code in LaTEX.

While the sin(x)^2 notation is admittedly uncomfortable for traditional “by hand” notation, it is 100% logical from a computer’s perspective:  evaluate the function, then square the result.

We also need to recognize that part of the confusion fault here lies in the by-hand notation.  What we traditionalists understand by the notational convenience of sin^2(x) on paper is technically incorrect.  We know what we MEAN, but the notation implies an incorrect order of computation.  The computer notation of sin(x)^2 is actually closer to the truth.

I particularly like the way the TI-Nspire CAS handles this point.  As is often the case with this software, it accepts computer input (next image), while its output converts it to the more commonly understood written WYSIWYG formatting (2nd image below).

Further recent (?) development:  Students have long struggled with the by-hand notation of sin^2(x) needing to be converted to (sin(x))^2 for computers.  Personally, I’ve always liked both because the computer notation emphasizes the squaring of the function output while the by-hand version was a notational convenience.  My students pointed out to me recently that Desmos now accepts the sin^2(x) notation while TI Calculators still do not.

Desmos:

The enhancement of WYSIWYG computer input formatting means that while some of the differences in 2-dimensional hand writing and computer inputs are narrowing, common classroom technologies no longer accept the same linear formatting — but then that was possibly always the case….

To rail against the fact that many software packages interpret sin(x)^2 as (sin(x))^2 or sin^2(x) misses the point that 1-dimensional computer input is not necessarily the same as 2-dimensional paper writing.  We don’t complain when two human speakers misunderstand each other when they speak different languages or dialects.  Instead, we should focus on what each is trying to say and learn how to communicate clearly and efficiently in both venues.

In short, “When in Rome, …”.

## Roots of Complex Numbers without DeMoivre

Finding roots of complex numbers can be … complex.

This post describes a way to compute roots of any number–real or complex–via systems of equations without any conversions to polar form or use of DeMoivre’s Theorem.  Following a “traditional approach,” one non-technology example is followed by a CAS simplification of the process.

Most sources describe the following procedure to compute the roots of complex numbers (obviously including the real number subset).

• Write the complex number whose root is sought in generic polar form.  If necessary, convert from Cartesian form.
• Invoke DeMoivre’s Theorem to get the polar form of all of the roots.
• If necessary, convert the numbers from polar form back to Cartesian.

As a very quick example,

Compute all square roots of -16.

Rephrased, this asks for all complex numbers, z, that satisfy  $z^2=-16$.  The Fundamental Theorem of Algebra guarantees two solutions to this quadratic equation.

The complex Cartesian number, $-16+0i$, converts to polar form, $16cis( \pi )$, where $cis(\theta ) = cos( \theta ) +i*sin( \theta )$.  Unlike Cartesian form, polar representations of numbers are not unique, so any full rotation from the initial representation would be coincident, and therefore equivalent if converted to Cartesian.  For any integer n, this means

$-16 = 16cis( \pi ) = 16 cis \left( \pi + 2 \pi n \right)$

Invoking DeMoivre’s Theorem,

$\sqrt{-16} = (-16)^{1/2} = \left( 16 cis \left( \pi + 2 \pi n \right) \right) ^{1/2}$
$= 16^{1/2} * cis \left( \frac{1}{2} \left( \pi + 2 \pi n \right) \right)$
$= 4 * cis \left( \frac{ \pi }{2} + \pi * n \right)$

For $n= \{ 0, 1 \}$, this gives polar solutions, $4cis \left( \frac{ \pi }{2} \right)$ and $4cis \left( \frac{ 3 \pi }{2} \right)$ .  Each can be converted back to Cartesian form, giving the two square roots of -16:  $4i$ and $-4i$.  Squaring either gives -16, confirming the result.

I’ve always found the rotational symmetry of the complex roots of any number beautiful, particularly for higher order roots.  This symmetry is perfectly captured by DeMoivre’s Theorem, but there is arguably a simpler way to compute them.

NEW(?) NON-TECH APPROACH:

Because the solution to every complex number computation can be written in $a+bi$ form, new possibilities open.  The original example can be rephrased:

Determine the simultaneous real values of x and y for which $-16=(x+yi)^2$.

Start by expanding and simplifying the right side back into $a+bi$ form.  (I wrote about a potentially easier approach to simplifying powers of i in my last post.)

$-16+0i = \left( x+yi \right)^2 = x^2 +2xyi+y^2 i^2=(x^2-y^2)+(2xy)i$

Notice that the two ends of the previous line are two different expressions for the same complex number(s).  Therefore, equating the real and imaginary coefficients gives a system of equations:

Solving the system gives the square roots of -16.

From the latter equation, either $x=0$ or $y=0$.  Substituting $y=0$ into the first equation gives $-16=x^2$, an impossible equation because x & y are both real numbers, as stated above.

Substituting $x=0$ into the first equation gives $-16=-y^2$, leading to $y= \pm 4$.  So, $x=0$ and $y=-4$ -OR- $x=0$ and $y=4$ are the only solutions–$x+yi=0-4i$ and $x+yi=0+4i$–the same solutions found earlier, but this time without using polar form or DeMoivre!  Notice, too, that the presence of TWO solutions emerged naturally.

Higher order roots could lead to much more complicated systems of equations, but a CAS can solve that problem.

CAS APPROACH:

Determine all fourth roots of $1+2i$.

That’s equivalent to finding all simultaneous x and y values that satisfy $1+2i=(x+yi)^4$.  Expanding the right side is quickly accomplished on a CAS.  From my TI-Nspire CAS:

Notice that the output is simplified to $a+bi$ form that, in the context of this particular example, gives the system of equations,

Using my CAS to solve the system,

First, note there are four solutions, as expected.  Rewriting the approximated numerical output gives the four complex fourth roots of $1+2i$$-1.176-0.334i$$-0.334+1.176i$$0.334-1.176i$, and $1.176+0.334i$.  Each can be quickly confirmed on the CAS:

CONCLUSION:

Given proper technology, finding the multiple roots of a complex number need not invoke polar representations or DeMoivre’s Theorem.  It really is as “simple” as expanding $(x+yi)^n$ where n is the given root, simplifying the expansion into $a+bi$ form, and solving the resulting 2×2 system of equations.

At the point when such problems would be introduced to students, their algebraic awareness should be such that using a CAS to do all the algebraic heavy lifting is entirely appropriate.

As one final glimpse at the beauty of complex roots, I entered the two equations from the last system into Desmos to take advantage of its very good implicit graphing capabilities.  You can see the four intersections corresponding to the four solutions of the system.  Solutions to systems of implicit equations are notoriously difficult to compute, so I wasn’t surprised when Desmos didn’t compute the coordinates of the points of intersection, even though the graph was pretty and surprisingly quick to generate.

## Dynamic Linear Programming

My department is exploring the pros and cons of different technologies for use in teaching our classes. Two teachers shared ways to use Desmos and GeoGebra in lessons using inequalities on one day; we explored the same situation using the TI-Nspire in the following week’s meeting.  For this post, I’m assuming you are familiar with solving linear programming problems.  Some very nice technology-assisted exploration ideas are developed in the latter half of this post.

My goal is to show some cool ways we discovered to use technology to evaluate these types of problems and enhance student exploration.  Our insights follow the section considering two different approaches to graphing the feasible region.  For context, we used a dirt-biker linear programming problem from NCTM’s Illuminations Web Pages.

Assuming x = the number of Riders built and = the number of Rovers built,  inequalities for this problem are

We also learn on page 7 of the Illuminations activity that Apu makes a $15 profit on each Rider and$30 per Rover.  That means an Optimization Equation for the problem is $Profit=15x+30y$.

GRAPHING THE FEASIBLE REGION:

Graphing all of the inequalities simultaneously determines the feasible region for the problem.  This can be done easily with all three technologies, but the Nspire requires solving the inequalities for y first.  Therefore, the remainder of this post compares the Desmos and GeoGebra solutions.  Because the Desmos solutions are easily accessible as Web pages and not separate files, further images will be from Desmos until the point where GeoGebra operates differently.

Both Desmos and GeoGebra can graph these inequalities from natural inputs–inputing math sentences as you would write them from the problem information:  without solving for a specific variable.  As with many more complicated linear programming problems, graphing all the constraints at once sometimes makes a visually complicated feasible region graph.

So, we decided to reverse all of our inequalities, effectively  shading the non-feasible region instead.  Any points that emerged unshaded were possible solutions to the Dirt Bike problem (image below, file here).  All three softwares shift properly between solid and dashed lines to show respective included and excluded boundaries.

Traditional Approach – I (as well as almost all teachers, I suspect) have traditionally done some hand-waving at this point to convince (or tell) students that while any ordered pair in the unshaded region or on its boundary (all are dashed) is a potential solution, any optimal solution occurs on the boundary of the feasible region.  Hopefully teachers ask students to plug ordered pairs from the feasible region into the Optimization Equation to show that the profit does vary depending on what is built (duh), and we hope they eventually discover (or memorize) that the maximum or minimum profit occurs on the edges–usually at a corner for the rigged setups of most linear programming problems in textbooks.  Thinking about this led to several lovely technology enhancements.

INSIGHT 1:  Vary a point.

During our first department meeting, I was suddenly dissatisfied with how I’d always introduced this idea to my classes.  That unease and our play with the Desmos’ simplicity of adding sliders led me to try graphing a random ordered pair.  I typed (a,b) on an input line, and Desmos asked if I wanted sliders for both variables.  Sure, I thought (image below, file here).

— See my ASIDE note below for a philosophical point on the creation of (a,b).
— GeoGebra and the Nspire require one additional step to create/insert sliders, but GeoGebra’s naming conventions led to a smoother presentation–see below.

BIG ADVANTAGE:  While the Illuminations problem we were using had convenient vertices, we realized that students could now drag (a,b) anywhere on the graph (especially along the boundaries and to vertices of the feasible region) to determine coordinates.  Establishing exact coordinates of those points still required plugging into equations and possibly solving systems of equations (a possible entry for CAS!).  However discovered, critical coordinates were suddenly much easier to identify in any linear programming question.

HUGE ADVANTAGE:  Now that the point was variably defined, the Optimization Equation could be, too!  Rewriting and entering the Optimation Equation as an expression in terms of a and b, I took advantage of Desmos being a calculator, not just a grapher.  Notice the profit value on the left of the image.

With this, users can drag (a,b) and see not only the coordinates of the point, but also the value of the profit at the point’s current location!  Check out the live version here to see how easily Desmos updates this value as you drag the point.

From this dynamic setup, I believe students now can learn several powerful ideas through experimentation that traditionally would have been told/memorized.

STUDENT DISCOVERIES:

1. Drag (a,b) anywhere in the feasible region.  Not surprisingly, the profit’s value varies with (a,b)‘s location.
2. The profit appears to be be constant along the edges.  Confirm this by dragging (a,b) steadily along any edge of the feasible region.
3. While there are many values the profit could assume in the feasible region, some quick experimentation suggests that the largest and smallest profit values occur at the vertices of the feasible region.
4. DEEPER:  While point 3 is true, many teachers and textbooks mistakenly proclaim that solutions occur only at vertices.  In fact, it is technically possible for a problem to have an infinite number optimal solutions.  This realization is discussed further in the CONCLUSION.

ASIDE:  I was initially surprised that the variable point on the Desmos graph was directly draggable.  From a purist’s perspective, this troubled me because the location of the point depends on the values of the sliders.  That said, I shouldn’t be able to move the point and change the values of its defining sliders.  Still, the simplicity of what I was able to do with the problem as a result of this quickly led me to forgive the two-way dependency relationships between Desmos’ sliders and the objects they define.

GEOGEBRA’S VERSION:

In some ways, this result was even easier to create on GeoGebra.  After graphing the feasible region, I selected the Point tool and clicked once on the graph.  Voila!  The variable point was fully defined.  This avoids the purist issue I raised in the ASIDE above.  As a bonus, the point was also named.

Unlike Desmos, GeoGebra permits multi-character function names.  Defining $Profit(x,y)=15x+30y$ and entering $Profit(A)$ allowed me to see the profit value change as I dragged point A as I did in the Desmos solution. The $Profit(A)$ value was dynamically computed in GeoGebra as a number value in its Algebra screen.  A live version of this construction is on GeoGebraTube here.

At first, I wasn’t sure if the last command–entering a single term into a multivariable term–would work, but since A was a multivariable point, GeoGebra nicely handled the transition.  Dragging A around the feasible region updated the current profit value just as easily as Desmos did.

INSIGHT 2:  Slide a line.

OK, this last point is really an adaptation of a technique I learned from some of my mentors when I started teaching years ago, but how I will use it in the future is much cleaner and more expedient.  I thought line slides were a commonly known technique for solving linear programming problems, but conversations with some of my colleagues have convinced me that not everyone knows the approach.

Recall that each point in the feasible region has its own profit value.  Instead of sliding a point to determine a profit, why not pick a particular profit and determine all points with that profit?  As an example, if you wanted to see all points that had a profit of $100, the Optimization Equation becomes $Profit=100=15x+30y$. A graph of this line (in solid purple below) passes through the feasible region. All points on this line within the feasible region are the values where Apu could build dirt bikes and get a profit of$100.  (Of course, only integer ordered pairs are realistic.)

You could replace the 100 in the equation with different values and repeat the investigation.  But if you’re thinking already about the dynamic power of the software, I hope you will have realized that you could define profit as a slider to scan through lots of different solutions with ease after you reset the slider’s bounds.  One instance is shown below; a live Desmos version is here.

Geogebra and the Nspire set up the same way except you must define their slider before you define the line.  Both allow you to define the slider as “profit” instead of just “p”.

CONCLUSIONS:

From here, hopefully it is easy to extend Student Discovery 3 from above.  By changing the P slider, you see a series of parallel lines (prove this!).  As the value of P grows, the line goes up in this Illuminations problem.  Through a little experimentation, it should be obvious that as P rises , the last time the profit line touches the feasible region will be at a vertex.  Experiment with the P slider here to convince yourself that the maximum profit for this problem is $165 at the point $(x,y)=(3,4)$. Apu should make 3 Riders and 4 Rovers to maximize profit. Similarly (and obviously), Apu’s minimum profit is$0 at $(x,y)=(0,0)$ by making no dirt bikes.

While not applicable in this particular problem, I hope you can see that if an edge of the feasible region for some linear programming problem was parallel to the line defined by the corresponding Optimization Equation, then all points along that edge potentially would be optimal solutions with the same Optimization Equation output.  This is the point I was trying to make in Student Discovery 4.

In the end, Desmos, GeoGebra, and the TI-Nspire all have the ability to create dynamic learning environments in which students can explore linear programming situations and their optimization solutions, albeit with slightly different syntax.  In the end, I believe these any of these approaches can make learning linear programming much more experimental and meaningful.

## Systems of lines

Here’s an interesting variation of a typical (MS) problem I found by following the Five Triangles ‘blog: http://fivetriangles.blogspot.com/2013/09/97-no-triangle.html .

(Note:  If you sign up on this or other ‘blogs, you can get lots of problems emailed to you every time they are added.)

INITIAL SOLUTION

I know this question can absolutely be solved without using technology, but when a colleague asked if it was appropriate to use technology here (my school is one-to-one with tablet laptops), I thought it would be cool to share with her the ease and power of Desmos.  You can enter the equations from the problem exactly as given (no need to solve for y), or you can set up a graph in advance for your students and email them a direct link to an already-started problem.

If you follow this link, you can see how I used a slider (a crazy-simple addition on Desmos) to help students discover the missing value of a.

FOLLOW-UP

I suggest in this case that playing with this problem graphically would grant insight for many students into the critical role (for this problem) of the intersection point of the two explicitly defined lines.  With or without technology support, you could then lead your students to determine the coordinates of that intersection point and thereby the value of a.

Keeping with my CAS theme, you could determine those coordinates using GeoGebra’s brand new CAS View:

Substituting the now known values of x and y into the last equation in the problem gives the desired value of a.

NOTE:  I could have done the sliders in GeoGebra, too, but I wanted to show off the ease of my two favorite (and free!) online math tools.

CONCLUSION

Thoughts?  What other ideas or problems could be enhanced by a properly balanced use of technology?

As an extension to this particular problem, I’m now wondering about the area of triangle formed for any value of a.  I haven’t played with it yet, but it looks potentially interesting.  I see both tech and non-tech ways to approach it.

## Exploring Sequences and Lines

Here’s another favorite problem that could be used for any middle or high school students who’ve been exposed to both arithmetic sequences and linear equations.

There is a family of lines, $Ax+By+C=0$, for which $\left\{ A, B, C \right\}$ can be any arithmetic sequence.  What do all members of this family have in common?

As with most great math problems, the problem is simply stated and can be approached from many different perspectives.  In the end, this one isn’t that difficult to crack, but the solution (at least to me) is not intuitively obvious from the problem statement. If you’ve not seen this before, please try it before reading further.

WARNING:  Problem Solution Follows

MOST COMMON STUDENT APPROACH:  Given the problem’s phrasing, most begin by writing out a few possible equations using different arithmetic sequences, typically with positive common differences.  After a few tries, most get a little frustrated as no obvious pattern emerges from the equations.

It is this point that is typically the most difficult for me as a teacher.  I want to help anyone who struggles, but “help” often means allowing others the room to struggle and to find ways of solving problems on their own.  Only when a student or group gets really frustrated do I sometimes ask, “Are there any other ways you can look at this problem or at your work?”

Eventually, most decide to graph their equations to see if anything pops out.  The following graph was submitted this past semester by one of my precalculus students using the free online Desmos calculator.

Two lines intersecting in a point is common.  Three or more in a single point almost always indicates something interesting.  Seven lines through a single point is screaming for attention!  From this graph, all lines in this family apparently contain the point (1,-2).  That seems a bit random until you investigate further, but pattern recognition is just half of the battle for a mathematician.  Now that something interesting has been discovered, a mathematician wants to know if this is a fluke or something inherent to all members of the family.

NOTE:  All graphs my students have produced over the years have always contained specific equations.  I don’t know that it’s any more enlightening, but I did create on Desmos a slider version of the graphs of this family with one slider for the initial term (A) and a second for its common difference (d).

UNIQUE SOLUTION METHODS FROM STUDENTS:

All successful solutions eventually rewrite the sequence $\left\{ A,B,C \right\}$ to $\left\{ A,A+d,A+2d \right\}$ where d is the common difference for a generic arithmetic sequence with initial term A.

Method I: After discovering the common point of intersection, most plug it into the left side of the equation and simplify to get

$Ax+By+C=A\cdot 1+\left( A+d\right)\cdot -2+\left( A+2d \right)=0$.

Because the left side reduces to zero for all generic arithmetic sequences, $\left\{ A,A+d,A+2d \right\}$, (1,-2) must be common to all members of this family.

A few students aren’t comfortable dealing with 0=0, so these tend to plug in $x=1$ and solve for y to get $y=-2$, proving that the y-coordinate for $x=1$ for all members of this family is always -2.

Method II:  A few students every year work algebraically from properties of arithmetic sequences.  For any arithmetic sequence, $\left\{ A,B,C \right\}$, $\frac{A+C}{2}=B$.  This rewrites to $1\cdot A-2\cdot B+C=0$, so whenever $\left( x,y \right)=\left(1,-2 \right)$, then $Ax+By+C=0$ is a fundamental property of all arithmetic sequences.

Personally, I think this method gets closest to explaining why the point (1,-2) is the common characteristic of this family.

Method III:  This year, I had a student take an approach I’d never seen before.  She defined one arithmetic sequence as $\left\{ a,a+d,a+2d \right\}$ and another as $\left\{ m,m+n,m+2n \right\}$ for any real values of a,d,m, and n.  This leads to a system of equations: $a\cdot x+(a+d)\cdot y+(a+2d)=0$ and $m\cdot x+(m+n)\cdot y+(m+2n)=0$ .  If you have some younger students or if all the variables make you nervous, the solution is available via Wolfram Alpha.

Still, this system is pretty easy to manipulate.  If you multiply the first equation by m and the second by a, the x-terms will eliminate with subtraction, giving

$m\cdot((a+d)\cdot y+(a+2d))-a\cdot((m+n)\cdot y+(m+2n))=0$.

Solving for y shows that all of the coefficients simplify surprisingly easily.

$((ma+md)-(am+an))\cdot y=-(ma+2md)+(am+2an)$
$(md-an)\cdot y = -2\cdot (md-an)\Longrightarrow y=-2$

From here, determining $x=1$ is easy, proving the relationship.

SOLUTIONS and APPROACHES NOT YET OFFERED BY STUDENTS:

Approach A:  High school students don’t often think about ways to simplify problem situations, especially at the beginning of problems.  One way I did that for this problem in later class discussions was to recognize that it one of the terms in the arithmetic sequence was 0, you didn’t need to deal with nearly as many terms. For example, if your sequence was ${1,0,-1}$, the linear equation would be $x-1=0$.  Similarly, the sequence $\left\{ 01,2 \right\}$ leads to $y+2=0$.  Obviously, the only thing these two lines have in common is the point (1,-2).  A proof of the property must still be established, but this is one of the fastest ways I’ve seen to identify the central property.

Approach B:  A purely algebraic approach to this problem could redefine the arithmetic sequence as $\left\{ a,a+d,a+2d\right\}$as before, giving:

$a\cdot x+(a+d)\cdot y+(a+2d)=0$

Collecting like terms gives

$(x+y+1)\cdot a+(y+2)\cdot d=0$.

The values of a and d must remain as parameters to include all possible arithmetic sequences.  Because the equation always equals 0, the coefficients of a and d are both 0, making $y=-2$ (for the coefficient of d) and therefore $x=1$.

EXTENSION:

We once had a test question at the end of the unit containing this exercise.  Basically, it reminded students that they had discovered that all lines $Ax+By+C=0$, for which $\left\{ A, B, C \right\}$ can be any arithmetic sequence contained the point (1,-2).  It then asked for an equation of a family of linear functions using the same arithmetic $\left\{ A, B, C \right\}$ that all contained the point (1,2).

The two most common responses we’ve seen involve a reflection or a vertical translation.  (1,-2) can become (1,2) by reflecting over the x-axis, so making the y-values negative would do the trick:  $Ax-By+C=0$.  Similarly, (1,-2) can become (1,2) by translating up 4 units, giving $Ax+B(y-4)+C=0$.

## Extending graph control

This article takes my idea from yesterday’s post about using $g(x)=\sqrt \frac{\left | x \right |}{x}$ to control the appearance of a graph and extends it in two ways.

• Part I below uses Desmos to graph $y=(x+2)^3x^2(x-1)$ from the left and right simultaneously
• Part II was inspired by my Twitter colleague John Burk who asked if this control could be extended in a different direction.

Part I: Simultaneous Control

When graphing polynomials like $y=(x+2)^3x^2(x-1)$, I encourage my students to use both its local behavior (cubic root at $x=-2$, quadratic root at $x=0$, and linear root at $x=1$) and its end behavior (6th degree polynomial with a positive lead coefficient means $y\rightarrow +\infty$ as $x\rightarrow\pm\infty$). To start graphing, I suggest students plot points on the x-intercepts and then sketch arrows to indicate the end behavior.  In the past, this was something we did on paper, but couldn’t get technology to replicate it live–until this idea.

In class last week, I used a minor extension of yesterday’s idea to control a graph’s appearance from the left and right simultaneously.  Yesterday’s post suggested  multiplying  by $\sqrt \frac{\left | a-x \right |}{a-x}$ to show the graph of a function from the left for $x.  Creating a second graph multiplied by $\sqrt \frac{\left | x-b \right |}{x-b}$ gives a graph of your function from the right for $b.  The following images show the polynomial’s graph developing in a few stages.  You can access the Desmos file here.

First graph the end behavior (pull the a and b sliders in a bit to see just the ends of the graph) and plot points at the x-intercepts.

From here, you could graph left-to-right or right-to-left.  I’ll come in from the right to show the new right side controller. The root at $x=1$ is linear, so decreasing the b slider to just below 1 shows this.

Continuing from the right, the next root is a bounce at $x=0$, as shown by decreasing the b slider below 0.  Notice that this forces a relative minimum for some $0.

Just because it’s possible, I’ll now show the cubic intercept at $x=2$ by increasing the a slider above 2.

All that remains is to connect the two sides of the graph, creating one more relative minimum in $-2.

The same level of presentation control can be had for any function’s graph.

Part II: Vertical Control

I hadn’t thought to extend this any further until my colleague asked if a graph could be controlled up and down instead of left and right.  My guess is that the idea hadn’t occurred to me because I typically think about controlling a function through its domain.  Even so, a couple minor adjustments accomplished it.  Click here to see a vertical control of the graph of $y=x^3$ from above and below.

Enjoy.

## Controlling graphs and a free online calculator

When graphing functions with multiple local features, I often find myself wanting to explain a portion of the graph’s behavior independent of the rest of the graph.  When I started teaching a couple decades ago, the processor on my TI-81 was slow enough that I could actually watch the pixels light up sequentially.  I could see HOW the graph was formed.  Today, processors obviously are much faster.  I love the problem-solving power that has given my students and me, but I’ve sometimes missed being able to see function graphs as they develop.

Below, I describe the origins of the graph control idea, how the control works, and then provide examples of polynomials with multiple roots, rational functions with multiple intercepts and/or vertical asymptotes, polar functions, parametric collision modeling, and graphing derivatives of given curves.

BACKGROUND:  A colleague and I were planning a rational function unit after school last week wanting to be able to create graphs in pieces so that we could discuss the effect of each local feature.  In the past, we “rigged” calculator images by graphing the functions parametrically and controlling the input values of t.  Clunky and static, but it gave us useful still shots.  Nice enough, but we really wanted something dynamic.  Because we had the use of sliders on our TI-nSpire software, on Geogebra, and on the Desmos calculator, the solution we sought was closer than we suspected.

REALIZATION & WHY IT WORKS: Last week, we discovered that we could use $g(x)=\sqrt \frac{\left | x \right |}{x}$ to create what we wanted.  The argument of the root is 1 for $x<0$, making $g(x)=1$.  For $x>0$, the root’s argument is -1, making $g(x)=i$, a non-real number.  Our insight was that multiplying any function $y=f(x)$ by an appropriate version of g wouldn’t change the output of f if the input to g is positive, but would make the product ungraphable due to complex values if the input to g is negative.

If I make a slider for parameter a, then $g_2(x)=\sqrt \frac{\left | a-x \right |}{a-x}$ will have output 1 for all $x.  That means for any function $y=f(x)$ with real outputs only, $y=f(x)\cdot g_2(x)$ will have real outputs (and a real graph) for $x only.  Aha!  Using a slider and $g_2$ would allow me to control the appearance of my graph from left to right.

NOTE:  While it’s still developing, I’ve become a big fan of the free online Desmos calculator after a recent presentation at the Global Math Department (join our 45-60 minute online meetings every Tuesday at 9PM ET!).  I use Desmos for all of the following graphs in this post, but obviously any graphing software with slider capabilities would do.

EXAMPLE 1:  Graph $y=(x+2)^3x^2(x-1)$, a 6th degree polynomial whose end behavior is up for $\pm \infty$, “wiggles” through the x-axis at -2, then bounces off the origin, and finally passes through the x-axis at 1.

Click here to access the Desmos graph that created the image above.  You can then manipulate the slider to watch the graph wiggle through, then bounce off, and finally pass through the x-axis.

EXAMPLE 2:  Graph $y=\frac{(x+1)^2}{(x+2)(x-1)^2}$, a 6th degree polynomial whose end behavior is up for $\pm \infty$, “wiggles” through the x-axis at -2, then bounces off the origin, and finally passes through the x-axis at 1.

Click here to access the Desmos graph above and control the creation of the rational function’s graph using a slider.

EXAMPLE 3:  I believe students understand polar graphing better when they see curves like the  limacon $r=2+3cos(\theta )$ moving between its maximum and minimum circles.  Controlling the slider also allows users to see the values of $\theta$ at which the limacon crosses the pole. Here is the Desmos graph for the graph below.

EXAMPLE 4:  Object A leaves (2,3) and travels south at 0.29 units/second.  Object B leaves (-2,1) traveling east at 0.45 units/second.  The intersection of their paths is (2,1), but which object arrives there first?  Here is the live version.

OK, I know this is an overly simplistic example, but you’ll get the idea of how the controlling slider works on a parametrically-defined function.  The $latex \sqrt{\frac{\left | a-x \right |}{a-x}}$ term only needs to be on one of parametric equations.  Another benefit of the slider approach is the ease with which users can identify the value of t (or time) when each particle reaches the point of intersection or their axes intercepts.  Obviously those values could be algebraically determined in this problem, but that isn’t always true, and this graphical-numeric approach always gives an alternative to algebraic techniques when investigating parametric functions.

ASIDE 1–Notice the ease of the Desmos notation for parametric graphs.  Enter [r,s] where r is the x-component of the parametric function and s is the y-component.  To graph a point, leave r and s as constants.  Easy.

EXAMPLE 5:  When teaching calculus, I always ask my students to sketch graphs of the derivatives of functions given in graphical forms.  I always create these graphs one part at a time.  As an example, this graph shows $y=x^3+2x^2$ and allows you to get its derivative gradually using a slider.

ASIDE 2–It is also very easy to enter derivatives of functions in the Desmos calculator.  Type “d/dx” before the function name or definition, and the derivative is accomplished.  Desmos is not a CAS, so I’m sure the software is computing derivatives numerically.  No matter.  Derivatives are easy to define and use here.

I’m hoping you find this technology tip as useful as I do.