TheDocumentation 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.
/api/v1/newton/solve endpoint finds the optimum of a single-variable polynomial by applying the Newton-Raphson method to the first derivative f′(x). Starting from an initial guess x₀, each iteration refines the estimate using xₙ₊₁ = xₙ − f′(xₙ) / f″(xₙ) until convergence. The nature of the located critical point is verified using the second derivative f″(x).
Compared to the Bisection method, Newton-Raphson typically converges much faster (quadratically) but requires a good initial guess and a non-zero second derivative at the solution.
Request
POST /api/v1/newton/solve
Polynomial coefficients listed from highest to lowest degree. Must contain between 1 and 11 elements (degree 0 through 10). The array must not be all-zero.Examples:
[-1, 4, 0]→-x² + 4x[1, -6, 9, 0]→x³ - 6x² + 9x
Optimisation direction. Accepted values:
"max" or "min".Initial guess for the location of the critical point. The algorithm converges to the nearest root of
f′(x) from this starting value.Convergence tolerance on the step size
|xₙ₊₁ − xₙ|. Must be greater than 0 and at most 1.0.Maximum number of Newton-Raphson steps. Accepted range: 1–500.
Response
A successful call returns aNewtonResponse object.
Outcome of the solve. One of:
"optimal"— a critical point was found withintolerance."no_convergence"—max_iterationswas reached without satisfying the tolerance.
The x-coordinate of the located critical point.
null if the method did not converge.The function value
f(optimal_x). null if the method did not converge.Classification of the critical point:
"maximum", "minimum", or "inflection point". null if the method did not converge.true when the nature of the found point matches the requested goal.Actual number of Newton-Raphson iterations performed.
Step-by-step iteration table, one entry per Newton-Raphson step.
Human-readable string representation of
f(x) (e.g. "-x**2 + 4*x").Human-readable string representation of
f′(x) (e.g. "-2*x + 4").Human-readable string representation of
f″(x) (e.g. "-2").Human-readable summary of the result.
Example
Maximize f(x) = −x² + 4x starting fromx₀ = 0.
Coefficients from highest to lowest degree: [-1, 4, 0].
For a quadratic polynomial Newton-Raphson converges in a single iteration regardless of the starting point
x₀, because f′(x) is linear. For higher-degree polynomials, choose x₀ close to the expected critical point for reliable convergence.Health Check
GET /api/v1/newton/health
Returns a liveness confirmation for the Newton-Raphson Optimization service.