# unsolve > Free step-by-step math and physics solver with a remote MCP server. Deterministic symbolic computation: derivatives, integrals, equations, exact rational arithmetic, and 51 standard physics formulas with units. No API key, no LLM, no hallucinated math. unsolve runs its own TypeScript engine in two places: 1. A browser playground at https://unsolve.org/#playground — computations run locally, no network requests. 2. Worked examples at https://unsolve.org/#examples — classic math and physics problems with the engine's live step-by-step board. 3. A remote MCP (Model Context Protocol) endpoint at https://unsolve.org/api/mcp — Streamable HTTP transport, stateless, no authentication, rate-limited to 60 requests per minute per IP. ## Command language (playground) The playground accepts a small command language. LaTeX input is accepted everywhere ($...$, $$...$$, \(...\), \[...\], \frac, \sqrt, \sqrt[n], \sin, \pi, \log_2, \left(\right), \cdot, unicode minus/multiplication signs and superscripts like x²). - `diff [at

] [for ]` — symbolic derivative with step-by-step rules (sum, product, quotient, chain, power). Example: `diff x^3 + 2*x^2` → `3*x^2 + 4*x`. With `for`: `diff y*x^2 for y` → `x^2`. - `integrate [from to ] [for ]` — antiderivative + C for polynomials, exponentials, trigonometric functions, reciprocals, roots, and linear substitutions. Without bounds: `integrate sin(3*x + 1)` → `-cos(3*x + 1)/3`. With bounds: numeric definite integral (adaptive Simpson). - `solve ` — solve `lhs = rhs` for a variable (auto-detected, usually x). Exact rational roots for linear and quadratic polynomials; rational-root hunting + deflation for higher degrees; sign-scan + bisection numeric fallback for transcendental equations. Example: `solve x^2 - 5*x + 6 = 0` → `x = 2, x = 3`. A bare equation without the `solve` prefix also auto-solves. - `limit at

[for ]` — limit via direct substitution, recursive L'Hôpital for 0/0 and ∞/∞, numeric probing, ±∞. Example: `limit sin(x)/x at 0` → `1`. - `taylor [at

] [terms ] [for ]` — Taylor series expansion, default around 0 with 5 terms, up to 12. Example: `taylor exp(x) terms 5` → `1 + x + 0.5*x^2 + 0.1666666667*x^3 + 0.04166666667*x^4`. - `simplify ` — constant folding, algebraic identities, like-term collection. Example: `simplify 2*x + 3*x + 7` → `5*x + 7`. - `expand ` — polynomial expansion. - `apart ` — partial fractions over distinct linear factors. Example: `apart 1/(x^2-1)` → `-1/2/(x+1) + 1/2/(x-1)`. - `poly-roots ` — all real AND complex polynomial roots (Durand–Kerner). Example: `poly-roots 1 0 0 -1` → `-1, 1`. - `det [a, b; c, d]` · `inv […]` · `transpose […]` · `linsolve [A | b]` · `trace […]` · `eigen […]` — exact matrix operations (eigen expects a symmetric matrix). - `gcd a b` · `lcm a b` · `factor n` · `is-prime n` · `fib n` · `binom n k` — number theory with exact big integers. - `stats ` — descriptive statistics. - `minimize from to ` — golden-section minimum over an interval. - `` — evaluate. Exact rational arithmetic when possible: `1/2 + 3/4` → `5/4`. Numeric otherwise: `sin(pi/4)` → `0.7071067812`. Supported input: plain math (`x^2 + 3*x`, `sin(pi/4)`, `2x`, `5!`), LaTeX (`\frac{1}{2} + \frac{3}{4}`, `$\sin(x)$`), and unicode math (`x² − 5x + 6 = 0`, `√2 × √8`). Constants: `pi`, `tau`, `e`. Functions: sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (natural), log2, log10, sqrt, cbrt, abs, gamma. ## Physics library (51 formulas) - `physics` — every formula, grouped by category. - `physics ` — the formula with its symbols, meanings and SI units. - `physics for ` — rearrange the formula for ``. - `physics sym=val ...` — give the known values; the engine isolates the one remaining unknown and answers in SI units. - `physics sym=20km/h ...` — values may carry units; supported units include m, cm, km, kg, g, s, ms, min, h, m/s, km/h, m/s^2, N, kN, J, kJ, W, kW, Pa, kPa, Hz, V, kV, A, mA, ohm, kohm, F, uF, T, Wb, C, rad, deg. Numeric answers are returned in SI and, when helpful, a second everyday unit (e.g. `19.6 m/s (70.56 km/h)`). Append `in ` to choose the primary output unit (`… in km/h` → `70.56 km/h (19.6 m/s)`). Examples: - `physics newton-second m=10 F=50` → `a = 5 m/s^2`. - `physics ohm for R V=12 I=2` → `R = 6 ohm`. - `physics kinematic-vat u=0 a=9.8 t=2` → `v = 19.6 m/s`. - `physics kinematic-vat v=20km/h u=0 a=9.8 t=2min` → converts the units first. - `physics thin-lens f=0.2 d1=0.3` → `d2 = 0.6 m`. Formula ids (grouped by category): Mechanics (28): `newton-second`, `newton-first`, `newton-third`, `momentum`, `impulse`, `weight`, `kinematic-vat`, `kinematic-v2`, `kinematic-sut`, `kinematic-st`, `projectile-range`, `projectile-height`, `gravitation`, `kepler-period`, `work`, `power`, `kinetic-energy`, `potential-energy`, `elastic-energy`, `total-energy`, `hooke`, `centripetal`, `pendulum-period`, `torque`, `angular-momentum`, `density`, `pressure`, `buoyancy`. Electricity & Magnetism (8): `ohm`, `electric-power`, `coulomb`, `electric-field`, `capacitance`, `capacitor-energy`, `magnetic-force`, `magnetic-flux`. Waves & Optics (8): `wave-speed`, `wave-period`, `refractive-index`, `snell`, `thin-lens`, `magnification`, `photon-energy`, `de-broglie`. Thermodynamics (5): `ideal-gas`, `heat`, `first-law`, `efficiency`, `latent-heat`. Modern Physics (2): `mass-energy`, `time-dilation`. Aliases: `newton`, `fma`, `kinematics`, `suvat`, `kinetic`, `potential`, `work`, `spring`, `gas`, `lorentz`, `einstein`, `snells`, `lens`. ## MCP tools (https://unsolve.org/api/mcp) Transport: Streamable HTTP (POST JSON-RPC 2.0). Stateless — no session, no auth, no API key. Rate limit: 60 requests/min per IP (HTTP 429 with retry-after when exceeded). Every tool returns structured JSON: `output` (plain text), `latex` (KaTeX-ready), `steps` (ordered {text, latex} pairs), `approx` (numeric value or array), and `ok`. - `evaluate` — arguments: `expression` (string), `variables` (optional object of number substitutions). Exact/numeric evaluation. - `differentiate` — arguments: `expression`, `variable` (optional, auto-detected), `at` (optional number). Symbolic derivative + steps. - `integrate` — arguments: `expression`, `variable` (optional), `from`/`to` (optional numbers). Without bounds: antiderivative + C, or an isError result explaining no closed form was found. With bounds: numeric definite integral (adaptive Simpson). - `solve` — arguments: `equation` (e.g. "x^2 - 5*x + 6 = 0"), `variable` (optional). Roots (exact where possible, complex roots included for negative discriminants) + steps. - `simplify` — arguments: `expression`. Simplified form. - `taylor` — arguments: `expression`, `variable` (optional), `at` (default 0), `terms` (default 5, max 12). Series + steps. - `limit` — arguments: `expression`, `variable` (optional), `at` (number, "inf", or "-inf"). Direct substitution, recursive L'Hôpital for 0/0 and ∞/∞, numeric probing with one-sided divergence detection. Example: sin(x)/x at 0 → 1. - `poly-roots` — arguments: `coefficients` (number array, leading first). All real AND complex roots via Durand–Kerner. Example: [1, 0, 1] → i, -i. - `number-theory` — arguments: `operation` (gcd | lcm | factor | is-prime | fib | binom), `a`, `b` (optional). Exact integer results (BigInt for fib/binom; deterministic Miller–Rabin for is-prime, valid far beyond 2^53). - `stats` — arguments: `data` (number array). n, sum, mean, median, min, max, range, sample variance, sample standard deviation. - `matrix` — arguments: `operation` (det | inv | transpose | linsolve | trace | eigen), `matrix` (rows of numbers). Exact determinant and inverse over rationals (float fallback), singular matrices error clearly; linsolve solves A·x = b from the augmented n×(n+1) matrix [A | b]; trace sums the diagonal; eigen returns eigenvalues + eigenvectors of a real symmetric matrix (Jacobi rotations). - `minimize` — arguments: `expression`, `variable` (optional), `from`, `to` (required numbers). Golden-section search for the minimum of a single-variable function over [from, to] (assumes unimodal on the interval). Returns argmin x, f(x), and steps. - `apart` — arguments: `expression`, `variable` (optional). Partial fraction decomposition over distinct linear factors, with polynomial long division for improper fractions. Example: 1/(x^2-1) → -1/2/(x+1) + 1/2/(x-1). - `physics` — arguments: `formula` (formula id or "list"), `solveFor` (optional symbol), `values` (optional object of known values; numbers, or strings that carry units such as "20km/h"). Solves the formula for the remaining unknown and answers in SI units. Example: formula "newton-second", values {"m": 10, "F": 50} → a = 5 m/s^2. ### Playground commands (same engine) `diff [at

] [for ]` · `integrate [from to ] [for ]` · `solve [for ]` · `limit at

[for ]` · `taylor [at

] [terms ] [for ]` · `expand ` (polynomial expansion) · `apart ` (partial fractions) · `poly-roots ` (leading first) · `gcd a b` · `lcm a b` · `factor n` · `is-prime n` · `fib n` · `binom n k` · `stats ` · `det [a, b; c, d]` · `inv [a, b; c, d]` · `transpose [a, b; c, d]` · `linsolve [A | b]` · `trace [a, b; c, d]` · `eigen [a, b; b, c]` (symmetric) · `minimize from to ` · `physics [for ] [sym=value ...]` · plain expressions evaluate. ### Example: connect from Cursor or Claude Desktop ```json { "mcpServers": { "unsolve": { "url": "https://unsolve.org/api/mcp" } } } ``` ### Example: tools/call Request: ```json { "method": "tools/call", "params": { "name": "solve", "arguments": { "equation": "x^2 - 5*x + 6 = 0" } } } ``` Result (abbreviated): ```json { "ok": true, "kind": "solve", "output": "x = 2, x = 3", "latex": "x = 2,\\quad x = 3", "steps": [ { "text": "Move everything to one side", "latex": "x^{2} - 5 \\cdot x + 6 = 0" }, { "text": "Quadratic: a = 1, b = -5, c = 6", "latex": "a = 1,\\quad b = -5,\\quad c = 6" }, { "text": "Discriminant", "latex": "\\Delta = b^2 - 4ac = 1" } ], "approx": [2, 3] } ``` ### Example: tools/call (physics) Request: ```json { "method": "tools/call", "params": { "name": "physics", "arguments": { "formula": "newton-second", "values": { "m": 10, "F": 50 } } } } ``` Result (abbreviated): ```json { "ok": true, "kind": "physics", "output": "a = 5 m/s^2", "latex": "a = 5\\ \\mathrm{m/s^2}", "steps": [ { "text": "Newton's second law — Net force equals mass times acceleration.", "latex": "F = m\\,a" }, { "text": "Given", "latex": "F = 50\\ \\mathrm{N},\\quad m = 10\\ \\mathrm{kg}" }, { "text": "Solve for a", "latex": "a = 5\\ \\mathrm{m/s^2}" } ], "approx": [5] } ``` ## Changelog (agent-facing) Keep this section short. Newest first. Agents: prefer this over scraping git history. ### 2026-10 - Worked-examples board (`#examples`): classic math (quadratic, chain rule, lim sinx/x, …) and physics (F=ma, Ohm, free fall, …) with live `solveProblem` steps. - Exact linear solves keep fractional coefficients (`(2/3)*x = 4` → `x = 6`); no more fake 1e6 “exact” snaps. - Weekly newsletter signup via `POST /api/newsletter` (Upstash set when configured). - Physics library: 51 formulas; `physics` MCP tool and playground command; unit-aware inputs (`20km/h`, `2min`, …). - Physics answers may include a second everyday unit when helpful (e.g. `19.6 m/s (70.56 km/h)`); `in ` selects the primary output unit. - Playground UX: `?q=` deep links, ↑↓ history, Alt+]/[ example cycling, copy-link, collapsible steps, LaTeX tip. - Optional shared MCP rate limit via Upstash Redis REST (`UPSTASH_REDIS_REST_URL` + `UPSTASH_REDIS_REST_TOKEN`). - PWA shell: `manifest.webmanifest`, dedicated icons (`icon-192.png` / `icon-512.png` / maskable), production service worker, Install nav control, KaTeX font prefetch into the SW cache. - Playwright smoke (`bun run test:e2e`) for hero + playground on desktop and mobile; wired into CI. - Playground/physics results can download a chalkboard PNG card (`save PNG`); copy answer / copy LaTeX. - Playground history persists in the browser (`localStorage`); Features try-links open `?q=` deep links; physics catalogue links use `?formula=#physics`. - Chart blackboard UI; hero embeds the live playground. ### Earlier - Matrix ops (det/inv/transpose/linsolve/trace/eigen), minimize, apart, limits, poly-roots, number theory, stats. - Remote MCP Streamable HTTP at `/api/mcp` (stateless, no auth). ## Credits The symbolic core of unsolve was ported to TypeScript from mathr (https://github.com/yingkitw/mathr), a pure-Rust mathematics library and CLI with zero external math dependencies — thanks to the upstream project. unsolve adds the physics library, the MCP surface and the browser UI. - unsolve source: https://github.com/yingkitw/unsolve - mathr: https://github.com/yingkitw/mathr · https://crates.io/crates/mathr · https://docs.rs/mathr - License: Apache-2.0