The Science of Programming/Slippery Slopes

Contents

In Chapter X of CME, SPT states that the derivative (at a given point) can be viewed as the slope of the tangent to a curve (at that point). Let's use our software to examine slopes.

Consider parabolas of the form:

The h variable induces a rightward shift of the parabola if h is positive and a leftward shift if h is negative. The v variable induces an upward shift if positive and a downward shift if negative. Thus, these curves bottom out at the point . For and , we get:

Plotting the parabola yields:

We can see from the plot that when , the curve bottoms out and the tangent at the point should be horizontal, having a slope of zero. To the right of that point, the slope rises to the left, so the derivative in that area should be positive. To the left of the bottom point, the slope rises to the left, so the derivative in that area should be negative.

To confirm our intuition, we shall encode the parabola as a sum of terms: