Skip to content
Calculadora.co.uk
Student working through maths equations at a desk

Photo via Unsplash

Calculadora · Maths

Quadratic Formula (Bhaskara) Calculator

LIVE
Δ
1
b² − 4ac
x₁
2
x₂
1

Solve any quadratic ax² + bx + c = 0 with the quadratic formula (also known as Bhaskara in Brazilian classrooms). Shows the discriminant, both roots and the nature of the solutions.

Written by Laura WhitmoreReviewed by Editorial Desk

How it works

What the quadratic formula does

A quadratic equation has the general shape ax² + bx + c = 0 with a ≠ 0. The quadratic formula (known as Bhaskara in Brazilian and Portuguese textbooks, after the 12th-century Indian mathematician Bhāskara II) gives every possible value of x that satisfies the equation, in one step.

It works whether the coefficients are integers, decimals or letters — which is why it beats factoring as a general-purpose tool. Our widget accepts a, b and c and returns the discriminant, both roots and the factored form.

The formula, step by step

  • Step 1 — write the equation as ax² + bx + c = 0 with 0 on the right.
  • Step 2 — read off the coefficients a, b, c.
  • Step 3 — compute the discriminant Δ = b² − 4ac.
  • Step 4 — if Δ < 0 the roots are complex: x = (−b ± i√|Δ|) / 2a.
  • Step 5 — else apply x = (−b ± √Δ) / 2a to get the two real roots.

Three worked examples

1. Two distinct real roots — x² − 5x + 6 = 0

a = 1, b = −5, c = 6.

Δ = (−5)² − 4 × 1 × 6 = 25 − 24 = 1.

x = (5 ± √1) / 2 → x₁ = 3, x₂ = 2.

Cross-check by factoring: (x − 2)(x − 3) = 0. ✓

2. Repeated root — x² − 6x + 9 = 0

a = 1, b = −6, c = 9.

Δ = 36 − 36 = 0 → single real root.

x = 6 / 2 = 3 (multiplicity 2). The parabola touches the x-axis once.

3. Complex roots — x² + 2x + 5 = 0

a = 1, b = 2, c = 5.

Δ = 4 − 20 = −16 → no real roots.

x = (−2 ± √−16) / 2 = −1 ± 2i. The parabola sits entirely above the x-axis.

What the discriminant tells you

  • Δ > 0 — two distinct real roots; the parabola crosses the x-axis twice.
  • Δ = 0 — one real root (double); the parabola is tangent to the x-axis.
  • Δ < 0 — two complex conjugate roots; the parabola doesn't touch the x-axis.
  • Vertex — the x-coordinate of the minimum/maximum is x = −b/2a, regardless of Δ.
  • Sum and product of roots (Vieta's formulas): x₁ + x₂ = −b/a and x₁ × x₂ = c/a. Handy for cross-checks.

When to factor vs when to use the formula

Factoring is faster when a, b and c are small integers and the roots are obvious (like x² − 7x + 12). The formula wins when coefficients are ugly, the roots involve radicals, or you need a programmatic answer.

Completing the square sits between the two and is how Bhaskara's formula is actually derived — useful to know for A-level exam proofs.

Real-world uses

  • Projectile motion — the height h(t) = h₀ + v₀t − ½gt² is quadratic in t; solving h = 0 tells you when the projectile lands.
  • Profit maximisation — revenue − cost is often a downward-opening parabola; the vertex gives the profit-maximising price.
  • Area problems — "a rectangle has perimeter 40 m and area 96 m²" becomes x(20 − x) = 96, a quadratic in x.
  • Physics / engineering — resonant frequency, LC circuits, RLC damping — all quadratic in nature.

Works well with

Deriving the formula by completing the square

Examiners at GCSE and A-level love to ask for the proof, not just the answer. The trick is called completing the square and it is the reason Bhaskara's formula exists at all. Start from the general quadratic and work it into a perfect-square shape.

ax² + bx + c = 0. Divide through by a (valid because a ≠ 0): x² + (b/a)x + c/a = 0. Move c/a across: x² + (b/a)x = −c/a.

Add (b/2a)² to both sides so the left becomes a perfect square: x² + (b/a)x + (b/2a)² = (b/2a)² − c/a. The left is now (x + b/2a)². Tidy the right: (b² − 4ac) / 4a².

Take square roots: x + b/2a = ±√(b² − 4ac) / 2a. Move b/2a across and you land on x = (−b ± √(b² − 4ac)) / 2a — the formula we started with. The group inside the radical, b² − 4ac, is what we later call the discriminant Δ.

Vieta's formulas — the quick sanity check

Before a calculator existed, students used Vieta's (Girard's) relations to check answers in seconds: sum of roots = −b/a and product of roots = c/a. They come straight out of expanding a(x − x₁)(x − x₂) = 0, and they save time in exam conditions.

Quick example

Take 2x² − 3x − 5 = 0. The formula gives x₁ = 5/2 and x₂ = −1. Check: sum = 5/2 + (−1) = 3/2 = −b/a = 3/2 ✓. Product = 5/2 × (−1) = −5/2 = c/a = −5/2 ✓. If either check fails, you made an arithmetic slip in the formula — re-read your working before writing more.

Building an equation from known roots

Given roots 7 and −2, the monic quadratic with those roots is x² − (sum) x + (product) = x² − 5x − 14 = 0. This trick is useful whenever a problem hands you the roots and asks for the equation, which appears in nearly every GCSE and A-level non-calculator paper.

The shape of the parabola — vertex, axis and intercepts

Every quadratic is a parabola. The sign of a tells you the opening direction: a > 0 opens upwards, a < 0 opens downwards. The axis of symmetry is the vertical line x = −b/2a, which is also the x-coordinate of the vertex. Substitute that back into the equation to get the minimum (or maximum) value, y = c − b²/4a.

  • y-intercept — when x = 0, y = c. Always the easiest point to plot.
  • x-intercepts — the real roots from Bhaskara. If Δ < 0 there are none; the parabola sits wholly above or below the x-axis.
  • Vertex — (−b/2a, c − b²/4a). Exam papers routinely ask for the "turning point", which is exactly this.
  • Concavity and stretch — the larger |a|, the steeper the sides. a = 1 is the baseline shape; a = 2 is twice as narrow; a = 0.5 is twice as wide.

Two exam-style walkthroughs

These match the style of recent GCSE and A-level papers. Work each one through with pen and paper before checking the answer.

Problem 1 — kinematics (AS-level mechanics)

A ball is thrown upwards from a 2 m cliff with initial velocity 12 m/s. Using g = 9.8 m/s², its height above the ground is h(t) = 2 + 12t − 4.9t². When does it hit the ground? Setting h(t) = 0 gives −4.9t² + 12t + 2 = 0, or 4.9t² − 12t − 2 = 0. Discriminant Δ = 144 + 39.2 = 183.2. √Δ ≈ 13.535. t = (12 + 13.535) / 9.8 ≈ 2.60 s (the negative root is rejected because time cannot be negative).

Problem 2 — optimisation (GCSE higher tier)

A rectangular enclosure uses 60 m of fencing, with one side formed by an existing wall. What width x maximises the area? The two fenced sides parallel to the wall sum to 60 − 2x, so area A(x) = x(60 − 2x) = −2x² + 60x. This is a downward-opening parabola; the vertex is at x = −b/2a = −60 / (2 × −2) = 15 m. Maximum area = 15 × 30 = 450 m². Bhaskara is not needed for the answer, but the same formula gives the roots 0 and 30 — the widths at which the area vanishes.

Common mistakes with the quadratic formula

Most wrong answers are not about the formula itself — they are about the numbers you feed into it. Watch for these five.

  • Sign slip on b. If b = −7, plugging in gives −(−7) = +7, not −7. Miss this and every subsequent step is wrong.
  • Squaring a negative. (−7)² = 49, not −49. Most calculators follow the standard rule if you bracket the negative, but a bare −7² on a non-scientific key sequence returns −49.
  • Dividing only one term by 2a. The whole numerator (−b ± √Δ) is divided by 2a. Students often divide only −b and leave the radical untouched.
  • Forgetting the ± gives two roots. "Just one x" is an incomplete answer except when Δ = 0.
  • Ignoring non-real roots when physics demands them. In pure maths, Δ < 0 is an accepted answer (complex roots). In kinematics, it usually means your model or your signs need rechecking.

How we verify the algebra

Every run of the widget recomputes both roots, substitutes them back into the original equation and reports the residual — if |ax² + bx + c| > 10⁻⁹ we flag a warning. We reference AQA GCSE, Edexcel A-level textbooks and the CRC Standard Mathematical Tables. See our editorial policy and corrections policy — all calculations run in your browser.

Frequently asked questions

What is the quadratic formula?
x = (−b ± √(b² − 4ac)) / 2a, which solves any equation of the form ax² + bx + c = 0.
Why is it called Bhaskara in Brazil?
After the 12th-century Indian mathematician Bhāskara II, who systematised the method. In the UK it's just "the quadratic formula"; the equivalence is identical.
What does the discriminant tell me?
Δ = b² − 4ac. If positive → two real roots; zero → one double root; negative → two complex conjugate roots.
Can a quadratic have no solution?
Not in the complex numbers — it always has exactly two roots counted with multiplicity. It can have no *real* solutions when Δ < 0.
When should I factor instead?
If a, b, c are small integers and the roots are integers, factoring is quicker. For everything else the formula is faster and safer.
How do I remember the formula?
A common mnemonic is "negative b, plus or minus the square root of b-squared minus 4ac, all over 2a". Singing it to a tune helps students remember.
What if a = 0?
Then it's not a quadratic — it's linear (bx + c = 0), solved by x = −c/b.
Does the formula work for complex coefficients?
Yes, the same formula applies; √Δ then also returns a complex number. Most secondary-school problems stick to real a, b, c.
What is the relationship with completing the square?
The quadratic formula is derived by completing the square on ax² + bx + c. Every proof in A-level and GCSE texts walks through this derivation.
Is the widget accurate for very small or very large numbers?
We use decimal arithmetic internally to avoid the "catastrophic cancellation" that plain floats suffer when b is much larger than 4ac. Residuals are always under 10⁻⁹.
How do I interpret complex roots in a word problem?
In kinematics or physics a negative discriminant usually means the scenario you modelled cannot happen — for example, a projectile that never reaches a given height. Re-read the question and check your signs. In pure algebra the complex roots are valid answers and should be left in a ± bi form.
Does the formula apply to cubic or higher equations?
No. The quadratic formula only covers equations of degree two. Cubics have a more elaborate Cardano formula, and from degree five onwards Abel's impossibility theorem proves no general closed-form solution exists.
Why does my answer differ from a graphing calculator?
Usually it is rounding: scientific calculators often round the discriminant early. Keep at least four decimal places through the working, then round the final answer.

References