Numbers Finder by Difference and Sum of Squares

Input the difference and sum of squares, and instantly find the two numbers.

Calculate Two Numbers Using Their Difference and Sum of Squares

Result

How to Calculate Two Numbers Using Their Difference and Sum of Squares

Given:

  • \( D \): the difference between the two numbers (\( x - y \))
  • \( P \): the sum of their squares (\( x^2 + y^2 \))

Steps:

  1. Set up relationships: \( x - y = D, \quad x^2 + y^2 = P \)
  2. Express one number in terms of the other: \( x = y + D \)
  3. Substitute into the sum of squares formula: \( (y + D)^2 + y^2 = P \)
  4. Expand and simplify: \( y^2 + 2Dy + D^2 + y^2 = P \)
  5. Combine like terms and rewrite as a quadratic equation: \( 2y^2 + 2Dy + D^2 - P = 0 \) \( y^2 + Dy + \frac{D^2 - P}{2} = 0 \)
  6. Solve for \( y \) using the quadratic formula: \( y = \frac{-D \pm \sqrt{D^2 - 2(D^2 - P)}}{2} \)
  7. Find \( x \) using \( x = y + D \).

Examples

Example 1: The difference between two numbers is 2, and their sum of squares is 52. What are the numbers?

Solution:

1. Solve the quadratic equation:

\( y^2 + 2y + \frac{2^2 - 52}{2} = 0 \)

\( y^2 + 2y - 24 = 0 \)

2. Calculate the discriminant:

\( \sqrt{2^2 - 4 \cdot 1 \cdot (-24)} = \sqrt{4 + 96} = \sqrt{100} = 10 \).

3. Solve for \( y \):

\( y = \frac{-2 \pm 10}{2} = 4 \text{ or } -6 \)

4. Compute \( x \):

\( x = y + 2 \)

\( x = 6 \) or \( -4 \)

Result: The numbers are (6, 4) or (-4, -6).

Example 2: The difference between two numbers is 11, and their sum of squares is 145. What are the numbers?

Solution:

1. Solve the quadratic equation:

\( y^2 + 11y + \frac{11^2 - 145}{2} = 0 \),即 \( y^2 + 11y - 12 = 0 \).

2. Calculate the discriminant:

\( \sqrt{11^2 - 4 \cdot 1 \cdot (-12)} = \sqrt{121 + 48} = \sqrt{169} = 13 \).

3. Solve for \( y \):

\( y = \frac{-11 \pm 13}{2} = 1 \text{ or } -12 \)

4. Compute \( x \):

\( x = y + 11 \)

\( x = 12 \) or \( -1 \)

Result: The numbers are (12, 1) or (-1, -12).