Skip to main content
v2026.11,986 entries · CC-BY 4.0

scipy fsolve: Guide to Nonlinear Equation Solving

Solve single and multi-variable nonlinear systems using scipy fsolve in Python, with Powell’s hybrid method, Jacobian acceleration, and diagnostic exit codes.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

Nonlinear algebraic equations arise across nearly every quantitative scientific discipline, from calculating chemical reaction equilibria and non-ideal thermodynamic states to determining operating points of semiconductor circuits and steady states of ecological dynamical systems. Because general nonlinear systems lack analytical closed-form solutions by the Abel-Ruffini theorem and the transcendental nature of nonlinear operators, computational researchers rely on robust numerical root-finding algorithms. In the Python scientific computing ecosystem, scipy.optimize.fsolve serves as the primary dedicated function for solving systems of nonlinear equations F(x) = 0. Built as a high-performance Python wrapper around the time-tested MINPACK Fortran library, fsolve implements Powell’s hybrid method to deliver rapid local convergence while maintaining numerical stability across complex parameter spaces.

While researchers preparing experimental data pipelines with pandas shift or generating empirical benchmark data via scikit-learn datasets often rely on high-level statistical tools, mechanistic modeling requires solving nonlinear balance laws directly. Understanding how fsolve operates, how to configure its numerical tolerances, when to provide analytical Jacobians, and how to interpret its diagnostic output enables scientists and computational analysts to build resilient simulation workflows that converge reliably.

What it is used for in research

In computational research, root finding refers to determining vector values x = [x₁, x₂, …, xₙ]ᵀ such that a set of N coupled nonlinear equations evaluates to zero:

F(x) = 0
[ f₁(x₁, x₂, ..., xₙ) ]   [ 0 ]
[ f₂(x₁, x₂, ..., xₙ) ] = [ 0 ]
[          ...        ]   [ 0 ]
[ fₙ(x₁, x₂, ..., xₙ) ]   [ 0 ]

This formulation differs fundamentally from scalar function minimization. In unconstrained mathematical optimization, an algorithm seeks a point that minimizes a scalar objective function min φ(x). In contrast, scipy.optimize.fsolve seeks exact simultaneous zero-crossings for multiple equations without requiring an underlying scalar energy potential. Common research applications include:

  • Chemical and Biochemical Equilibrium: Determining equilibrium species concentrations in complex aqueous solutions, biochemical reaction networks, and multi-phase combustion systems governed by nonlinear mass-action law equilibria and mass conservation balances.
  • Thermodynamic Equations of State: Computing specific volume or density from cubic equations of state (such as the Peng-Robinson, Soave-Redlich-Kwong, or Van der Waals equations) where pressure and temperature are specified experimental conditions.
  • Fluid Dynamics and Transport Phenomena: Solving implicit friction factor equations (such as the Colebrook-White equation for turbulent pipe flow) and boundary layer velocity balances.
  • Electrical and Circuit Engineering: Solving nonlinear operating point (DC bias) voltages in circuits containing diodes, bipolar junction transistors, and MOSFETs governed by exponential Shockley diode models.
  • Population Dynamics and Ecology: Calculating non-trivial steady-state equilibria in multi-species predator-prey systems and coupled Lotka-Volterra differential models setting time derivatives to zero.
  • Structural and Kinematic Mechanics: Resolving geometric closure equations in multi-link robotic mechanisms and nonlinear elastic beam deflections under multi-axial load.

The mathematical foundation powering fsolve is the Powell hybrid method (implemented in MINPACK’s hybrd and hybrj subroutines developed at Argonne National Laboratory by J. J. Moré, B. S. Garbow, and K. E. Hillstrom). Standard Newton-Raphson iterations exhibit quadratic convergence near a root but frequently diverge when initialized far from the solution or when the local Jacobian matrix becomes ill-conditioned. Conversely, steepest-descent gradient methods exhibit guaranteed descent toward a local minimum of the sum-of-squares residual ||F(x)||² but suffer from painfully slow linear convergence in narrow valleys. Powell’s hybrid method integrates both techniques within a trust-region framework (often termed a dogleg step). When the step predicted by the Newton-Raphson formulation lies within a trusted radius where local linear approximation is valid, the algorithm takes the full Newton step. When the Newton step falls outside the trust region, the algorithm takes a truncated step along a hybrid direction blending steepest descent and Newton correction, dynamically updating the trust radius based on actual versus predicted residual reduction. The data table below compares the algorithmic properties of multivariate root solvers across scientific computing environments.

Install or access (official source only)

The scipy.optimize.fsolve function is part of the core scipy library. SciPy is distributed under the open-source BSD-3-Clause license and is officially distributed through the Python Package Index (PyPI) and the Conda packaging system.

To install SciPy using Python’s standard package manager from PyPI, execute the following command in your terminal or virtual environment:

pip install scipy

For research environments managed through Anaconda or Miniconda, install SciPy from the community-maintained conda-forge channel to ensure binary compatibility with scientific BLAS/LAPACK backends:

conda install scipy -c conda-forge

SciPy requires NumPy as an explicit foundational dependency. When installing SciPy, NumPy is resolved and installed automatically. To verify the installation and inspect the installed version, run the following verification command from your shell:

python -c "import scipy; import numpy; print('SciPy version:', scipy.__version__); print('NumPy version:', numpy.__version__)"

Once installed, import fsolve directly from the optimization subpackage:

from scipy.optimize import fsolve

Step-by-step task (numbered, with menu names or commands exactly as in the current docs)

To demonstrate a rigorous research task, we examine a coupled two-reaction chemical equilibrium system. Consider two simultaneous gas-phase reactions occurring in a rigid reaction vessel at constant temperature and pressure:

  1. Reaction 1: A + B ⇌ C with equilibrium constant K₁
  2. Reaction 2: 2B + D ⇌ E with equilibrium constant K₂

Let x₁ and x₂ represent the extents of reaction (in moles) for Reaction 1 and Reaction 2, respectively. If initial mole charges are n_A0, n_B0, and n_D0 (with zero initial moles of products C and E), the instantaneous quantities at equilibrium are:

  • n_A = n_A0 – x₁
  • n_B = n_B0 – x₁ – 2x₂
  • n_C = x₁
  • n_D = n_D0 – x₂
  • n_E = x₂
  • Total moles n_tot = (n_A0 + n_B0 + n_D0) – x₁ – 2x₂

The thermodynamic equilibrium relations governed by mole fractions y_i = n_i / n_tot at total pressure P (in atmospheres) yield two coupled nonlinear equations that must simultaneously equal zero:

F₁(x₁, x₂) = (x₁ / n_tot) - K₁ * ((n_A0 - x₁) / n_tot) * ((n_B0 - x₁ - 2*x₂) / n_tot) * P = 0
F₂(x₁, x₂) = (x₂ / n_tot) - K₂ * ((n_B0 - x₁ - 2*x₂) / n_tot)² * ((n_D0 - x₂) / n_tot) * P² = 0

Step 1: Formulate the system in standard zero-residual form

The fundamental prerequisite of scipy.optimize.fsolve is that all governing equations must be rearranged into the standard form F(x) = 0. Unlike symbolic algebra packages or general algebraic modeling systems, fsolve evaluates numerical residuals directly. If an equation is written as g(x) = h(x), subtract the right-hand side to define the residual component f_i(x) = g(x) – h(x) = 0. Ensure that the number of equations matches the number of unknown variables exactly (N equations for N unknowns), as fsolve requires a square system.

Step 2: Implement the objective vector function in Python

Create a Python callable that takes the unknown vector x as its first argument and returns an array-like sequence of residuals of the identical length. To keep code clean and maintainable, avoid hardcoding physical constants inside the function body:

import numpy as np
from scipy.optimize import fsolve

def equilibrium_residuals(x, params):
    x1, x2 = x
    K1 = params['K1']
    K2 = params['K2']
    nA0 = params['nA0']
    nB0 = params['nB0']
    nD0 = params['nD0']
    P = params['P']
    
    # Calculate equilibrium molar amounts
    nA = nA0 - x1
    nB = nB0 - x1 - 2.0 * x2
    nC = x1
    nD = nD0 - x2
    nE = x2
    
    ntot = nA + nB + nC + nD + nE
    
    # Compute mole fractions
    yA = nA / ntot
    yB = nB / ntot
    yC = nC / ntot
    yD = nD / ntot
    yE = nE / ntot
    
    # Equilibrium equations: yC - K1 * yA * yB * P = 0
    #                        yE - K2 * (yB**2) * yD * (P**2) = 0
    res1 = yC - K1 * yA * yB * P
    res2 = yE - K2 * (yB**2) * yD * (P**2)
    
    return [res1, res2]

Step 3: Pass external research parameters via args

Scientific workflows frequently require solving the same governing equations across temperature series, pressure sweeps, or parameter grids. The args parameter of fsolve accepts a tuple of additional positional arguments that are passed directly into your objective function immediately following the state vector x:

# Define experimental parameters
experimental_conditions = {
    'K1': 2.50,      # Equilibrium constant for Reaction 1 (atm^-1)
    'K2': 1.80,      # Equilibrium constant for Reaction 2 (atm^-2)
    'nA0': 1.00,     # Initial moles of reactant A
    'nB0': 2.50,     # Initial moles of reactant B
    'nD0': 0.80,     # Initial moles of reactant D
    'P': 5.00        # Total system pressure (atm)
}

# Initial estimate for [x1, x2]
x_initial = [0.2, 0.2]

# Solve using args tuple
solution = fsolve(equilibrium_residuals, x_initial, args=(experimental_conditions,))
print("Computed reaction extents [x1, x2]:", solution)

Step 4: Supply an analytical Jacobian with fprime

By default, fsolve invokes MINPACK’s hybrd subroutine, which approximates the N × N Jacobian matrix J_ij = ∂f_i / ∂x_j using forward finite differences. For an N-dimensional problem, numerical approximation requires N additional function evaluations at each iteration. For computationally demanding physics or chemistry models, providing an analytical Jacobian via the fprime argument invokes MINPACK’s hybrj subroutine, drastically reducing runtime and eliminating numerical differentiation truncation error.

By default, fprime expects the Jacobian matrix to be organized across rows, such that entry [i, j] represents ∂f_i / ∂x_j. If you compute derivatives column-wise, pass col_deriv=True to prevent internal matrix transpositions:

def equilibrium_jacobian(x, params):
    x1, x2 = x
    # Analytical Jacobian matrix calculation across rows
    # Perturbation or explicit algebraic partial derivatives
    eps = 1e-7
    base_res = np.array(equilibrium_residuals(x, params))
    
    res_x1 = np.array(equilibrium_residuals([x1 + eps, x2], params))
    dF_dx1 = (res_x1 - base_res) / eps
    
    res_x2 = np.array(equilibrium_residuals([x1, x2 + eps], params))
    dF_dx2 = (res_x2 - base_res) / eps
    
    # 2x2 Jacobian matrix across rows
    return np.column_stack([dF_dx1, dF_dx2])

# Execute fsolve with explicit Jacobian function
solution_with_jac = fsolve(
    equilibrium_residuals,
    x_initial,
    args=(experimental_conditions,),
    fprime=equilibrium_jacobian
)
print("Solution with analytical Jacobian:", solution_with_jac)

Step 5: Execute fsolve and inspect convergence diagnostics

In production computational workflows, never assume that fsolve succeeded without programmatically inspecting its convergence status. Calling fsolve with full_output=True causes the function to return a four-element tuple: (x, infodict, ier, mesg):

x_solution, infodict, ier, mesg = fsolve(
    equilibrium_residuals,
    x_initial,
    args=(experimental_conditions,),
    full_output=True,
    xtol=1.49e-8
)

print(f"Convergence flag (ier): {ier}")
print(f"Status message: {mesg}")
print(f"Total function evaluations: {infodict['nfev']}")
print(f"Final residual vector: {infodict['fvec']}")
print(f"Norm of residual: {np.linalg.norm(infodict['fvec']):.3e}")

Output and how to read it

When called with default options (full_output=False), fsolve returns a NumPy array containing the estimated root vector x. If the system consists of a single equation, fsolve still returns an array with one element (e.g., array([0.4821])), which should be unpacked using index notation x[0].

When called with full_output=True, the returned tuple provides exhaustive diagnostic telemetry that is essential for scientific validation:

  • x (ndarray): The final solution vector approximating the root of the equation system.
  • infodict (dict): An informational dictionary containing internal MINPACK execution state:
    • nfev: An integer indicating the total count of function calls made to func. If fprime was omitted, this includes the N calls per iteration required to construct numerical Jacobian columns.
    • njev: An integer recording how many times the analytical Jacobian function fprime was evaluated (present when fprime is supplied).
    • fvec: A 1D NumPy array containing the function residuals evaluated at the final vector x, representing F(x). For a true mathematical root, every component of fvec must fall within machine precision of zero.
    • fjac: The orthogonal matrix Q produced by the QR factorization of the final approximate Jacobian matrix, stored column-wise. The upper triangular factor R is packed in the companion r vector.
    • qtf: A 1D array representing the vector product Qᵀ · fvec. When an algorithm converges to a stationary point that is not a root, qtf reveals the projection of the residual along the tangent subspace.
  • ier (int): An integer exit status flag originating directly from MINPACK’s convergence logic:
    • ier = 1: Successful convergence. The relative error between two consecutive iterates is at most xtol, and residuals meet required precision. The result is valid for downstream research analysis.
    • ier = 2: Iteration limit exceeded. The maximum allowable number of function calls (maxfev) was reached before satisfying convergence tolerances. The returned vector represents the algorithm’s last state, which is not guaranteed to be a valid root.
    • ier = 3: Tolerance too small. The requested relative tolerance xtol is too strict for the floating-point precision of the host machine (IEEE 754 double precision), preventing further numerical progress.
    • ier = 4: Iteration stalled / orthogonal residuals. The iteration is not making good progress. Mathematically, the residual vector fvec is orthogonal to the columns of the Jacobian matrix within machine precision. This occurs when the solver becomes trapped near a local minimum of the sum-of-squares residual or near a saddle point rather than finding a true root.
    • ier = 5: Slow convergence progress. The algorithm exhausted its iteration allowance because consecutive steps produced negligible improvements in residual reduction.
  • mesg (str): A human-readable text string summarizing the exit condition corresponding to the integer flag ier.

In automated scientific pipelines, always verify that ier == 1 and that np.all(np.abs(infodict['fvec']) < tolerance) before storing computed values in research databases or proceeding to downstream simulation stages.

Troubleshooting

Because nonlinear systems can have multiple solutions, isolated roots, or no real roots at all, scipy.optimize.fsolve may encounter convergence difficulties. Below are standard diagnosis and remedy patterns for common numerical issues:

1. “RuntimeWarning: The iteration is not making good progress” (ier = 4 or 5)

This warning occurs when Powell’s hybrid method cannot identify a descent direction that reduces the sum-of-squares residual. The algorithm has landed in a region where the gradient of ||F(x)||² vanishes or is orthogonal to the Jacobian columns.

Remedies:

  • Shift the initial guess (x₀): Local gradient-based methods are sensitive to the starting point. If x₀ is placed in an unphysical region (such as negative chemical concentrations or negative absolute temperatures), the solver may diverge. Implement a multi-start grid search across plausible physical bounds to find a starting point inside the basin of attraction.
  • Scale the variables with diag: If your system combines variables with vastly different magnitudes (e.g., pressure measured in 10⁵ Pa and molar concentration in 10⁻³ mol/L), the Jacobian becomes severely ill-conditioned. Provide positive diagonal scaling entries via the diag parameter, or non-dimensionalize the equations prior to solving.

2. “Result exceeded maxfev evaluations” (ier = 2)

By default, fsolve sets the evaluation limit to maxfev = 100 * (N + 1), where N is the number of variables. For stiff, highly nonlinear equations, this default limit may be exhausted before convergence is reached.

Remedy: Explicitly increase the evaluation threshold by passing maxfev=2000 or maxfev=5000. If evaluations continue to max out without convergence, examine the analytical Jacobian using fprime to avoid numerical differentiation noise.

3. Root falls outside physical or domain boundaries

scipy.optimize.fsolve is an unconstrained nonlinear solver; it does not support parameter bounds (such as x_i ≥ 0). When modeling physical systems, unconstrained iterations may drift into unphysical regimes where functions become undefined (e.g., taking the logarithm or square root of a negative quantity).

Remedies:

  • Variable transformations: Reparameterize the variables. For example, if variable x must strictly remain positive (x > 0), define an auxiliary unconstrained variable u such that x = exp(u) or x = u². Substitute this transformation into the objective function so fsolve iterates over u in (-∞, ∞) while x remains strictly positive.
  • Switch to bounded least-squares: If transformations complicate the system, use scipy.optimize.least_squares. Setting method='trf' (Trust Region Reflective) allows explicit lower and upper bounds via bounds=(lower_bounds, upper_bounds) while minimizing the sum-of-squares residual toward zero.

4. Rectangular or non-square equation systems (M ≠ N)

If you have more equations than unknowns (M > N, an overdetermined system) or fewer equations than unknowns (M < N, an underdetermined system), fsolve will raise a ValueError or fail to compute the QR decomposition because MINPACK’s hybrd routine strictly requires square systems (M = N).

Remedy: For overdetermined systems seeking a minimum residual solution, use scipy.optimize.root(..., method='lm') or scipy.optimize.least_squares, which employ the Levenberg-Marquardt algorithm designed for rectangular matrices.

Free alternatives (table)

Depending on problem dimensionality, sparsity, and analytical requirements, researchers can choose among several open-source numerical and symbolic tools. The table below details free, open-source alternatives to scipy.optimize.fsolve:

Tool / Function Ecosystem / Language Primary Method / Algorithm Key Strengths in Research Limitations & Constraints
scipy.optimize.root Python (SciPy) Unified dispatch (‘hybr’, ‘lm’, ‘broyden1’, ‘krylov’, ‘df-sane’) Modern unified API; returns structured OptimizeResult object; supports large-scale sparse systems via Krylov methods. Does not enforce inequality bounds across all methods; requires square systems for most solvers except Levenberg-Marquardt.
scipy.optimize.least_squares Python (SciPy) Trust Region Reflective (‘trf’), Dogbox, Levenberg-Marquardt Native support for hard parameter box bounds (bounds=(lb, ub)); handles overdetermined systems (M ≥ N); robust loss functions. Minimizes sum-of-squares residual rather than solving exact equations; convergence is slower on square smooth systems than Powell hybrid.
SymPy (nsolve / nonlinsolve) Python (SymPy) Symbolic Gröbner bases and arbitrary-precision mpmath Newton solver Finds exact closed-form algebraic solutions when feasible; arbitrary precision arithmetic prevents floating-point cancellation. Extremely slow on large coupled systems; cannot solve arbitrary transcendental equations analytically.
GNU Octave fsolve Octave / MATLAB script Powell hybrid method and modified Levenberg-Marquardt Drop-in open-source compatibility for researchers porting workflows from the commercial MATLAB equation solver environment; interactive command shell. Interpreted language execution speed can be slower than compiled Cython backends; limited integration with Python machine learning pipelines.
NLsolve.jl Julia Newton-Raphson, Anderson acceleration, Trust-region Dogleg Native Julia just-in-time (JIT) compilation; automatic differentiation support via ForwardDiff.jl; exceptional performance on large systems. Requires Julia runtime environment; smaller ecosystem of data handling libraries compared to Python.
nleqslv R Package Broyden secant and Newton methods with line search or trust region Seamless integration with R statistical modeling pipelines, bioinformatics packages, and Bioconductor tools. Primarily suited for R environments; limited scaling for extremely large sparse structural systems.

Researchers transitioning between computational ecosystems will find that GNU Octave’s syntax closely mirrors MATLAB matrix paradigms, as detailed in our guide to MATLAB operations, while dynamic time-stepping simulations often couple nonlinear algebraic solvers with ordinary differential equation integrators, comparable to procedures described in our guide on projectile motion in MATLAB.

FAQ

What is the difference between scipy.optimize.fsolve and scipy.optimize.root?

scipy.optimize.fsolve is a legacy wrapper specifically tailored to MINPACK’s hybrd and hybrj Powell hybrid routines. In modern SciPy, scipy.optimize.root provides a unified, standardized interface for multivariate root finding. Calling scipy.optimize.root(func, x0, method='hybr') invokes the exact same underlying MINPACK code as fsolve, but returns an OptimizeResult object with consistent attributes (such as .x, .success, .status, and .fun). For new Python codebases, the SciPy documentation recommends scipy.optimize.root because it allows users to switch between alternative solver algorithms (such as Levenberg-Marquardt or Krylov subspace methods) without altering the call signature.

Can scipy fsolve handle bounded systems or inequality constraints?

No. scipy.optimize.fsolve is an unconstrained root solver and does not provide an argument for parameter bounds. If your equations require variables to remain within specific intervals (e.g., positive concentrations or bounded temperatures), you must either reparameterize the problem using nonlinear mathematical transformations (such as substituting x = exp(u) to enforce x > 0) or transition to scipy.optimize.least_squares, which natively supports box bounds via the bounds=(lower, upper) parameter under the Trust Region Reflective (trf) algorithm.

Why does fsolve return a solution that does not equal zero?

If fsolve returns a vector x where the residuals F(x) are far from zero, the solver has failed to converge. This commonly occurs when the solver reaches its maximum iteration limit (ier = 2) or becomes trapped in a local minimum of the sum-of-squares residual where the gradient is orthogonal to the residual vector (ier = 4). To prevent false convergence reporting, always call fsolve with full_output=True and programmatically verify that ier == 1 and that np.all(np.abs(infodict['fvec']) < tolerance).

How do I pass multiple additional arguments to the objective function in fsolve?

Additional arguments must be bundled into a tuple and supplied to the args keyword parameter. For example, if your objective function is defined as def model(x, a, b, c):, execute fsolve as fsolve(model, x0, args=(a, b, c)). If passing a single parameter, such as a dictionary or a NumPy array, remember to include a trailing comma in the tuple: args=(param_dict,). The elements in the tuple are passed to both the objective function func and the Jacobian function fprime in identical order.

What does ier = 4 mean in fsolve diagnostic output?

The integer flag ier = 4 indicates that the solver stalled because the vector of function residuals fvec is orthogonal to the columns of the Jacobian matrix within machine precision. In geometric terms, this means that the local linear approximation cannot identify any step direction that reduces the residual magnitude. This situation typically arises when the initial guess x₀ is situated near a saddle point, an inflection point, or a local minimum of ||F(x)||² that does not correspond to a true mathematical zero. To resolve this, restart the solver from an alternative initial estimate x₀ or provide an analytical Jacobian matrix via fprime.

How does fsolve compute the Jacobian if I do not provide fprime?

When the fprime parameter is left as None, fsolve calls MINPACK’s hybrd subroutine, which calculates the Jacobian matrix using forward finite differences. For each iteration, the solver evaluates the base residual F(x) and then perturbs each variable x_j by a small step length determined by the parameter epsfcn (defaulting to the square root of machine precision, ≈ 1.49 × 10⁻⁸). Because this requires N additional function evaluations per iteration, supplying an exact analytical derivative function via fprime substantially accelerates convergence on complex, multi-dimensional research models.

Sources (official docs)

The algorithmic specifications and parameter behaviors documented in this guide are derived from the following official scientific computing standards and primary documentation:

Data: Multivariate Root Solvers and Nonlinear Algorithm Specifications in Scientific Computing

Algorithmic properties, convergence orders, Jacobian requirements, and system dimensionality profiles for nonlinear equation solvers compiled from official SciPy and MINPACK documentation.

Period covered: 2026.

Multivariate Root Solvers and Nonlinear Algorithm Specifications in Scientific Computing
Solver RoutineUnderlying LibraryMathematical AlgorithmJacobian RequirementSystem Dimensionality FormLocal Convergence Rate
scipy.optimize.fsolveMINPACK (hybrd / hybrj)Powell Hybrid (Newton step with trust-region dogleg and gradient descent)Optional analytical Jacobian via fprime; forward-difference fallbackSquare systems only (N equations = N unknowns)Superlinear to Quadratic
scipy.optimize.root (hybr)MINPACK (hybrd / hybrj)Powell Hybrid (modified MINPACK implementation with OptimizeResult interface)Optional analytical Jacobian via jac=True; forward-difference fallbackSquare systems only (N equations = N unknowns)Superlinear to Quadratic
scipy.optimize.root (lm)MINPACK (lmdif / lmder)Levenberg-Marquardt (damped least-squares trust-region method)Optional analytical Jacobian via jac=True; numerical fallbackRectangular or square systems (M equations >= N unknowns)Quadratic
scipy.optimize.root (broyden1)SciPy Native Python/CythonBroyden First Method (quasi-Newton with rank-one secular update)Derivative-free secant approximation; no user Jacobian requiredSquare systems only (N equations = N unknowns)Superlinear
scipy.optimize.root (krylov)SciPy Native Python/CythonInexact Newton-Krylov (GMRES linear subproblem iterations)Approximated via directional Jacobian-vector products (matrix-free)Large-scale square systems (sparse or high dimension)Superlinear
scipy.optimize.root (df-sane)SciPy Native Python/CythonDerivative-Free Spectral Approach for Nonlinear EquationsStrictly derivative-free; requires no Jacobian evaluation or storageSquare systems; well-suited for non-smooth or expensive evaluationsSuperlinear

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about scipy fsolve: Guide to Nonlinear Equation Solving

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →