b2KIT

Optimization Visualizer

Find and visualize local/global maxima and minima of functions. Shows critical points, second derivative test, and constraint optimization.

Tested tool guide Tested browser tools Checked August 16, 2026

What Optimization Visualizer does, with a checked example

Optimization depends on both a function and its admissible domain. This visualizer graphs the function, identifies critical points, applies derivative information such as the second derivative test, and distinguishes local extrema from global maxima or minima. It can also examine optimization subject to constraints. The common mistake is treating every solution of f'(x) = 0 as an extremum. Such solutions are only candidates: a stationary point may be neither a maximum nor a minimum, while endpoints or constraint boundaries may contain the actual optimum.

Worked example

A concrete input and expected output from the current implementation.

Input

f(x) = x^2, with x in the real numbers

Expected output

Critical point: (0, 0). Since f'(x) = 2x, the only stationary point is x = 0. Since f''(x) = 2 > 0, it is a local minimum. It is also the global minimum, with minimum value 0. There is no global maximum over the real numbers.

The derivative vanishes only at x = 0, and the positive second derivative classifies that point as a local minimum. Because x^2 >= 0 for every real x and grows without bound, 0 is the global minimum and no maximum exists.

How the result is produced

1

Classifying critical points

For an unconstrained one-variable function, critical points are values where the first derivative is zero or does not exist while the function does. The sign of the second derivative can classify a stationary point: positive indicates a local minimum and negative a local maximum. A zero second derivative leaves the test inconclusive, so the point needs another check.

2

Comparing feasible candidates

Local extrema are judged against nearby feasible inputs; global extrema are judged against every input in the stated domain. In a constrained problem, only points satisfying the constraint are eligible. Interior critical points are not enough by themselves: boundary points and interval endpoints can supply the largest or smallest feasible value, so candidate values must be compared.

Good uses

  • Check the turning points of a polynomial and determine whether each one is a local maximum, local minimum, or neither.
  • Find absolute extrema on a specified interval while accounting for both interior critical points and the values at included endpoints.
  • Compare candidate objective values within a constraint, such as locating the highest or lowest feasible point along a curve.

Limits and checks

  • The declared domain is part of the problem. A point can be globally optimal on a closed interval but not over all real numbers, and an excluded endpoint cannot attain an extremum.
  • The second derivative test gives no conclusion when f'' = 0. Solving only f' = 0 can also miss nondifferentiable extrema, such as the minimum of |x| at 0.
  • The visible graph window is not proof of global behavior. A distant branch, narrow feature, constraint boundary, or unbounded direction may not be apparent in the displayed region.

Common questions

Does every local minimum also count as a global minimum?

No. A local minimum only beats nearby admissible values. To call it global, its value must be no larger than the value at every other point in the domain. A restricted interval may make one candidate global, while an unrestricted function may have lower values elsewhere or may approach a lower bound without attaining it.

Can the visualizer find an optimum subject to a constraint?

Yes, when the objective and constraint define a feasible set the tool can analyze. Interpret the result relative to that set, not the entire coordinate plane. A constrained optimum may occur on a boundary even where the unconstrained derivative conditions do not identify it. A missing or incorrect constraint therefore changes the optimization problem being answered.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools