Sum and Product Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the sum S and the product P of two unknown numbers; the calculator finds both numbers.
Result
First number (real part)
Discriminant S² − 4P
- Kind of answer
- Second number (real part)
- Imaginary part (0 for real numbers)
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Sum S of the two numbers: enter a number.
- Product P of the two numbers: enter a number.
- Read the result: First number (real part); the panel also shows Discriminant S² − 4P, Kind of answer, Second number (real part) and Imaginary part (0 for real numbers).
How this calculator works
Two numbers with sum S and product P are the roots of x² − Sx + P = 0 (Vieta's formulas). The quadratic formula gives x = (S ± √(S² − 4P)) ÷ 2.
When S² − 4P is negative there are no real numbers with that sum and product; the two answers are the complex pair S/2 ± (√(4P − S²)/2) i.
The formula
| Symbol | Meaning |
|---|---|
| Sum S of the two numbers | |
| Product P of the two numbers | |
| Discriminant S² − 4P | |
| First number (real part) |
Worked example
| Sum S of the two numbers | 10 |
|---|---|
| Product P of the two numbers | 21 |
| Discriminant S² − 4P | 16 |
|---|---|
| Kind of answer | Two real numbers |
| Second number (real part) | 3 |
| Imaginary part (0 for real numbers) | 0 |
First number (real part) 7
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
Which two numbers add to 10 and multiply to 21?
7 and 3.
Is this the same trick used to factor x² + bx + c?
Yes. To factor x² − 10x + 21, look for two numbers with sum 10 and product 21: 7 and 3, so it factors as (x − 7)(x − 3).