# Finding two numbers given their sum and their product

The other day I was messing around on Gbrainy and I was asked a question "which 2 numbers when added together =16, and when multiplied together =55." I know the X and Y are 5 and 11 but I wanted to see if I could algebraically solve it, and after using an entire sheet of paper trying to do so...I couldn't. So my question is for something like this that isn't as easy how could I solve it without knowing that it is 5 and 11? In x+y=16, I know x=16/y but when I plug it back in I get something like 16/y + y = 16, then I multiply the left side by 16 to get 2y=256 and then ultimately y=128. Am I doing something wrong? But still, if given a harder question along these same lines, how could I solve it? I feel like I should be using substitution or a matrix. I even tried doing something like f(x) to replace y with after I solved for it and then just crunching x values but I got pretty lost doing that.

-
How do you know it's easy if you haven't solved it? Anyway, you're not multiplying by $16$ correctly, and you don't want to multiply by $16$ anyway. Try multiplying by $y$. Also, you get $x = \frac{55}{y}$. –  Qiaochu Yuan Jul 16 '12 at 5:10
Note: typically you want to use a matrix to solve a system of linear equations. If you set up the problem as in the answers below and use $xy = 55$, you are no longer using a linear equation. –  The Chaz 2.0 Jul 16 '12 at 5:25

Our two equations are: $$x + y = 16 \tag{1}$$ $$xy = 55\tag{2}$$

Rewriting equation (1) in terms of just $y =$ something, we get:

$$y = 16-x$$

Substituting this into equation (2) leaves us: $$x(16-x) = 55$$ $$16x-x^2=55 \implies x = 5 \ \ \text{or} \ \ 11$$

which can be easily seen by factoring or using the quadratic formula. It follows that $y=11|x=5$ and $y=5|x=11$.

Thus your solutions in terms of $(x,y)$ are $(5,11)$ and $(11,5)$.

-
By factoring or using the quadratic formula? Do you have a method of factoring quadratics that doesn't involve finding its roots first? –  Henning Makholm Jul 16 '12 at 10:58

Here is another method: suppose you are told that two numbers, $x$ and $y$, have a certain sum $x+y=S$, and a certain product $xy=P$. How to find $S$ and $P$?

We can use the fact that we know how to solve quadratic equations. Notice that $$(t-x)(t-y) = t^2 - (x+y)t + xy = t^2 - St + P.$$

That means that $x$ and $y$ are precisely the solutions to $$t^2 - St + P = 0.$$

In your specific case, $S=16$ and $P=55$. So we want to find the solutions to $$t^2 - 16t + 55 = 0.$$

The quadratic formula gives $$t = \frac{16 \pm\sqrt{256 - 220}}{2} = 8 \pm\frac{1}{2}\sqrt{36} = 8\pm\frac{6}{2} = \left\{\begin{array}{l} 11\\ 5 \end{array}\right.$$ So the two numbers are $5$ and $11$.

(Of course, we often solve quadratic equations $t^2 + at + b=0$ by figuring out by eyeballing two numbers whose product is $b$ and whose sum is $-a$, but we can always use the quadratic formula to take the guessing out of it.)

-

We are trying to solve the system of equations $x+y=16$, $xy=55$. Here are a couple of systematic approaches that work in general.

Approach $1$: We will use the identity $(x+y)^2-4xy=(x-y)^2$. In our case, we have $(x+y)^2=256$, $4xy=220$, so $(x-y)^2=36$, giving $x-y=\pm 6$.

Using $x+y=16$, $x-y=6$, we get by adding that $2x=22$, and therefore $x=11$. It follows that $y=5$.

The possibility $x+y=16$, $x-y=-6$ gives nothing new. Adding, we get $2x=10$, so $x=5$, and therefore $y=11$.

Approach $2$: From $x+y=16$, we get $y=16-x$. Substitute for $y$ in $xy=55$. We get $x(16-x)=55$. Simplification gives $x^2-16x+55=0$. The quadratic factors as $(x-5)(x-11)$, so our equation becomes $(x-5)(x-11)=0$, which has the solutions $x=5$ and $x=11$.

But we cannot necessarily rely on there being such a straightforward factorization. So in general after we get to the stage $x^2-16x+55=0$, we would use the Quadratic Formula. We get $$x=\frac{16\pm\sqrt{(-16)^2-4(55)}}{2}.$$
Compute. We get the solutions $x=5$ and $x=11$. The corresponding $y$ are now easy to find from $x+y=16$.

Remarks: Recall that the Quadratic Formula says that if $a\ne 0$, then the solutions of the quadratic equation $ax^2+bx+c=0$ are given by $$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}.$$

Your approach was along reasonable lines, but things went wrong in the details. From $xy=55$ we get $x=\frac{55}{y}$. Substituting in the formula $x+y=16$, we get $$\frac{55}{y}+y=16.$$ A reasonable strategy is to multiply through by $y$, getting $55+y^2=16y$, or equivalently $y^2-16y+55=0$. Now we have reached a quadratic equation which is basically the same as the one we reached above.

-

The average of x and y is 16/2 = 8, their product is xy = 55 therefore: x, y = 8 plus or minus sqrt of 8 square minus 55 = 8 +/- sqrt of 9 = 8 +/- 3, x, y = 11, 5

by: GeorgeB reference: Vedic Book

-