# Quadratic Equation Solver

> Solves ax² + bx + c = 0 with the quadratic formula, reporting the discriminant, both roots (real, or complex conjugates written as strings), the vertex of the parabola and the sum and product of the roots.

- Calculator id: `quadratic-equation` · Category: Math (`math`) · Tool name: `solve_quadratic_equation`
- Canonical page: https://tttkmbb.com/math/quadratic-equation · This document: https://tttkmbb.com/math/quadratic-equation.md · JSON definition: https://tttkmbb.com/math/quadratic-equation.json

## Purpose

Solves ax² + bx + c = 0 with the quadratic formula, reporting the discriminant, both roots (real, or complex conjugates written as strings), the vertex of the parabola and the sum and product of the roots.

**Use when:** You need the solutions of a second-degree polynomial equation, or the vertex and discriminant of a parabola y = ax² + bx + c.

**Do not use when:** The coefficient a is 0 (the equation is linear: x = −c / b), or you need roots of x^n = c for other powers (use nth-root).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `a` | number |  | required | Coefficient of x². Must not be 0. |
| `b` | number |  | required | Coefficient of x. |
| `c` | number |  | required | Constant term. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `discriminant` | number |  | Δ = b² − 4ac; positive → two real roots, zero → one repeated root, negative → complex roots. |
| `nature` | string |  | Plain-language classification of the roots from the sign of the discriminant. |
| `root1` | number |  | (−b + √Δ) / (2a). Only when the roots are real. |
| `root2` | number |  | (−b − √Δ) / (2a). Only when the roots are real. |
| `roots` | string |  | Both roots as text; complex roots are written like '-1+2i, -1-2i'. |
| `vertex_x` | number |  | x-coordinate of the parabola's vertex, −b / (2a) (also the axis of symmetry). |
| `vertex_y` | number |  | y-coordinate of the vertex, c − b² / (4a) (the minimum for a > 0, maximum for a < 0). |
| `sum_of_roots` | number |  | −b / a (Vieta's formula). |
| `product_of_roots` | number |  | c / a (Vieta's formula). |

## Formula

`Δ = b² − 4ac; x = (−b ± √Δ) / (2a); for Δ < 0: x = −b/(2a) ± i·√(−Δ)/(2|a|); vertex = (−b/(2a), c − b²/(4a))`

## Data Sources

- Wikipedia – Quadratic formula — https://en.wikipedia.org/wiki/Quadratic_formula (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Quadratic Equation — https://mathworld.wolfram.com/QuadraticEquation.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/quadratic-equation?a=…&b=…&c=…`
- `POST https://tttkmbb.com/api/v1/calculate/quadratic-equation` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/quadratic-equation · OpenAPI operationId `solve_quadratic_equation` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `solve_quadratic_equation` (dedicated) or `run_calculator` with `{"calculator_id": "quadratic-equation", "inputs": {…}}`

## Example

- x² − 5x + 6 = 0: inputs `{"a":1,"b":-5,"c":6}` → `{"discriminant":1,"nature":"Two distinct real roots","root1":3,"root2":2,"roots":"3, 2","vertex_x":2.5,"vertex_y":-0.25,"sum_of_roots":5,"product_of_roots":6}`
- x² + 2x + 5 = 0: inputs `{"a":1,"b":2,"c":5}` → `{"discriminant":-16,"nature":"Two complex conjugate roots (no real roots)","roots":"-1+2i, -1-2i","vertex_x":-1,"vertex_y":4}`

```
GET https://tttkmbb.com/api/v1/calculate/quadratic-equation?a=1&b=-5&c=6
```

## Limitations

The coefficient a is 0 (the equation is linear: x = −c / b), or you need roots of x^n = c for other powers (use nth-root). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What does a negative discriminant mean?**

The parabola never crosses the x-axis, so there are no real solutions. The two complex conjugate roots are still reported as strings such as '-1+2i, -1-2i'.

**Which root is root1?**

root1 uses the + sign in the quadratic formula and root2 the − sign, so for a > 0 root1 is the larger root.

## Related

- [Nth Root Calculator](https://tttkmbb.com/math/nth-root.md) — Solve x^n = c for a single power.
- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — Evaluate powers appearing in polynomial terms.
- [Slope Calculator](https://tttkmbb.com/math/slope.md) — Linear equations from two points.
