acalculator

What are the critical numbers of f?

Type a function of x. The page finds its critical numbers, where the derivative is 0 or does not exist, and says which are local maxima, local minima, or neither.

Your numbers

Use x, + - * / ^, pi, e, sqrt, ln, sin, cos, tan.
Critical numbers
-1 (local maximum), 3 (local minimum)

The critical numbers of x^3 - 3x^2 - 9x - 1 are -1 (local maximum), 3 (local minimum).

f′(x) =
3x^2 - 6x - 9

Critical numbers: -1 (local maximum), 3 (local minimum). The critical numbers of x^3 - 3x^2 - 9x - 1 are -1 (local maximum), 3 (local minimum).

How to calculate

Finds every critical number of f, where f′ is 0 or does not exist, and which are maxima or minima.

Example with the default inputs (Function f(x) x^3 - 3x^2 - 9x - 1): The critical numbers of x^3 - 3x^2 - 9x - 1 are -1 (local maximum), 3 (local minimum).

Method: c is a critical number when f(c) is defined and f′(c) is 0 or does not exist. The sign of f′ on each side tells a maximum from a minimum.

  • x in radians; ln is the natural logarithm.
  • Points searched for in ±10^6.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Function f(x) x^3 - 3x^2 - 9x - 1 gives Critical numbers -1 (local maximum), 3 (local minimum).Source: OpenStax (Strang and Herman, 2016), Calculus Volume 1, section 4.5 Derivatives and the Shape of a Graph, Example 4.17
  2. Function f(x) 5x^(1/3) - x^(5/3) gives Critical numbers -1 (local minimum), 0 (f′ does not exist; neither), 1 (local maximum).Source: OpenStax (Strang and Herman, 2016), Calculus Volume 1, section 4.5 Derivatives and the Shape of a Graph, Example 4.18
  3. Function f(x) x^5 - 5x^3 gives Critical numbers -sqrt(3) (local maximum), 0 (neither), sqrt(3) (local minimum).Source: OpenStax (Strang and Herman, 2016), Calculus Volume 1, section 4.5 Derivatives and the Shape of a Graph, Example 4.20

How it works

A critical number of f is a number c inside the domain of f where f′(c) = 0 or f′(c) does not exist.

  1. A computer algebra system (nerdamer, open source) finds f′ (checked against a numeric difference quotient at 20 points, to 1 part in a million). The algebra runs in the background after you start typing.
  2. The zeros and breaks of g = f′ are found between −∞ and ∞, as described below. When the algebra writes f′ as 0 (a constant f), every x is a critical number and the page gives no answer (too many points to check).
  3. Jumps at |u| = 0. For each |u| in f′, the zeros of u are found on the same grid (without the algebra). At such a zero x, f′ may jump without changing sign, as (x − 1)/|x − 1| + 2x does at 1. With s = max(1, |x|) and J(d) = |f′(x + d s) − f′(x − d s)|, x is a break (f′ does not exist) when J(10⁻¹⁰) is over J(10⁻⁸)/2 + 10⁻¹² × |f′(x + 10⁻⁸ s)|: the jump does not shrink as the gap does. A point already found (within 10⁻⁸ s) is not added twice. If f′ changes sign on one side between 10⁻¹⁰ s and 10⁻⁴ s from x, a critical number sits right next to it (x²/2 + 10⁻⁸ ln|x − 1| has one at about 0.99999999, beside 1), and the page gives no answer (two points are too close).
  4. A point c is kept only when it is inside the domain of f: f(c) is a real number, and f does not grow towards c: with h = 10⁻⁹ × max(1, |c|), |f(c + h)| ≤ 10 |f(c + 100h)| and |f(c − h)| ≤ 10 |f(c − 100h)|.
  5. First derivative test: with the signs of f′(c − h) and f′(c + h), c is a local minimum when they are − then +, a local maximum when + then −, and neither otherwise.

The page shows the Critical numbers in increasing order, each with what f has there, separated by commas: "−1 (local maximum), 3 (local minimum)". A break of f′ is marked "f′ does not exist": "0 (f′ does not exist; local maximum)". With none, the page says none. It also shows f′(x) as the algebra writes it.

How the points are found

The zeros and breaks of a function g (a zero: g passes through or touches 0; a break: g jumps, goes to ±∞, or stops being a real number) are found between two ends −∞ and ∞ (for g = f′) (each end clipped to ±10⁶) in two ways at once.

By the algebra. The computer algebra system solves g(x) = 0. A solution is an exact candidate when it is a number strictly between the ends, is not a rounded number (a whole number past 2⁵³; a fraction p/q, p and q being the numbers that multiply its top and its bottom, such as 288557167/(342919925e), when q after removing its factors 2 and 5 is over 1,000,000, or is over 1 while |p| times it is over 10¹²; or a decimal with more than 12 significant digits), and g is 0 there up to rounding: |g(c)| is at most 10⁻¹² times the sum of the sizes of the terms of g at c (the parts of g joined by + and −). So x² + 10⁻²⁰ has no zero at 0, though the algebra gives one.

On a grid. g is worked out at 8,001 points x₀ to x₈₀₀₀, evenly spaced in asinh x (so they reach ±10⁶ when an end is infinite and bunch up near 0): xᵢ = sinh(u₀ + (u₁ − u₀)(i + 0.3183)/8001), with u₀ = asinh(−10⁶) and u₁ = asinh(10⁶). For each step from xᵢ to xᵢ₊₁:

  • If g is a number at one end of the step and not a number at the other (as ln or √ of a negative number is not), the point where it stops being one is found by halving the step 80 times: a break. A value past the largest computer number, about 1.8 × 10³⁰⁸, still counts as a number with its sign (x e^(−x) and its derivatives for x below about −703), so an overflow is not a break. But when |g| is over 10³⁰⁰ at the end where g is a number (e^x − e^(2x) near x = 355, where e^(2x) overflows and the difference is not a number), the page cannot tell an overflow from the end of the domain and gives no answer (a value is too large).
  • If g has opposite signs at the two ends, the sign change is found by halving 80 times. It is a zero if |g| there is at most 10⁻⁶ of the larger of |g(xᵢ)| and |g(xᵢ₊₁)|, and a break otherwise (g jumps or goes through ±∞). If g is past the largest computer number at either end, the page gives no answer (a value is too large).
  • If g has one sign at xᵢ, xᵢ₊₁ and xᵢ₊₂ and turns at xᵢ₊₁ (a peak or a dip), the turning point r is found by halving (on the sign of g(x + h) − g(x − h), h = 10⁻⁷ × max(1, |x|)). If g(r) has the other sign, g dips through 0 and back between xᵢ and xᵢ₊₂: two zeros too close together for the grid. Unless the algebra gives at least two exact candidates strictly between xᵢ and xᵢ₊₂ (then they are the zeros), the page gives no answer (two points are too close together). If |g(r)| is at most 10⁻⁹ of the larger of |g(xᵢ)| and |g(xᵢ₊₂)|, g touches 0 there: that is a zero when an exact candidate lies within 10⁻⁶ × max(1, |candidate|) of r, and otherwise the page says a zero could not be confirmed and gives no answer. If |g(r)| is over 10⁶ times that size (or not a number), g peaks through ±∞: a break. A reason to give no answer that turns up on the way (a dip, a touch the algebra does not confirm) is given only after the whole grid, so a function with more than 30 points (sin x) gets "too many points to check".

A zero found on the grid within 10⁻⁶ × max(1, |c|) of an exact candidate c takes its exact value and text; otherwise, when it is within 10⁻⁹ × max(1, |x|) of a fraction p/q with q = 1, 2, 3, 4, 6, 8 or 12 (the first that fits) where g is 0 up to rounding (the rule above), it is shown as p/q; otherwise as ≈ and a decimal to 10 significant figures (rounded half up). A break is shown exactly as p/q when x is within 10⁻⁹ × max(1, |x|) of p/q for q = 1, 2, 3, 4, 6, 8 or 12 (the first that fits) and g is not a real number at p/q or at p/q ± 10⁻⁹ × max(1, |x|) (a pole, a jump, or an end of the domain); otherwise as ≈ and a decimal. An exact candidate that the grid did not find (two zeros inside one step) is added. A zero right next to a pole, inside the same grid step, is found only when the algebra gives it. The same point found twice counts once (a zero before a break). Two different points within 10⁻⁶ × max(1, |x|) of each other give no answer (two points are too close together), and so do two exact candidates that close: x²(x − 10⁻⁷)² has critical numbers at 0, 5 × 10⁻⁸ and 10⁻⁷, which the page does not merge into one. More than 30 points gives no answer (too many points to check).

What you can type

  • A number has at most 15 digits in a row. A computer number keeps only about 16 digits, so a longer one (9007199254740993) would stand for a nearby number (9007199254740992), and the page asks for fewer digits instead. Write very large or very small numbers with a power of ten (1e-20).
  • The function f uses the variable x. Numbers can have decimals (2.5) and powers of ten (1e-3).
  • Operations: + − * / and ^ for powers. Brackets group. A number or bracket next to a letter multiplies: 2x, 3(x + 1), x sin(x).
  • Constants: pi (or π) and e.
  • Functions: sqrt, cbrt, ln (and log, the same natural logarithm), log10, exp, abs (or |x|), sin, cos, tan, sec, csc, cot, asin, acos, atan (arcsin, arccos, arctan also work), sinh, cosh, tanh and their inverses. Angles are in radians. sin x without brackets means sin(x); sin x^2 means sin(x²).

What gets no answer

  • More than 30 critical numbers (sin(x)), or a constant f (every x is critical).
  • Two critical numbers too close together to tell apart (see above), or a value past the largest computer number next to one.
  • A possible critical number where f′ touches 0 that the algebra does not confirm.
  • A step that fails its check, finds no formula, or takes over 3 seconds.

Worked examples by hand

f(x) = x³ − 3x² − 9x − 1 (OpenStax Calculus Volume 1, section 4.5, Example 4.17). f′(x) = 3x² − 6x − 9 = 3(x − 3)(x + 1), zero at −1 and 3. f′ is positive left of −1, negative between, positive right of 3: −1 is a local maximum and 3 a local minimum.

f(x) = 5x^(1/3) − x^(5/3) (OpenStax Calculus Volume 1, section 4.5, Example 4.18). f′(x) = (5/3)x^(−2/3) − (5/3)x^(2/3) = 5(1 − x^(4/3))/(3x^(2/3)): zero at −1 and 1, and undefined at 0, where f(0) = 0. f′ is negative left of −1, positive between −1 and 1 on both sides of 0, and negative right of 1: −1 is a local minimum, 0 is neither (f′ does not exist there), and 1 is a local maximum.

f(x) = x⁵ − 5x³ (OpenStax Calculus Volume 1, section 4.5, Example 4.20). f′(x) = 5x⁴ − 15x² = 5x²(x² − 3), zero at −√3, 0 and √3. f′ is positive left of −√3, negative on both sides of 0, and positive right of √3: −√3 is a local maximum, 0 is neither, √3 is a local minimum.

Other questions people ask

What is a critical number?

A number c inside the domain of f where f′(c) = 0 or f′(c) does not exist. At a critical number the graph has a horizontal tangent, a corner, or a vertical tangent. Local maxima and minima of a function can only happen at critical numbers.

How do I find critical numbers?

Differentiate f, then solve f′(x) = 0 and find where f′ is undefined, keeping only the x where f itself is defined. For f(x) = x³ − 3x² − 9x − 1: f′(x) = 3x² − 6x − 9 = 3(x − 3)(x + 1), which is 0 at x = −1 and x = 3.

Is every critical number a maximum or minimum?

No. By the first derivative test, c is a local minimum if f′ changes from negative to positive at c, a local maximum if it changes from positive to negative, and neither if the sign stays the same. For x³ the critical number 0 is neither: f′ = 3x² is positive on both sides.

Why is 0 a critical number of x^(2/3) (x − 5)?

Its derivative, (5x − 10)/(3x^(1/3)), does not exist at 0, while f(0) = 0 does. The graph has a sharp point (a cusp) there, and it is a local maximum. Points where f itself is undefined, such as 0 for 1/x, are not critical numbers.

Why does the page give no answer for sin(x)?

Its derivative cos(x) is 0 at infinitely many points, x = π/2 + kπ. The page lists at most 30 points, and says so when there are more.

How is the answer checked?

The derivative from the computer algebra system is compared with a numeric difference quotient at 20 points. The zeros are found both by the algebra and by a sign scan on a fine grid, so none is missed between them; a zero the algebra gives is checked by putting it back into f′.