Mathematics APIs

POST /++simplifyExprEq

This service endpoint simplifies a given mathematical equation formatted as MathJax LaTeX. It validates the subscription before proceeding with the simplification process.

Request Body:

The request body must be a JSON object containing the following parameter:

  • formula: A string representing the mathematical equation formatted as MathJax LaTeX to be simplified.

Example:

{
    "formula": "\\frac{a}{b} + \\frac{b}{a}"
}

Response:

The response will be a JSON object containing the simplified equation. If an error occurs, an error message will be returned.

Success Response:
  • Status Code: 200 OK
  • Body: JSON object with the simplified equation.

Example:

{
    "simplified": "\\frac{a^2 + b^2}{ab}"
}
Error Responses:
  • Status Code: 500
  • Body: JSON object with an error message.

Example:

{
    "error": "Unknown error <the error>" 
}

POST /++drawFormulaGraph

This API service generates an a graph as an image from a LaTeX formula provided in the request body.

You can only use variable \(x\) and \(y\) in the entered equation

Linear Equations:

  • \(ax+by+c=0\)

Quadratic Equations:

Cubic Equations:

  • \(y=ax^3+bx^2+cx+d\)

Exponential Equations:

  • \(y =a \cdot b^x\)

Trigonometric Equations:

  • \(y = \sin (x)\)
  • \(y = \cos (x)\)
  • \(y = \tan (x)\)

Endpoint

POST /++drawFormulaGraph

Request

Headers:
  • Content-Type: application/json
  • Accept: application/json
Body:

The request body should be a JSON object containing the LaTeX formula to be graphed.

{
    "formula": "your_latex_formula_here"
}
Parameters:
  • registration_id: The registration ID of the user (sent as a request parameter).
  • subscription_method: The method of subscription validation (sent as a request parameter).

Response

Success Response:
  • Status Code: 200 OK
  • Content-Type: application/json
  • Body:
    {
        "drawing": "iVBORw0KGgoAAAANSUhEUgAAArwAAAH0CAYAAADfWf7fAAAgAE…XzqxJigACCCCAAAIImBT4A+K2M0 ..."
    }
    
Error Responses:
  • Status Code: 500
  • Body: JSON object with an error message.

Example:

{
    "error": "Unknown error <the error>" 
}

POST ++solveAlgebricEquations

This API service solves a system of up to three algebraic equations provided in the request body in LaTex formula.  For example 

  • 3x -2y +1/2z = 0
  • 2x +3y -2z = 8
  • 1/2x -2y -12z = 8

Request

Headers:
  • Content-Type: application/json
  • Accept: application/json
Body:

The request body should be a JSON object containing up to three LaTeX formulas representing algebraic equations.

 
{
    "formula1": "your_first_latex_formula_here",
    "formula2": "your_second_latex_formula_here",
    "formula3": "your_third_latex_formula_here"  // Optional
}

Response

Success Response:

  • Status Code: 200 OK
  • Content-Type: application/json
  • Body:
    {
        "solution": {
            "x": "\frac12",
            "y": "3",
    "z": "2" } }
Error Responses:
  • Status Code: 500
  • Body: JSON object with an error message.

Example:

{
    "error": "Unknown error <the error>" 
}

 

 


Document Actions