Diamond Problem Solver

Diamond Problem Solver

Fill in exactly two of the four boxes and leave the other two empty. Fill in exactly two boxes and leave the other two empty.

A diamond problem asks for two numbers when you know how they combine: their product sits at the top of the diamond, their sum at the bottom, and the two numbers themselves on the left and right. Fill in any two of the four values and this solver finds the other two, draws the finished diamond and checks the answer. It is the classic warm-up for factoring quadratics such as x² + 7x + 12, where you need two numbers that multiply to 12 and add to 7.

How to solve a diamond problem

  1. 1

    Enter exactly two values

    Fill in any two of factor a, factor b, the product and the sum, and leave the other two boxes empty. Negative numbers and decimals are accepted.

  2. 2

    Choose the kind of answer

    Pick any numbers, or whole numbers only. Whole-number mode matches textbook problems and tells you when no integers fit.

  3. 3

    Read the diamond

    The result shows a and b, the product and the sum drawn as a diamond, plus a check that a + b gives the sum and a × b gives the product.

How the missing values are found

Every diamond follows two rules: a + b = sum and a × b = product. Which two values you know decides the method.

You know The solver computes
a and b product = a × b, sum = a + b
a and product b = product ÷ a, then the sum (a cannot be 0)
b and product a = product ÷ b, then the sum (b cannot be 0)
a and sum b = sum − a, then the product
b and sum a = sum − b, then the product
product and sum solve x² − (sum)x + product = 0

Product and sum: the hard case

When only the product and the sum are known, a and b are the two roots of the quadratic x² − (sum)x + product = 0. The discriminant sum² − 4 × product tells you what happens:

  • Positive and a perfect square (7² − 4 × 12 = 1): two whole-number answers, here 3 and 4.
  • Positive but not a perfect square (3² − 4 × 1 = 5): two real answers that are not whole numbers, here about 0.382 and 2.618. In whole-number mode the solver says that no integers fit.
  • Zero (2² − 4 × 1 = 0): a double root, both numbers equal (1 and 1).
  • Negative (2² − 4 × 10 = −36): no real pair exists. The numbers are a complex conjugate pair, here 1 + 3i and 1 − 3i, and the solver says so instead of failing.

Worked examples

  • Product 12, sum 7: a = 3, b = 4.
  • Product −12, sum 1: a = −3, b = 4.
  • a = 4, product −20: b = −5, sum −1.
  • Product 6, sum 5 in whole-number mode: a = 2, b = 3.

Using the diamond to factor

For x² + 7x + 12, put 12 (the constant term, times the leading coefficient) at the top and 7 at the bottom. The left and right values, 3 and 4, give the factors (x + 3)(x + 4). When the leading coefficient is not 1, put the product of the leading coefficient and the constant at the top, then use the two numbers to split the middle term.

Frequently Asked Questions

It is a puzzle drawn as a diamond divided into four parts. The top holds the product of two numbers, the bottom holds their sum, and the left and right hold the numbers. You are given two parts and find the other two. Teachers use it to prepare students for factoring trinomials.

When the sum squared is smaller than four times the product, the discriminant is negative and no real numbers add to your sum and multiply to your product. The two numbers are then complex: the solver shows them as a conjugate pair such as 1 + 3i and 1 − 3i, and both still satisfy the sum and the product.

It limits the answer to integers, which is how most textbook diamond problems are written. If the real solution contains a fraction or an irrational number, the solver tells you that no two whole numbers fit and still shows the real-number answer so you can see why.

Because the other factor would be the product divided by 0. If the product is not 0 there is no such number, and if the product is 0 every number works, so the answer is not unique. A factor of 0 with a sum is fine: the other factor is the sum and the product is 0.

No. The values you type are sent to our server to work out the result, and they are added to the page link as you move between steps so a problem can be bookmarked or shared. They are not saved to any account or profile.

Related Tools

Tool available in other languages