> ## 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.

# Compute Numerical Derivative

> Calculate the numerical derivative of a built-in function at a given point using finite difference methods. Supports forward, backward, and central difference schemes. Central differences provide the most accurate approximation for smooth functions. Use this for estimating derivatives when analytical formulas are unavailable, computing sensitivities, or approximating Greeks in option pricing. [Tier: BASIC, Credits: 1]



## OpenAPI

````yaml api-specs/numerical.json post /quantlib/numerical/differentiation/derivative
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/differentiation/derivative:
    post:
      tags:
        - quantlib-numerical
      summary: Compute Numerical Derivative
      description: >-
        Calculate the numerical derivative of a built-in function at a given
        point using finite difference methods. Supports forward, backward, and
        central difference schemes. Central differences provide the most
        accurate approximation for smooth functions. Use this for estimating
        derivatives when analytical formulas are unavailable, computing
        sensitivities, or approximating Greeks in option pricing. [Tier: BASIC,
        Credits: 1]
      operationId: finite_diff_derivative
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - func_name
                - x
              properties:
                func_name:
                  type: string
                  description: Built-in function name to differentiate
                  enum:
                    - exp
                    - log
                    - sin
                    - cos
                    - sqrt
                    - tan
                    - x2
                    - x3
                  example: sin
                x:
                  type: number
                  description: Point at which to evaluate the derivative
                  example: 1.5708
                h:
                  type: number
                  description: >-
                    Step size for finite difference (smaller = more accurate but
                    less stable)
                  default: 1.e-7
                  example: 1.e-7
                method:
                  type: string
                  description: >-
                    Finite difference method: central (most accurate), forward,
                    or backward
                  enum:
                    - central
                    - forward
                    - backward
                  default: central
                  example: central
            example:
              func_name: sin
              x: 1.5708
              h: 1.e-7
              method: central
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      function:
                        type: string
                        description: The function that was differentiated
                        example: sin
                      x:
                        type: number
                        description: The point of evaluation
                        example: 1.5708
                      derivative:
                        type: number
                        description: The computed derivative value
                        example: 0
                      method:
                        type: string
                        description: The finite difference method used
                        example: central
              example:
                success: true
                data:
                  function: sin
                  x: 1.5708
                  derivative: 0
                  method: central
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientTierError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
      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

````