A diamond problem calculator finds two numbers from their product and their sum, which is the puzzle at the heart of the diamond method of factoring a quadratic. Enter the product and the sum and it gives the pair. Or enter a, b and c for a quadratic ax² + bx + c, and it finds the pair for a × c and b, then writes the factored form. The method follows the Wikipedia pages on factorization and Vieta's formulas, and the work is done in your browser.
How to use the diamond problem calculator
- Choose what you want: a pair from a product and a sum, or a factored quadratic.
- For a pair, enter the product and the sum.
- For a quadratic, enter a, b and c.
- Press Calculate.
The diamond problem
In a diamond problem you draw a diamond, put a product at the top and a sum at the bottom, and find the two numbers at the sides. For a product of 36 and a sum of 13, the numbers are 4 and 9, because 4 × 9 is 36 and 4 + 9 is 13. The calculator finds the pair by treating them as the two roots of t² − (sum)t + (product) = 0, which are (sum ± the square root of the discriminant) / 2. The discriminant is the sum squared minus 4 times the product. If it is negative, no real pair exists.
The sum and product connection
The caption on the Wikipedia page about factorization states the principle: the polynomial x² + cx + d, where a + b = c and ab = d, can be factorized into (x + a)(x + b). Vieta's formulas, on their own page, say the same thing from the other side: the roots r₁ and r₂ of ax² + bx + c satisfy r₁ + r₂ = −b/a and r₁ r₂ = c/a. The diamond method is a way to use this idea when a is not 1.
Factoring with the diamond method
To factor ax² + bx + c, put the product a × c at the top and b at the bottom. Find the two numbers m and n, split the middle term into mx + nx, and factor by grouping. For 6x² + 13x + 6, the product is 36 and the sum is 13, so the numbers are 4 and 9. Then 6x² + 4x + 9x + 6 groups as 2x(3x + 2) + 3(3x + 2), which is (3x + 2)(2x + 3). Expanding (3x + 2)(2x + 3) gives 6x² + 9x + 4x + 6, which is the original. The calculator does this and writes the result, along with the roots, which are −2/3 and −3/2 here.
When the numbers are not whole
For x² + x − 1, the product is −1 and the sum is 1, so the pair is (1 ± the square root of 5)/2, about −0.618 and 1.618. These are not whole numbers, so the quadratic cannot be factored with whole numbers, and the calculator says so. For x² + x + 1 the discriminant is negative, so no real pair exists. In both cases, use the quadratic formula to find the roots, or the quadratic equation solver on this site.
Taking out a common factor
If all three numbers share a factor, as in 2x² + 4x + 2, the method still works. The pair for the product 4 and the sum 4 is 2 and 2, and the result is 2(x + 1)(x + 1), with the common factor 2 written in front. It is a good habit to take out any common factor first, since it makes the numbers smaller.
Signs and negative numbers
The signs of the pair follow from the product and the sum. If the product is positive, the two numbers have the same sign, which is the sign of the sum. If the product is negative, they have different signs, and the larger one has the sign of the sum. For a product of −12 and a sum of 1, the pair is −3 and 4.
A second worked example
Factor 3x² − 2x − 8. The product a × c is 3 × (−8), which is −24, and the sum is −2. The pair that multiplies to −24 and adds to −2 is −6 and 4. Split the middle term: 3x² − 6x + 4x − 8. Group the first two and the last two: 3x(x − 2) + 4(x − 2). The common factor is (x − 2), and the result is (3x + 4)(x − 2). Check by expanding: 3x² − 6x + 4x − 8 is 3x² − 2x − 8. The calculator gives the same factored form and the roots 2 and −4/3.
Why the method works
When you expand (px + q)(rx + s), you get prx² + (ps + qr)x + qs. The number a is pr, c is qs, and b is ps + qr. The product of ps and qr equals pr times qs, which is a × c. So the two middle terms, ps and qr, have the product a × c and the sum b, which is exactly what the diamond asks for. Finding them lets you split the middle term and then factor by grouping, in a way that always works for quadratics that factor.
Common mistakes
- Using c as the product instead of a × c. The product includes a.
- Getting the sign of the sum wrong. The sum is b, with its sign.
- Skipping the common factor. Take it out first.
- Expecting every quadratic to factor. Many have no whole-number pair.
- Forgetting to check by expanding. Multiply the factors back.
What next
Use this often? Add Diamond Prob to your Home screen.
Frequently asked questions
What is a diamond problem calculator?
A tool for the puzzle: find two numbers that multiply to the top number and add to the bottom number. It is used to factor quadratics.
How do you factor 6x² + 13x + 6 with the diamond method?
The product 6 × 6 = 36 and the sum 13 give 4 and 9. Then 6x² + 4x + 9x + 6 = (3x + 2)(2x + 3).
How do you find two numbers from a product and a sum?
They are the roots of t² − (sum)t + (product) = 0, which is (sum ± √(sum² − 4 × product)) ÷ 2.
What if there are no whole numbers that work?
Then the quadratic cannot be factored with whole numbers. Use the quadratic formula for its roots.
What do Vieta's formulas say?
For ax² + bx + c, the roots add to −b/a and multiply to c/a.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.