Diamond Problem Calculator

Fill in any two corners of a diamond problem and get the other two. When you know the product and the sum, the two factors come from a quadratic equation, and the steps show how.

Factors a and b4 and 3

-1000000000000 – 1000000000000

-1000000000000 – 1000000000000

Factors a and b

4 and 3

  • Factor a4.0000000000
  • Factor b3.0000000000
  • Product (top)12.0000000000
  • Sum (bottom)7.0000000000

So x² + 7x + 12 factors as (x + 4)(x + 3).

How this was calculated

a and b are the two roots of t² − (sum)·t + (product) = 0.

t² − 7t + 12 = 0; discriminant D = S² − 4P = 7² − 4 × 12 = 1.

t = (7 ± √1) ÷ 2 → a = 4, b = 3.

Check: 4 × 3 = 12 and 4 + 3 = 7.

How a diamond problem works

A diamond problem has four numbers: two factors a and b on the left and right, their product a × b at the top and their sum a + b at the bottom. Knowing any two is enough to find the rest.

With both factors, multiply and add. With one factor and the product, b = product ÷ a. With one factor and the sum, b = sum − a.

With the product P and the sum S, a and b are the two roots of t² − S·t + P = 0, so t = (S ± √(S² − 4P)) ÷ 2. This is exactly the step used to factor x² + Sx + P into (x + a)(x + b).

Worked examples

Product 12, sum 7: D = 7² − 4 × 12 = 1, so t = (7 ± 1) ÷ 2, giving 4 and 3. Check: 4 × 3 = 12 and 4 + 3 = 7.

Product −24, sum −2: D = (−2)² − 4 × (−24) = 100, so t = (−2 ± 10) ÷ 2, giving 4 and −6.

What you know and how the rest follows
KnownFind bThen
a and b—P = a × b, S = a + b
a and productb = P ÷ aS = a + b
a and sumb = S − aP = a × b
product and sumt = (S ± √(S² − 4P)) ÷ 2both factors

When the answer is not a whole number

If S² − 4P is not a perfect square, the factors are irrational and the trinomial does not factor over the integers. If S² − 4P is negative, no real numbers work and the factors are a complex conjugate pair, which the calculator shows as p ± qi.

If a factor is 0, the product is 0 whatever the other factor is, so the product alone cannot recover it; enter the sum instead.

How to use the Diamond Problem Calculator

Choose which two corners you know, enter them and read the other two.

  1. Pick what you know

    Choose product and sum, both factors, a factor and the product, or a factor and the sum.

  2. Enter the numbers

    Type the two known values. Negative numbers and decimals are fine.

  3. Read the diamond

    See both factors, the product and the sum, with the working.

References

Frequently asked questions

What two numbers multiply to 12 and add to 7?

4 and 3. They are the roots of t² − 7t + 12 = 0, which factors as (t − 4)(t − 3).

How is a diamond problem used in factoring?

To factor x² + bx + c, find two numbers whose product is c and whose sum is b. Those numbers go into (x + m)(x + n). For x² + 7x + 12 they are 3 and 4.

What if no whole numbers work?

The calculator still gives the exact pair, which may be decimals or complex numbers. It notes when the trinomial cannot be factored over the integers.

Last updated . Results are estimates for informational purposes only.