Piecewise Functions:  Investigating Differentiability

Objective:  Students in calculus need to be proficient in working with functions in a variety of ways:  graphical, numerical, analytic, or verbal, and to understand connections among these representations.  This demo provides a set of visualizations designed to help students better understand what it means for a piecewise function to be differentiable at a particular domain value.

Level:  The visualizations and activities in this demo are appropriate for high school or college level calculus classes.  With careful explanation about slopes of graphs of nonlinear functions and sufficient background, the demo may be accessible to precalculus students.

Platform:   Excel files that accompany this demo are freely downloadable and can be used in class or for individual investigations by students. Java applets use the Java Components for Math, developed by David Eck under NSF grant number DUE-9950473.

Instructor's Notes:  It is often the case that my students try to memorize procedures instead of striving to gain an understanding of fundamental mathematical concepts.  It has been my experience that students often have great difficulty understanding piecewise functions and when these functions are continuous and/or differentiable at a "breakpoint" in the domain.  The visualizations in this demo were developed with the idea that if a student gains geometric insight, then an analytic approach will become more meaningful.

A recent study [1] suggests that in science classes, a discussion prior to executing the demo and a post-discussion where students articulate and write down what they observed can be beneficial to student learning.

This demo is concerned with choosing values of parameters so that a piecewise function is differentiable; a separate demo related to continuity of piecewise functions can be found by following this link.

Example 1
.  We wish to determine the values of the parameters k and m for which the function below is differentiable at x = 3:

For a function to be differentiable at a domain value,  the function must be continuous there.  Thus, there are TWO conditions to satisfy by choosing values of the parameters k and m.  First, the function must be continuous (left and right pieces match).  Secondly, the pieces must match with the same slope.  The figure below illustrates that it is possible to choose a value of k for which the function is continuous at x = 3, however, the function fails to be differentiable there because the left and right pieces of the derivative function do not match at x = 3.

 Graph of f when k = 1 and m = 1. The function appears to be continuous at x = 3. (Left and right hand parts match) Graph of the derivatives of the left and right hand parts.  The function is not differentiable at x = 3. (Left and right hand parts of the derivative graph do not match)

Similarly, the figure below illustrates that there appear to be values of k and m for which the derivative graphs "match" at x = 3, however, the function is not differentiable in this case because the function is not continuous there.  (Remember that if a function is differentiable at a point, it must be continuous there.)

 Graphs of derivatives of left and right hand parts.  The parts "match" at x = 3. The function is NOT differentiable at x = 3 because the function is not continuous at  x = 3.

Analytically, the requirement that the pieces of the graph match at x = 3 and that the graph of the derivative pieces match at x = 3 lead to the system of equations:

which has as solution k = 4, m = -1.  A graph of the continuous function and its derivative is shown below.

A Quicktime movie that shows changes in parameters k and m is shown below.  When using the movie in class, it is useful to pause the playback so that you can discuss the situation when the function is continuous but not differentiable.  It is also useful to pause the playback when the derivative pieces "match" but the function pieces do not so that you can point out that the function is not differentiable (because it is not continuous).   The Quicktime movie provides start/stop features so that the instructor can pause during the course of the lesson to discuss what is happening in the animation.  The functionality of the movie control bar is shown below.

Click the PLAY button to initiate the movie.

A Java implementation of this example is given below.  Note that the functionality of the applet does not provide the ability to plot individual points, so behavior at the break point and endpoints should be discussed.  The graph of the function is in magenta; the graph of the derivative is in green.  The object is to use the sliders to choose parameters for which the magenta pieces match and the green pieces match.

Example 2.  As another example, we explore the differentiability of the function

at x = 0.  The graphs of the functions are shown below for a = -2.5, b = 4, and c = 0.1.

The figure below illustrates that there appears to be one set of parameters for which the function is differentiable at x = 0.

Further experimentation shows that there are additional values of the parameters that give differentiability at x = 0.  This is shown in the next figure.

Analytically, the function is continuous at x = 0 if

The function is differentiable at x = 0 if

The differentiability condition implies that b = 0 or

Now, if b = 0, the continuity condition implies that a = 0 and c can have any value.  This somewhat uninteresting situation is illustrated below.

If b is different from zero, then c = 1/2 + n.  In this case, the continuity condition implies that

This situation is illustrated by the figure below:

Note that in this case, n = -2; sin(-1.5 p) = 1.  This gives a = b.  Thus, a and b can have any (equal) value.

Similarly, if c = 1.5, n = 1 and sin (1.5p ) = -1.  This gives a =-b.  In this case, a and b are equal in absolute value but are negatives of each other.  This situation is illustrated below.

A Java implementation of this example is given below.  Note that the functionality of the applet does not provide the ability to plot individual points, so behavior at the break point and endpoints should be discussed.  The graph of the function is in magenta; the graph of the derivative is in green.  The object is to use the sliders to choose parameters for which the magenta pieces match and the green pieces match.

A variety of examples have been constructed that can be used for classroom demonstration as well as for individual student exploration.

• An Excel file with 10 interactive example can be downloaded from hereNOTE:  In order to use the control features in the file, you must choose "Enable Macros." The examples illustrated in this demo are Example 1 and Example 10.

• An interactive Java applet is available that has several built-in examples plus the functionality of entering additional examples (PLEASE READ IMPORTANT INFORMATION ABOUT SYNTAX BEFORE DECIDING WHETHER TO LET STUDENTS INPUT THEIR OWN EXAMPLES).  That applet can be accessed by clicking on this link.

References

1.  Crouch, Catherine H., Fagen, Adam P., Callan, J. Paul, and Mazur, Eric. "Classroom Demonstrations:  Learning tools or entertainment?" Am. J. Physics, 72(6), June 2004, pp 835-838.

Credits:  This demo was inspired by free response questions on the 2003 AP Calculus AB Exam (#6) and by questions submitted by students to Ask Dr. Math at Mathforum@Drexel. The Java applets were configured from Java Components for Math,  developed by David Eck under NSF grant number DUE-9950473.  Excel files were developed by David R. Hill at Temple University and Lila F. Roberts at Clayton State University.

Last updated 9/15/2010 DRH

Visitors since 10/4/2004