canonical: https://jentic.com/apis/newton.vercel.app/newton

# Newton API

Newton is a free, no-auth math micro-service that performs symbolic and numerical calculations from a string expression in the URL path. The 15 GET endpoints cover algebraic manipulation (simplify, factor), calculus (derive, integrate, area, tangent), root finding (zeroes), trigonometry (sin, cos, tan plus inverses), and basic functions (abs, log). Each endpoint takes the expression as a path parameter and returns a JSON object with the result.

## For AI agents

Compute symbolic math results - simplify, factor, derive, integrate, find zeroes, evaluate trig - from an expression in the URL path. No authentication required.

## Scope

Does not handle linear algebra, statistics, plotting, or LaTeX rendering - use for single-expression symbolic and numerical math operations only.

## Capabilities

- Simplify or factor an algebraic expression via GET `/simplify/{expression}` and GET `/factor/{expression}`
- Compute derivatives and integrals through GET `/derive/{expression}` and GET `/integrate/{expression}`
- Find roots and tangent lines of a function via GET `/zeroes/{expression}` and GET `/tangent/{expression}`
- Calculate the area under a curve with GET `/area/{expression}`
- Evaluate trigonometric and inverse-trig functions through GET /sin, /cos, /tan, /arcsin, /arccos, /arctan
- Compute absolute value and logarithm via GET `/abs/{expression}` and GET `/log/{expression}`

## Use cases

### Math Helper for Chat Agents

AI assistants embedded in chat surfaces forward math questions to Newton instead of computing them with a language model. The agent extracts the expression, calls the appropriate endpoint - GET /derive for derivatives, GET /factor for factoring - and returns the structured result. This avoids the well-known failure modes of language models doing arithmetic and gives a deterministic, citable answer.

Example prompt: Compute the derivative of 2x^3 + 5x by calling GET `/derive/2x`%5E3+5x and return the simplified result

### Homework and Tutoring Tool

Education platforms back their show-your-work tutoring features with Newton. The platform asks the student for an expression, sends it to GET /simplify or GET /factor, and renders the response next to the student's manual steps so they can compare. Because every operation is a single GET request with the expression in the URL, integration is trivial and the response is purely the math result with no extra metadata.

Example prompt: Show the factored form of x^2 - 9 by calling GET `/factor/x`%5E2-9 and display the result alongside the student's working

### Notebook and Spreadsheet Add-In

Productivity tools embed Newton calls in spreadsheet cells or notebook code so a non-coder can compute symbolic math without installing a CAS. A single HTTP call returns the integral or root, and because the API has no authentication and no rate-limit headers in the spec, lightweight scripts and educational tools can use it directly. For high-volume or commercial workloads a heavier engine is appropriate.

Example prompt: Compute the integral of x^2 from a notebook cell by calling GET `/integrate/x`%5E2 and return the antiderivative

### Agent-Assisted Math Reasoning

An AI agent uses Newton through Jentic to verify the math in its own reasoning chain. When the agent generates a step like 'so the derivative is 6x', it calls GET `/derive/{expression}` to confirm before continuing, catching arithmetic slips before they propagate. Jentic supplies the operation schemas so the agent picks the right endpoint per math type.

Example prompt: Before stating a derivative result, call GET /derive on the original expression and confirm the response matches the agent's stated answer

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/simplify/{expression}` | Simplify an algebraic expression |
| GET | `/factor/{expression}` | Factor a polynomial expression |
| GET | `/derive/{expression}` | Compute the derivative of an expression |
| GET | `/integrate/{expression}` | Compute the integral of an expression |
| GET | `/zeroes/{expression}` | Find roots of a function |
| GET | `/tangent/{expression}` | Find the tangent line |
| GET | `/area/{expression}` | Calculate the area under a curve |
| GET | `/log/{expression}` | Compute the logarithm of an expression |

## Key resources

- **Algebra** — Simplify and factor expressions
- **Calculus** — Derivatives, integrals, tangent lines, and area under curves
- **Roots** — Find zeroes of a function
- **Trigonometry** — Sine, cosine, tangent, and their inverses
- **Basic Functions** — Absolute value and logarithm

## Why Jentic

- **Setup:** Wiring Newton by hand means URL-encoding each math expression into the path, choosing among fifteen operation endpoints, and parsing the JSON result yourself. Through Jentic you install once, import the Newton API from the API Directory, and your agent calls it with no key to manage.
- **Permission scoping:** Newton is a public, unauthenticated math service with the expression in the URL path (`/derive/{expression}`), so scope your agent by operation: limit it to the operations it needs, such as simplify, derive, or integrate, and leave the rest out of the allowed set. You choose which of the fifteen operations it may call.
- **Credential handling:** Newton needs no credential, so there is nothing for Jentic One to store or inject; the agent reaches it through the same execution flow as authenticated APIs, with credential handling effectively a no-op.
- **Discovery method:** Agents search Jentic by intent such as 'compute the derivative of an expression' or 'factor a polynomial', and Jentic returns the matching Newton operation with its path parameter schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **News API** — Unrelated domain - news article search rather than math
- **GitHub API** — Newton is open source on GitHub - use the GitHub API to read the source repository or fork it
- **Snyk API** — Snyk reports vulnerabilities for any open-source dependency, including Newton if hosted self

## FAQ

### What authentication does the Newton API use?

The Newton API has no authentication - every endpoint is a public GET with the expression in the URL path. Through Jentic the operations are still wrapped with the standard discover-load-execute flow, but there is no credential to manage in the vault for this API.

### Can I compute integrals with the Newton API?

Yes. GET `/integrate/{expression}` returns the antiderivative for the supplied expression. URL-encode special characters such as the caret for exponents. Pair it with GET `/area/{expression}` when a definite area calculation is needed instead.

### What are the rate limits for the Newton API?

The OpenAPI spec does not declare rate limits and the service is hosted on Vercel as a free micro-service, so callers should treat it as best-effort and back off on errors. For production workloads, an agent should batch or cache calls rather than hammering it from a tight loop.

### How do I verify a derivative with the Newton API through Jentic?

Search Jentic for 'compute the derivative of an expression', load the GET /derive schema, and execute with the expression in the path parameter. The response is a small JSON object containing the result, which the agent can compare against its own answer.

### Does the Newton API handle symbolic constants like pi or e?

Newton parses common math syntax including pi and e, plus standard operators and the trig functions. Expressions are URL-encoded path parameters, so an agent should encode characters like '+', '^', and spaces before sending the request.

### Can I limit what my agent is allowed to do with the Newton API?

Yes. Because you run Jentic One self-hosted, your own rules decide which of Newton's fifteen operations the agent may call, so you can allow just the ones it needs, such as GET /simplify, GET /derive, or GET /integrate, and leave the rest out of the allowed set. Newton is a public, unauthenticated service that takes the expression in the URL path, so there is no key to manage and scoping is done purely at the operation level. This keeps the agent restricted to the specific math functions you approve rather than the whole endpoint list.
