Diamond Problem Solver

Solve the diamond problem — enter two factors to get their product and sum, or enter a product and sum to find the two factors that multiply and add to them.

Loading calculator…

How to use this solver

Pick a direction with the toggle, then fill in the two cells you know:

  • Know A & B — type the two factors on the left and right. The solver multiplies them into the Product on top and adds them into the Sum at the bottom. Decimals like 2.5 and fractions like 1/2 are allowed here.
  • Know Product & Sum — type the Product on top and the Sum at the bottom. The solver finds the two factors AA and BB that multiply to the product and add to the sum.
Tip: The diamond problem is the same "find two numbers with this product and this sum" step you use when factoring a quadratic — practising it here makes trinomial factoring much faster.

What is a diamond problem?

A diamond problem is a four-cell diagram shaped like a diamond. Each corner has a job:

  • Top — the Product PP
  • Bottom — the Sum SS
  • Left and right — the two factors AA and BB

The two rules that tie the corners together are

P=A×B,S=A+B.P = A \times B, \qquad S = A + B.

Because there are two rules and four numbers, knowing any two cells is enough to recover the other two.

The two directions

Forward (easy) — you know the factors. Multiply for the top, add for the bottom. With A=6A = 6 and B=4B = -4:

P=6×(4)=24,S=6+(4)=2.P = 6 \times (-4) = -24, \qquad S = 6 + (-4) = 2.

Backward (the interesting case) — you know the product and sum. Now AA and BB are the two roots of a quadratic:

t2St+P=0    t=S±S24P2.t^2 - S\,t + P = 0 \;\Rightarrow\; t = \frac{S \pm \sqrt{S^2 - 4P}}{2}.

For P=24P = -24 and S=2S = 2 that is t22t24=0t^2 - 2t - 24 = 0, with discriminant 224(24)=1002^2 - 4(-24) = 100. Since 100=10\sqrt{100} = 10,

t=2±102=6 or 4,t = \frac{2 \pm 10}{2} = 6 \ \text{or} \ -4,

so the two factors are 66 and 4-4 — the pair that multiplies to 24-24 and adds to 22.

The tie to factoring a trinomial

Finding two numbers with a given product and sum is exactly the step that factors a quadratic trinomial:

x2+Sx+P=(x+A)(x+B).x^2 + Sx + P = (x + A)(x + B).

The worked example turns into

x2+2x24=(x+6)(x4).x^2 + 2x - 24 = (x + 6)(x - 4).

That is why the diamond method is taught alongside factoring — the diamond is the factoring step, drawn as a picture.

Why decimal product and sum give no "nice" answer

In the Know Product & Sum direction the solver reports only whole-number factors. Those exist only when the discriminant S24PS^2 - 4P is a perfect square. A decimal product or sum almost never satisfies that, so the solver says there is no whole-number pair rather than showing an ugly irrational root. If you genuinely want to multiply decimals or fractions, use the Know A & B direction, which handles them exactly.

Frequently asked questions

What is a diamond problem in math?
A diamond problem is a four-cell diagram used when factoring. The product PP sits at the top, the sum SS at the bottom, and the two factors AA and BB on the left and right. The rule is P=A×BP = A \times B and S=A+BS = A + B. You fill in two cells and the diagram gives you the other two.
How do you solve a diamond problem when you know the two factors?
Multiply them for the top and add them for the bottom. If A=6A = 6 and B=4B = -4, then P=6×(4)=24P = 6 \times (-4) = -24 and S=6+(4)=2S = 6 + (-4) = 2.
How do you find the two factors from the product and sum?
The factors AA and BB are the roots of t2St+P=0t^2 - S\,t + P = 0, so t=S±S24P2t = \tfrac{S \pm \sqrt{S^2 - 4P}}{2}. For P=24P = -24, S=2S = 2 the discriminant is 224(24)=1002^2 - 4(-24) = 100, 100=10\sqrt{100} = 10, giving t=2±102=6t = \tfrac{2 \pm 10}{2} = 6 or 4-4.
Why won't the calculator solve a decimal product and sum?
In the Product and Sum direction the tool reports only whole-number factors, which exist only when S24PS^2 - 4P is a perfect square. A decimal product or sum almost never factors into a nice integer pair, so it returns no solution. To multiply decimals, switch to the Know A and B direction.
How is the diamond problem related to factoring a trinomial?
Finding two numbers with product PP and sum SS is exactly the step that factors x2+Sx+P=(x+A)(x+B)x^2 + Sx + P = (x + A)(x + B). The example P=24P = -24, S=2S = 2 gives x2+2x24=(x+6)(x4)x^2 + 2x - 24 = (x + 6)(x - 4).
What goes in each corner of the diamond?
Product on top, Sum on the bottom, and the two factors on the left and right. Multiplying the side numbers gives the top; adding them gives the bottom.

Related calculators