Formula(/How) to find 2 numbers that add together to give one number and times to give another

24.4k Views Asked by At

I have $2$ numbers $a, b$. I need a formula (or a how to) to find which $2$ numbers $c,d$ will add together to give a and times together to give $b$. So

$c + d = a$
$c \cdot d = b$

3

There are 3 best solutions below

1
On BEST ANSWER

Consider the quadratic

$$(x-c)(x-d) = x^2 -(c+d)x + cd = x^2 - ax +b$$

Thus the roots of $$x^2 -ax + b = 0$$ are your numbers $c$ and $d$.

The roots are given by

$$\frac{ a \pm \sqrt{a^2 -4b}}{2}$$

Check this page out for more information: Quadratic Equation.

0
On

HINT $\rm\quad (X - c)\: (X - d) \; =\; X^2 - a\ X + b $

7
On

Since I'm not so smart to imagine that the solution has anything to do with Vieta formulae or roots of polynomials, ;-) I'd try the following. First, let me call your unknowns $c,d$ with letters that look like unkowns (I've tried to do the problem with $c,d$ and at a certain point I forgot which among $a,b,c,d$ were the unkowns and which the data). So let $x = c$ and $y =d$. Your system becomes

$$ \begin{align} x + y &= a \\ xy &= b \ . \end{align} $$

Now, do what you would do in those cases. For instance, solve the first equation for $x$ in terms of $y$:

$$ x = a -y \ . $$

Then substitute this expression for $x$ into the second equation:

$$ (a-y)y = b \ . $$

And, surprise!, you've got a polynomial equation

$$ y^2 -ay + b = 0 $$

that looks like the ones I've been told. (So this Vieta must have been a really smart guy, but you've rediscovered his trick.)

And, of course, once you've got the solutions $y$ of this second degree equation, you should use $x = a-y$ to find $x$... (Just to find out that if $y$ is one of the roots of the last polynomial equation, $x$ is the other one.)