> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fincept.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Find Root of Scalar Function

> Find a root (zero) of a scalar function f(x) in the interval [a, b] where f(a) and f(b) have opposite signs. Methods: bisect (reliable, slow convergence), brent (optimal hybrid method, recommended), ridder (exponential convergence), secant (fast but requires good initial bracket). Essential for implied volatility calculation, yield-to-maturity solving, break-even analysis, and finding zeros in pricing equations. [Tier: BASIC, Credits: 1]



## OpenAPI

````yaml api-specs/numerical.json post /quantlib/numerical/roots/find-1d
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Numerical
  description: >-
    Numerical module endpoints for FinceptQuantLib API. The Numerical module
    (Basic Tier, 1 credit per request) provides comprehensive numerical methods
    including finite difference differentiation, Fast Fourier Transform (FFT),
    numerical integration (quadrature and Monte Carlo), interpolation methods
    (linear, cubic, spline), linear algebra operations (matrix decomposition,
    solving systems), ODE solvers, root finding algorithms, optimization
    methods, and nonlinear least squares fitting. Essential for quantitative
    analysis, scientific computing, and numerical model implementation.
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-numerical
    description: >-
      Numerical methods including differentiation, FFT, integration,
      interpolation, linear algebra, ODE solvers, root finding, and optimization
    x-displayName: Numerical
paths:
  /quantlib/numerical/roots/find-1d:
    post:
      tags:
        - quantlib-numerical
      summary: Find Root of Scalar Function
      description: >-
        Find a root (zero) of a scalar function f(x) in the interval [a, b]
        where f(a) and f(b) have opposite signs. Methods: bisect (reliable, slow
        convergence), brent (optimal hybrid method, recommended), ridder
        (exponential convergence), secant (fast but requires good initial
        bracket). Essential for implied volatility calculation,
        yield-to-maturity solving, break-even analysis, and finding zeros in
        pricing equations. [Tier: BASIC, Credits: 1]
      operationId: find_root_1d
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - func_name
                - a
                - b
              properties:
                func_name:
                  type: string
                  description: Built-in function or 'custom_poly' for polynomial
                  enum:
                    - sin
                    - cos
                    - exp_minus_2
                    - x2_minus_4
                    - custom_poly
                  example: x2_minus_4
                a:
                  type: number
                  description: Lower bound of search interval
                  example: 1
                b:
                  type: number
                  description: >-
                    Upper bound of search interval (f(a) and f(b) should have
                    opposite signs)
                  example: 3
                method:
                  type: string
                  description: Root-finding method
                  enum:
                    - bisect
                    - brent
                    - ridder
                    - secant
                  default: brent
                  example: brent
                tol:
                  type: number
                  description: Convergence tolerance (smaller = more accurate)
                  default: 1.e-12
                  example: 1.e-12
                poly_coeffs:
                  type: array
                  items:
                    type: number
                  description: >-
                    Polynomial coefficients [a0, a1, a2, ...] for a0 + a1*x +
                    a2*x^2 + ... (only for custom_poly)
                  example:
                    - -4
                    - 0
                    - 1
            example:
              func_name: x2_minus_4
              a: 1
              b: 3
              method: brent
              tol: 1.e-12
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      root:
                        type: number
                        description: The computed root (x^2 - 4 = 0 → x = 2.0)
                        example: 2
                      iterations:
                        type: integer
                        description: Number of iterations required
                        example: 8
                      converged:
                        type: boolean
                        description: Whether the method converged
                        example: true
                      function_value:
                        type: number
                        description: Function value at the root (should be near zero)
                        example: 1.3e-15
              example:
                success: true
                data:
                  root: 2
                  iterations: 8
                  converged: true
                  function_value: 1.3e-15
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientTierError'
        '422':
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientTierError:
      description: API tier insufficient for this endpoint
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Endpoint requires Basic tier or higher
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your key at
        https://api.fincept.in/auth/register

````