Math

Diamond Problem Calculator

Find two numbers from their sum and product.


Diamond Problem Calculator

Advertisement

Solve the classic “diamond problem” — find two numbers when you know their sum and their product, a common step in factoring quadratics.

How it works

The two numbers are the roots of the quadratic t² – (sum)t + (product) = 0, solved with the quadratic formula: x, y = (sum ± √(sum² – 4×product)) ÷ 2. A sum of 10 and product of 21 gives 7 and 3.

What this does not include

This finds real-number solutions only. When the sum and product combination has no real solution, this calculator returns no result rather than an imaginary one.

How to use this calculator

  1. Enter the sum of the two numbers.
  2. Enter their product.

A worked example

Sum 10, product 21: the two numbers are 7 and 3 (7+3=10, 7×3=21).

Sum 7, product 12: the two numbers are 4 and 3.

What the variables mean

Variable Meaning
Sum The two numbers’ total
Product The two numbers’ product

Edge cases worth knowing

Not every sum-and-product pair has a real solution. A sum of 1 and product of 10 has no pair of real numbers satisfying both conditions — the underlying quadratic has no real roots, so the calculator declines to show a result.

This is the same math behind factoring quadratic trinomials — the “diamond problem” is a common way algebra students practice finding factor pairs before applying them to factoring x²+bx+c.

Why is this called a “diamond problem”?

It’s commonly taught using a diamond-shaped diagram with the product on top, the sum on the bottom, and the two unknown numbers on the sides — a visual method for factoring quadratic expressions.

How does this relate to factoring a quadratic?

Factoring x² + bx + c requires finding two numbers that multiply to c and add to b — exactly what this calculator solves, turning the quadratic into (x – first number)(x – second number).

What if the sum and product don’t have a real solution?

That happens when sum² is less than 4 × product — the underlying quadratic has no real roots, meaning no real pair of numbers satisfies both conditions.

Be the first to rate this

Written by

J. Adeyemi

Statistics writer

J. Adeyemi writes the statistics and probability calculators, from descriptive summaries through to distributions and conditional probability. The recurring theme is scope: each page states precisely which question it answers, because most statistical mistakes come from applying a correct formula to the wrong question. Related-but-different measures get separate pages rather than being quietly merged.

Reviewed by

T. Okafor

Calculator reviewer — mathematics

T. Okafor reviews the mathematics calculators, verifying algebraic correctness and, just as importantly, behaviour at the edges — division by zero, undefined results, and the floating-point cases where a formula technically returns a number that should be reported as undefined. Every test case is recomputed independently rather than taken on trust.

How we write and review

Related calculators