Solve an equation for a variable

Solves an equation (use =) for a variable, with exact and decimal solutions. Without =, solves expression = 0.

Request

POSThttps://math-solver.p.apihiver.com/v1/solve

JSON object. Required: equation.

Request Body

Edit the values below to test different scenarios.

Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.

Language
Client
1curl --request POST \
2  --url https://math-solver.p.apihiver.com/v1/solve \
3  --header 'Accept: application/json' \
4  --header 'Content-Type: application/json' \
5  --header 'X-API-Key: YOUR_API_KEY' \
6  --data '{
7  "equation": "x^2 - 4 = 0"
8}'

Solve an equation for a variable: Math Solver API reference

Solves an equation (use `=`) for a variable, with exact and decimal solutions. Without `=`, solves `expression = 0`. This endpoint is part of the Math Solver API: Evaluate expressions, solve equations, and compute derivatives, integrals and simplifications — with exact and decimal answers.

Example response (200, application/json)

Success.

1{
2  "numeric": [
3    "-2.000000000",
4    "2.000000000"
5  ],
6  "equation": "x^2 - 4 = 0",
7  "variable": "x",
8  "solutions": [
9    "-2",
10    "2"
11  ]
12}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "equation: Field required"
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.