Skip to content

Diamond Problem Calculator

Fill any two cells of a sum-and-product diamond and instantly get the missing two numbers, with step-by-step working.

Fill any 2 of the 4 fields — the other two are auto-calculated. Accepts integers, decimals, or fractions like 1/2.

Results

Fill any 2 of the 4 fields to solve the diamond.

Quick Answer

A diamond problem calculator finds two numbers from their sum and product — the core skill behind factoring quadratics by the AC method. Enter any two of the four cells (Product = A×B on top, Sum = A+B on the bottom, factors A and B on the sides) and it solves the rest; when only the sum and product are known, A and B are the roots of t² − St + P = 0.

Formula

A diamond problem holds four values in one shape. The top cell is the product, the bottom cell is the sum, and the left and right cells are the two factors:

Top = A × B  ·  Bottom = A + B

Fill any two cells and the calculator derives the other two. Five of the six combinations are one line of arithmetic. The sixth — sum and product given, factors missing — is the one worth understanding, because it is a quadratic in disguise. If A and B multiply to P and add to S, they are the two roots of:

t² − St + P = 0

which the calculator solves with the discriminant S² − 4P and the roots t = (S ± √(S² − 4P)) / 2. It takes A as the plus root and B as the minus root, so A is always the larger of the two. This is Viète’s relationship between a monic quadratic’s coefficients and its roots, running backwards.

How to use it

  1. Type any two values. Product, sum, factor A and factor B are four separate boxes; there is no mode to pick. The calculator works out which pair you gave it.
  2. Read the diamond, not just the boxes. Values you typed and values the calculator derived are coloured differently in the diagram, so you can always see which two were yours.
  3. Open the working. The steps card prints the actual substitution line by line — including the discriminant when the quadratic route is used — so the method is checkable, not just the answer.
  4. Use fractions if you have them. The boxes accept 1/2 as well as 0.5. A zero denominator is rejected rather than silently returning infinity.
  5. Fill a third box to check yourself. If you enter a value that contradicts the solution, the calculator names both numbers — the one you typed and the one it computed — instead of quietly overwriting your entry.

The six ways to fill the diamond

The calculator tries the cheapest route first, so if you give it three values it uses the easiest valid pair and treats the rest as a check.

You giveIt findsMethodCost
A and BProduct, sumP = A × B, S = A + BTwo operations
A and sumB, productB = S − ASubtraction
B and sumA, productA = S − BSubtraction
A and productB, sumB = P ÷ ADivision
B and productA, sumA = P ÷ BDivision
Sum and productA and BRoots of t² − St + P = 0Quadratic formula

Worked examples

Every value below is what the calculator prints on screen, including its rounding.

GivenDiscriminantFactor AFactor BWhat it shows
A = 3, B = 434Product 12, sum 7
Sum 7, product 12143The same pair, recovered backwards
Sum 1, product −12494−3One factor must be negative
Sum 5, product 553.6181.382No integer pair exists
Sum 2, product 5−161 ± 2iNo real pair at all

The second row is the interesting one. Entering 3 and 4 to get 12 and 7 is arithmetic; going the other way — being handed 12 and 7 and asked for the pair — is the actual homework problem, and it is the one the quadratic route solves. The discriminant of 1 is a perfect square, which is exactly why the answer comes out as tidy whole numbers.

The discriminant tells you whether guessing can ever work

The classroom method for a diamond is to list factor pairs of the product and look for the pair that adds to the sum. That works beautifully when a whole-number pair exists and wastes an entire page when one does not.

S² − 4P decides it in one line. The two factors are whole numbers only when that value is a perfect square. If it is positive but not a perfect square, the factors are irrational and no amount of listing will find them. If it is negative, there is no real pair at all.

SumProductS² − 4PVerdict
7121Perfect square → whole numbers, 4 and 3
561Perfect square → whole numbers
8154Perfect square → whole numbers
1−1249Perfect square → whole numbers, 4 and −3
555Not a square → stop listing, the pair is irrational
678Not a square → stop listing
25−16Negative → no real pair exists

Run the perfect-square test before you start listing pairs. For x² + 6x + 7 the sum is −6 and the product 7, giving a discriminant of 8 — not a square, so the whole-number pair a student is hunting for does not exist. Two seconds of arithmetic replaces a page of guessing.

The square-root step is where the answer stops being tidy: with a sum of 5 and a product of 5 the calculator takes √5 = 2.2361 and returns 3.618 and 1.382, rounded to four decimals. If you want to see that root simplified rather than decimalised, the square root calculator shows the surd form and the working behind it.

Signs: what you can tell before solving

Two rules follow directly from the arithmetic and hold every time.

  1. A negative product forces exactly one negative factor. Multiplying two positives or two negatives gives a positive, so a negative product means the pair straddles zero. Sum 1 with product −12 returns 4 and −3, and there is no arrangement of two same-sign numbers that could have produced it.
  2. A positive product with a negative sum makes both factors negative. Same-sign is forced by the product; the sum then chooses which sign. This is why the factor-pairs card lists 1 × 12 and −1 × −12 as separate entries — they have the same product and opposite sums.

The factor-pairs card, and when it appears

When you give the sum and product, the calculator also lists every whole-number pair that multiplies to the product, and highlights the one whose sum matches. For a product of 12 that is six pairs: 1 × 12 (sum 13), −1 × −12 (sum −13), 2 × 6 (sum 8), −2 × −6 (sum −8), 3 × 4 (sum 7) and −3 × −4 (sum −7). With a target sum of 7, the fifth is highlighted.

The card is deliberately conditional. It appears only when the product is a whole number, is not zero, and has an absolute value of 10,000 or less — beyond that the list stops being a teaching aid and becomes a wall of numbers. A decimal or fractional product produces no card at all, because whole-number factor pairs are not a meaningful idea there.

The pairs card only ever appears on the sum-and-product route. Give the calculator two factors and there is nothing to search for — the answer is already in front of you, so the card stays hidden.

What the calculator refuses to do

Three situations return a message rather than a number, and each one is a case where a plausible-looking answer would be wrong.

  1. Factor A or B set to zero alongside a product. Finding the other factor means dividing by zero, so the calculator says so instead of returning infinity. Note the diamond itself is fine with a zero factor — enter 0 and 5 as the two factors and it correctly reports a product of 0 and a sum of 5. It is only the division route that breaks.
  2. A fraction with a zero denominator. Typing 1/0 is treated as no input at all rather than as infinity.
  3. A negative discriminant. Rather than reporting failure, the calculator prints the complex pair — sum 2 with product 5 gives 1 ± 2i — which are genuinely the two numbers that multiply to 5 and add to 2, just not real ones.

That last case is the point at which a diamond problem stops being a factoring exercise and becomes a quadratic with no real roots. If that is where your work is heading, the quadratic formula calculator takes the same discriminant and shows the full root analysis, including the complex case. The underlying identity — sum and product of roots against the coefficients of a monic quadratic — is set out in Wolfram MathWorld’s entry on Viète’s formulas, and the general theory of polynomial zeros in NIST’s Digital Library of Mathematical Functions.

Frequently Asked Questions

It is a four-cell puzzle used to teach factoring. The top cell holds the product of two numbers, the bottom cell holds their sum, and the side cells hold the numbers themselves. Given any two cells you can find the other two, which is the same skill needed to factor a quadratic trinomial.

They are the roots of t² − St + P = 0, so t = (S ± √(S² − 4P)) / 2. With a sum of 7 and a product of 12 the discriminant is 1, the square root is 1, and the roots are 4 and 3. The calculator prints each of those steps rather than only the answer.

Work out S² − 4P. If it is a perfect square, the two factors are whole numbers. If it is positive but not a perfect square — 8 for a sum of 6 and product of 7 — the factors are irrational and listing factor pairs will never find them.

Because the product is negative. Two numbers of the same sign always multiply to a positive, so a negative product means one factor is above zero and one below. A sum of 1 with a product of −12 gives 4 and −3, and no same-sign pair could produce it.

No real solution, yes — when S² − 4P is negative. A sum of 2 with a product of 5 gives a discriminant of −16, and the calculator reports the complex pair 1 ± 2i. Those numbers genuinely satisfy both conditions; they are simply not real numbers.

Both. Type 1/2 or 0.5 and either is accepted — with a second factor of 4 the calculator returns a product of 2 and a sum of 4.5. Results are rounded to four decimal places, and a fraction with a zero denominator is ignored rather than treated as infinity.

It appears only on the sum-and-product route, and only when the product is a non-zero whole number of magnitude 10,000 or less. Give the calculator the two factors directly and there is nothing to search for, so no list is shown.

Directly. Factoring x² + bx + c into (x + p)(x + q) needs two numbers whose product is c and whose sum is b — the top and bottom cells of the diamond. Solve the diamond and you have the factorisation, which is why the same discriminant appears in both problems.

Made with care

Want a calculator
built just for you?

Share the formula, the inputs, and who it's for — most reader-requested calculators ship within 14 days.

Calculator illustration