Classifying Critical Points Demo

This demo attempts to find and classify all of the critical points of a function and determine if there are any inflection points.

Specifically, given $f(x)$ (entered in a text box), this demo computes $f'(x)$ and $f''(x)$ and then attemps to solve $f'(x)=0$ and $f''(x)=0$ within a determined set of $x$ values (specified as $f(x)$'s domain). Once the critical points are determined, a number line (of sorts) is produced indicating if the derivative is positive or negative between the critical points. The same is done for the second derivative.

For example: "-2 +++ 0 --- 1 --- 3" would be printed out if $f(x)$'s domain is set as "(-2,3)" and $f(x)$ has critical points at $x=0$ and $1$ with $f(x)$ increasing for $-2 < x < 0$, decreasing for $0 < x < 1$, and decreasing for $1 < x < 3$. We might also then have a second derivative number line such that "-2 --- 2 +++ 3". This would indicate that $f(x)$ is concave down for $-2 < x < 2$ and concave up for $2 < x < 3$.

The demo also determines if (interior) critical points are mins, maxs, or neither. For example, a switch from increasing to decreasing at $x=a$ (such as "... +++ a --- ...") indicates that $x=a$ is a relative maximum. The second derivative test is also consulted (and the demo says whether it applies or not). The demo also determines if solutions of $f''(x)=0$ are inflection points or not by looking to see if we have a switch in concavity.

The plot displays $f(x)$ and its critical points (i.e. solutions of $f'(x)=0$) along with solutions of $f''(x)=0$ marked as green and red dots respectively. The plot's domain is automatically generated to include all discovered points of interest.

You may either select a built-in demo or enter an example of your own. Check boxes at the bottom of the demo determine whether a plot is displayed and whether to plot the derivatives or not. The plot's domain can be adjusted in the box provided at the bottom of the demo. If you change an entry, simply click outside the box to have Sage recompute the plots and displayed values.

WARNING: Sage's numerical solver is finicky. It will occasionally miss solutions of $f'(x)=0$ and $f''(x)=0$. In other words, be skeptical of the computed results. Also, if a critical point appears at the end of a domain (it is not an "interior" critical point or "interior" solution of $f''(x)=0$), my code does not attempt to classify it.

The computation above is powered by SageMath. The Sage code is embedded in this webpage's html file. To view the code instruct your browser to show you this page's source. For example, in Chrome, right-click and choose "View page source".