The Bisection method finds an optimal point of a single-variable polynomial by locating a root of its first derivative f′(x) = 0 within a user-supplied interval [a, b]. At each iteration the interval is halved: the midpoint m = (a + b) / 2 is evaluated, and the sub-interval whose endpoints bracket the zero-crossing of f′ is retained. Iteration continues until f′(m) falls within the requested tolerance or the interval width itself becomes negligibly small. Once the stationary point x* is found, the sign of f″(x*) determines whether it is a minimum, maximum, or saddle/inflection point.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/FabianeloV/Metodo-simplex/llms.txt
Use this file to discover all available pages before exploring further.
Polynomial Representation
The function is modelled as a polynomial of arbitrary degree. Coefficients are supplied from highest to lowest degree, following NumPy convention:coefficients | f(x) |
|---|---|
[-1, 4, 0] | −x² + 4x |
[1, -3, 2] | x² − 3x + 2 |
[1, 0, -4, 0, 3] | x⁴ − 4x² + 3 |
polyder function.
f′(a) and f′(b) must have opposite signs for bisection to guarantee a stationary point inside [a, b]. If they share the same sign the endpoint returns a 422 error — adjust the interval so that the derivative changes sign within it.
Endpoint
Request
Polynomial coefficients listed from highest to lowest degree. Must contain between 1 and 11 elements; the list must not be all zeros.Example:
[-1, 4, 0] encodes f(x) = −x² + 4x.Optimization direction:
"max" to find a maximum or "min" to find a minimum. The engine uses f″(x*) to classify the stationary point and reports whether it matches the requested goal.Left endpoint of the search interval. Must satisfy
a < b.Right endpoint of the search interval. Must satisfy
b > a.Convergence threshold. Iteration stops when |f′(midpoint)| < tolerance or the interval half-width < tolerance. Must be in the range (0, 1].
Maximum number of bisection steps. Must be between 1 and 500. The solver halts at this limit even if tolerance has not been reached.
Response
Always
"optimal" when the solver completes without error. Error conditions are returned as HTTP 422 responses.The x-coordinate of the stationary point found by bisection.
The function value f(optimal_x) at the stationary point.
Classification of the stationary point based on f″(x*):
"mínimo"— local minimum (f″ > 0)."máximo"— local maximum (f″ < 0)."punto de inflexión"— saddle or inflection point (f″ ≈ 0).
true when the nature of the found point matches the requested goal. For example, goal = "max" with nature = "máximo" yields true.Total number of bisection iterations executed before convergence.
Step-by-step trace of the bisection process, one entry per iteration.
Human-readable string representation of f(x), e.g.
"-x² + 4x".Human-readable string representation of f′(x), e.g.
"-2x + 4".Narrative summary of the result, including the stationary point’s nature and whether the goal was satisfied. Also warns when a saddle/inflection point was found.
Example
Find the maximum of f(x) = −x² + 4x on [0, 4]:When
goal_satisfied is false, the solver still converges to the nearest stationary point — it simply doesn’t match the requested direction. This happens, for example, when the only stationary point inside [a, b] is a minimum but goal = "max" was requested. Check the interval bounds or switch the goal.