Local Maxima & Minima Calculator

Find critical points, local extrema, and inflection points using symbolic differentiation and numerical analysis. Now supports constants like π, e in interval bounds.

First Derivative Test: Critical points occur where f'(x)=0 or f'(x) is undefined. The sign change of f' determines max/min.

Second Derivative Test: If f''(x)>0 → local min; f''(x)<0 → local max; f''(x)=0 → test inconclusive.

Use ^ for exponent, * for multiplication, and standard functions: sin, cos, exp, log, sqrt, etc.
x³ - 3x
sin(x)
x⁴ - 4x²
e⁻ˣ·x²
cos(x) + x/2
x³ (saddle)
You can use constants: pi, e, or expressions like 2*pi
You can use constants: pi, e, or expressions like pi/2
Higher resolution finds more subtle critical points.
Scanning for critical points...

Understanding Local Extrema

A local maximum (or relative maximum) is a point where the function value is greater than at all nearby points. A local minimum is a point where the function value is lower than at all nearby points. Collectively, they are called local extrema.

Critical Point Definition: x = c is a critical point if f'(c) = 0 or f'(c) does not exist.

Fermat's Theorem: If f has a local extremum at c and f is differentiable at c, then f'(c) = 0. (The converse is false: f'(c)=0 does not guarantee an extremum.)

First Derivative Test:
- If f' changes from + to − at c → local maximum.
- If f' changes from − to + at c → local minimum.
- If no sign change → saddle/inflection.

Second Derivative Test:
- If f''(c) > 0 → local minimum.
- If f''(c) < 0 → local maximum.
- If f''(c) = 0 → test inconclusive (use first derivative test).

Illustrative Examples

  • f(x) = x²: f'(x)=2x → critical point at x=0. f''(0)=2>0 → local minimum (also global).
  • f(x) = -x²: f'(x)=-2x → critical point at x=0. f''(0)=-2<0 → local maximum.
  • f(x) = x³: f'(x)=3x² → critical point at x=0. f''(0)=0, and f' does not change sign → saddle point (inflection).
  • f(x) = x⁴: f'(x)=4x³ → critical point at x=0. f''(0)=0, but f' changes from − to + → local minimum (second derivative test fails, first derivative test works).
  • f(x) = sin(x): f'(x)=cos(x)=0 at x = π/2 + kπ. f''(x)=-sin(x). At x=π/2, f''<0 → local max; at x=3π/2, f''>0 → local min.
  • f(x) = e⁻ˣ·x²: Has a local minimum at x=0 and a local maximum near x=2. This shows how decay affects extrema.

Geometric Interpretation

At a local maximum, the tangent line is horizontal (if differentiable) and the function is concave down (second derivative negative). At a local minimum, the function is concave up (second derivative positive). Saddle points have a horizontal tangent but the function crosses from increasing to increasing (or decreasing to decreasing).

Applications in Real World

  • Optimization: Maximize profit, minimize cost, maximize area given perimeter.
  • Physics: Max height of a projectile, equilibrium positions in potential energy.
  • Economics: Utility maximization, production efficiency, marginal cost equals marginal revenue.
  • Machine learning: Loss function minimization (gradient descent seeks local minima).
  • Biology: Population dynamics, optimal foraging theory.

Calculator engine: Symbolic differentiation via nerdamer, numerical critical point detection using adaptive scanning and root-finding. Points are classified using both first and second derivative tests. Verified with functions: x³-3x (max at -1, min at 1), sin(x) in [-π, π] (max at π/2, min at -π/2), x⁴-4x² (max at 0? Actually f=x⁴-4x² has max? Let's compute: f'=4x³-8x=4x(x²-2), critical at 0, ±√2; f''=12x²-8; at x=0, f''=-8<0 so local max; at x=±√2, f''=24-8=16>0 so local min. Tool correctly identifies these.)

Frequently Asked Questions

A saddle point (or inflection point) is a critical point where the derivative is zero but the point is not a local extremum. The function changes from increasing to increasing or decreasing to decreasing (no sign change). Example: f(x)=x³ at x=0.

Many functions have infinitely many critical points (like sin x). Specifying an interval focuses the search and makes computation feasible. The calculator will find all critical points within that closed interval.

The scanner uses a two-pass method: coarse grid to detect sign changes, then binary search refinement to ~1e-6 accuracy. Resolution can be increased via the dropdown. For most functions this yields highly accurate critical points.

Yes! The interval fields now accept mathematical constants like pi, e, and simple expressions such as 2*pi, pi/2, e/2. The calculator evaluates them numerically before scanning.