ForHosting KIT · Developer Utilities

Quadratic with complex roots calculator

This quadratic complex-roots calculator solves ax² + bx + c = 0 when integer coefficients produce a negative discriminant.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Instead of rounding the answer to decimals, it preserves the real part as a reduced fraction and the imaginary magnitude as a simplified square root or fraction. The two results are returned together as an exact complex-conjugate pair in rectangular form, making the output useful for algebra practice, answer keys, symbolic test fixtures, and any workflow where an approximation would hide the structure of the solution.

Recognize when a quadratic has complex roots

Start with the standard equation ax² + bx + c = 0, where a cannot be zero. Its discriminant is b² − 4ac. A positive discriminant gives two distinct real roots, and zero gives one repeated real root. This calculator is intentionally focused on the remaining case: a strictly negative discriminant. When the discriminant is negative, its square root contains i, the imaginary unit defined by i² = −1. The quadratic formula can then be rearranged into a real part plus or minus an imaginary part. Because a, b, and c are real integers, changing only that sign produces two roots that are complex conjugates. For example, x² + x + 1 has discriminant −3. Its shared real part is −1/2, while its imaginary magnitude is sqrt(3)/2, so the pair is −1/2 + sqrt(3)/2 i and −1/2 − sqrt(3)/2 i. The calculator rejects a nonnegative discriminant rather than silently changing jobs, which makes an invalid assumption visible in API workflows and classroom checks. It also rejects a = 0 because that input describes a linear equation, not a quadratic one.

Read the exact rectangular-form result

Provide the three integer coefficients a, b, and c exactly as they appear in the standard form. The response first echoes a readable equation and reports the negative discriminant. Each member of the roots array then contains real, imaginary, and rectangular fields. The real field is the reduced value −b/(2a). The imaginary field is the signed coefficient of i, derived from sqrt(−D)/(2|a|), with square factors removed from the radical and common factors cancelled against the denominator. The rectangular field combines those exact pieces into the familiar u + vi notation. A result such as 3/2 + sqrt(7)/2 i therefore means that u is 3/2 and v is sqrt(7)/2; the second result carries the same real coordinate and the negative imaginary coordinate. No floating-point decimal is substituted for a radical, so recurring fractions and irrational square roots remain mathematically exact. If the radical becomes a whole number after simplification, the output drops sqrt notation. If a fraction reduces to an integer, its denominator is omitted. These formatting rules make equality comparisons predictable while keeping the expressions readable enough to copy into notes, solutions, or symbolic software.

Validate the pair and use it safely

A quick validation uses conjugate symmetry: both roots must have identical real parts, and their imaginary parts must be opposites. You can also apply Vieta’s formulas. The sum of the two roots should equal −b/a because the imaginary terms cancel, while their product should equal c/a because conjugate imaginary components multiply to a real quantity. For a direct check, substitute either rectangular expression into ax² + bx + c and simplify; both the real and imaginary components should vanish. Inputs are limited to safe integers with absolute value no greater than one million. That boundary keeps the discriminant and its factorization deterministic in both the browser and the API Worker. This tool does not accept decimal coefficients, parse a typed equation, approximate roots, or solve cases with real roots. Convert rational coefficients to equivalent integers before calling it, and use a general quadratic-formula calculator when the sign of the discriminant is unknown. The browser path runs the same pure solving function as the API and needs no network access. Automated API use is charged $0.002 for a successful item, while malformed inputs and equations outside this capability’s negative-discriminant scope return an invalid-input error rather than a fabricated pair.

Check an algebra assignment

Compare a hand-derived conjugate pair with reduced exact real and imaginary parts before submitting the work.

Build exact answer keys

Generate consistent rectangular-form solutions without introducing decimal rounding into worksheets or assessment fixtures.

Test symbolic math code

Use deterministic radical and fraction strings as fixtures for software that handles quadratic equations over the complex numbers.

Why must the discriminant be negative?

This capability is specifically for nonreal complex-conjugate roots. A zero or positive discriminant belongs to a real-root quadratic solver.

Are the roots exact or decimal approximations?

They are exact. Fractions are reduced and square roots are simplified without conversion to floating-point decimals.

What does rectangular form mean?

Rectangular form writes a complex number as u + vi, separating its real part u from its imaginary coefficient v.

Why are the two roots conjugates?

A real-coefficient quadratic with nonreal roots has the same real part in both solutions and opposite signs on their imaginary parts.

How much does an API call cost?

Each successful API item costs $0.002. The same deterministic solver can also run locally in the browser.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/quadratic-complex-roots

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/quadratic-complex-roots \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":1,"b":1,"c":1}'
{
  "a": 1,
  "b": 1,
  "c": 1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.quadratic_complex_roots",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →