Introduction
A cubic regression curve can bend in ways that a straight line or a parabola cannot. Depending on its coefficients, the fitted curve may rise, turn downward, then turn upward; it may have no turning points; or it may flatten momentarily without changing direction. Derivatives give a precise way to locate and classify these features.
The task here is to study the shape of the fitted cubic polynomial. Calculus describes changes in that fitted curve, not necessarily the behavior of every individual observation. A turning point in a fitted curve is an association described by the model; by itself, it is not evidence that changing the predictor causes a response change.
The Derivatives of a Fitted Cubic
Suppose the fitted cubic regression curve is
Here \(x\) is the predictor, \(\hat{y}\) is the fitted response, and \(b_0,b_1,b_2,b_3\) are the estimated coefficients. The corresponding regression model for observations can be written \(Y_i=\beta_0+\beta_1x_i+\beta_2x_i^2+\beta_3x_i^3+\varepsilon_i\). When the conditional mean follows this polynomial, the fitted curve estimates that mean. The usual regression assumptions concern how well the model describes the response and how errors behave; however, the algebraic derivative and classification of the fitted polynomial require no probability calculation.
Differentiate the fitted curve with respect to \(x\). The derivative gives its instantaneous slope at each predictor value. A stationary point is a value of \(x\) where this slope is zero.
The intercept \(b_0\) does not appear in either derivative because adding a constant shifts the whole curve vertically without changing its slopes or turning-point locations. The derivative has units of response per predictor unit; the second derivative has units of response per predictor unit squared.
Solving for and Classifying Stationary Points
When \(b_3\ne 0\), setting the first derivative equal to zero gives a quadratic equation:
The quadratic formula shows how many real stationary points are possible. Define the discriminant of this equation as \(D=(2b_2)^2-4(3b_3)(b_1)=4b_2^2-12b_1b_3\). If \(D>0\), there are two distinct real stationary points. If \(D=0\), there is one repeated real root. If \(D<0\), there are no real stationary points. A stationary point must also lie in a predictor range relevant to the data before it is useful for describing the observed fitted relationship.
At a stationary point, the second derivative often identifies the type of turning point. If \(\hat{y}''(x_0)<0\), the curve is locally concave down and \(x_0\) is a local maximum. If \(\hat{y}''(x_0)>0\), it is locally concave up and \(x_0\) is a local minimum. If the second derivative is zero, this test gives no classification; inspect the first derivative or predictions on both sides.
In the repeated-root case \(D=0\), the derivative can be written \(3b_3(x-x_0)^2\). It does not change sign as it passes through \(x_0\), so the curve does not turn there: the point is a stationary inflection rather than a local maximum or minimum. This also explains why a zero second derivative cannot, by itself, establish an extremum.
Worked Example: Two Turning Points in the Data Range
Suppose a hypothetical fitted model relates \(x\), hours of practice per week, to a performance score:
The observed predictor range is 0 to 5 hours per week. Find and classify the stationary points, then check the fitted predictions nearby.
Differentiate:
Setting the derivative to zero gives \(x=1\) and \(x=4\), both within the observed range. The second derivative is \(\hat{y}''(x)=-15+6x\). At \(x=1\), \(\hat{y}''(1)=-9\), so the curve has a local maximum. Its fitted score is \(20+12(1)-7.5(1)^2+(1)^3=25.5\) points. At \(x=4\), \(\hat{y}''(4)=9\), so the curve has a local minimum. Its fitted score is \(20+12(4)-7.5(4)^2+(4)^3=12\) points.
The nearby fitted predictions support these classifications: \(\hat{y}(0)=20\), \(\hat{y}(2)=22\), and \(\hat{y}(3)=15.5\), so the curve rises toward the peak near \(x=1\) and falls after it; \(\hat{y}(5)=17.5\), so it rises again after the low point near \(x=4\). The curve’s local maximum is also its highest fitted value over this particular range, but that conclusion uses the endpoint predictions as well as the local classification.
What the Discriminant Tells You
A cubic with nonzero \(b_3\) cannot have more than two distinct stationary points because its derivative is quadratic. The discriminant is a useful first check, but it is not a substitute for interpreting the roots in context: a mathematically real root could fall far outside the predictor values used to fit the model.
Worked Example: A Cubic with No Stationary Points
Consider the hypothetical fitted response \( \hat{y}=5+2x+x^2+x^3 \), where \(x\) is time in days and fitted response is a measurement in millimetres. Determine whether the curve has a stationary point.
The derivatives are \(\hat{y}'(x)=2+2x+3x^2\) and \(\hat{y}''(x)=2+6x\). For the derivative equation \(3x^2+2x+2=0\), the discriminant is \(D=2^2-4(3)(2)=4-24=-20\). Since \(D<0\), there are no real stationary points.
We can also verify that the slope is positive everywhere. The derivative quadratic opens upward and has its minimum at \(x=-2/(2\cdot3)=-1/3\). Its minimum value is \(2+2(-1/3)+3(-1/3)^2=2-2/3+1/3=5/3\), which is positive. Thus the fitted curve is increasing for all real \(x\), and in particular throughout any observed range. For example, its fitted predictions at \(x=-1,0,1\) days are \(3\), \(5\), and \(9\) mm, respectively, consistent with an increasing curve.
Worked Example: A Stationary Point That Is Not a Turning Point
Suppose a hypothetical fitted model is \(\hat{y}=4+12x-6x^2+x^3\), where \(x\) is a concentration in milligrams per litre and \(\hat{y}\) is a response in response units. Find the stationary point and decide whether it is a maximum or minimum.
The first derivative is \(\hat{y}'(x)=12-12x+3x^2=3(x-2)^2\), so the only stationary point is \(x=2\) mg/L. The second derivative is \(\hat{y}''(x)=-12+6x\), and \(\hat{y}''(2)=0\). The second-derivative test therefore does not classify the point.
Here the derivative is \(3(x-2)^2\), which is positive for every \(x\ne2\) and zero only at \(x=2\). The fitted curve is increasing on both sides, so it has neither a local maximum nor a local minimum there. The fitted value is \(\hat{y}(2)=4+12(2)-6(2)^2+(2)^3=12\) response units. Nearby predictions confirm the flattening without a turn: \(\hat{y}(1)=11\), \(\hat{y}(2)=12\), and \(\hat{y}(3)=13\). This is a stationary inflection point.
Using Plotted Predictions Carefully
A plot of fitted predictions across the observed predictor range is a practical check on the algebra. Mark each calculated stationary point, then compare the fitted curve immediately to its left and right. A local maximum should sit above nearby fitted predictions; a local minimum should sit below them. A stationary inflection may look momentarily flat while the curve continues in the same direction.
The plotted curve represents model predictions, not a smooth path through every observed response. Individual observations may lie above or below it because of residual variation. Use the derivative to calculate the location and the second derivative to classify it; use the plot to check the shape and judge whether the feature occurs where data were observed.
A local maximum or minimum is defined by nearby values, not by every value in the full predictor range. A local maximum can be lower than a fitted value at one of the range’s endpoints, for instance. To claim the largest or smallest fitted value over a bounded range, compare all interior stationary points with the fitted predictions at both endpoints.
Common Mistakes and Why the Distinction Matters
- Calling every derivative root a turning point. A repeated derivative root can be a stationary inflection. Check whether the slope changes sign or compare predictions on both sides.
- Using the first derivative to decide maximum versus minimum. Solving \(\hat{y}'(x)=0\) locates stationary points; the second derivative or nearby predictions classify them.
- Ignoring the predictor range. A root outside the range of observed \(x\)-values is not evidence of a turning point among the data. Avoid treating distant polynomial behavior as supported by the observed relationship.
- Confusing a local extremum with the largest or smallest prediction on the whole range. For a bounded range, also check the endpoints.
- Giving a turning point a causal interpretation. A fitted cubic describes a modeled relationship. Its turning point alone does not establish that manipulating \(x\) would cause the response to turn.
Turning points help summarize how a fitted cubic’s slope changes across predictor values. Their usefulness depends on both the calculation and its context: state the predictor and response units, report the fitted value at the point, and check whether it lies in a range where the curve is supported by observations. The calculated locations are based on estimated coefficients, so they are point estimates rather than guarantees about the exact turning points of an underlying relationship.
Check Your Understanding
Use derivatives and the fitted curve’s context to answer these questions.
- For \(\hat{y}=3+5x-4x^2+0.5x^3\), write the first and second derivatives.
- For a cubic with \(b_3\ne0\), what does a negative discriminant of the first-derivative equation tell you?
- At a stationary point, \(\hat{y}''(x_0)=7\). What kind of local extremum is indicated, and why?
- Explain why a repeated root of the first derivative need not be a local maximum or minimum.
- A stationary point lies outside the observed predictor range. What can a plot over the observed range tell you, and what should you avoid concluding?
- How would you check whether a local maximum is also the greatest fitted value over a bounded predictor range?