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

# Solve Linear System Ax = b

> Solve the linear system Ax = b for x, where A is a square matrix and b is a vector. Uses LU decomposition with partial pivoting for numerical stability. Essential for portfolio optimization, computing implied parameters, solving equilibrium models, and inverting relationships. Returns the solution vector x. [Tier: BASIC, Credits: 1]



## OpenAPI

````yaml api-specs/numerical.json post /quantlib/numerical/linalg/solve
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/linalg/solve:
    post:
      tags:
        - quantlib-numerical
      summary: Solve Linear System Ax = b
      description: >-
        Solve the linear system Ax = b for x, where A is a square matrix and b
        is a vector. Uses LU decomposition with partial pivoting for numerical
        stability. Essential for portfolio optimization, computing implied
        parameters, solving equilibrium models, and inverting relationships.
        Returns the solution vector x. [Tier: BASIC, Credits: 1]
      operationId: linear_solve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - A
                - b
              properties:
                A:
                  type: array
                  items:
                    type: array
                    items:
                      type: number
                  description: Coefficient matrix (n × n, must be non-singular)
                  example:
                    - - 3
                      - 1
                    - - 1
                      - 2
                b:
                  type: array
                  items:
                    type: number
                  description: Right-hand side vector (n × 1)
                  example:
                    - 9
                    - 8
            example:
              A:
                - - 3
                  - 1
                - - 1
                  - 2
              b:
                - 9
                - 8
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      x:
                        type: array
                        items:
                          type: number
                        description: >-
                          Solution vector x (3×2 + 1×3 = 9, 1×2 + 2×3 = 8 → x =
                          [2, 3])
                        example:
                          - 2
                          - 3
              example:
                success: true
                data:
                  x:
                    - 2
                    - 3
        '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

````