Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Sum and Product Calculator

Sum S of the two numbers: enter a number. Prefilled example: 10.

Product P of the two numbers: enter a number. Prefilled example: 21.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Sum S of the two numbers: enter a number.
  2. Product P of the two numbers: enter a number.
  3. 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

  1. D=s2−4×p
  2. X1={s+D2if D≥0s2otherwise
Symbols used in the formula
SymbolMeaning
sSum S of the two numbers
pProduct P of the two numbers
DDiscriminant S² − 4P
X1First number (real part)

Worked example

Sum S of the two numbers10
Product P of the two numbers21
Discriminant S² − 4P16
Kind of answerTwo real numbers
Second number (real part)3
Imaginary part (0 for real numbers)0
  1. D=102−4×21=16
  2. X1=10+162=7

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).

Related calculators