# what would be the way to solve a system of equations like this one?

Solve:

$xy=-30$
$x+y=13$

{15, -2} is a particular solution, but, how would I know if is the only solution, or what would be the way to solve this without "guessing" ?

• The normal way to tackle a system of equations is to start by isolating any of the variables in any of the equations, so that variable can be replaced and you get one less unknown. In your case, you can start by isolating either x or y, in either the first or the second equation. Then you do the same for the remaining of the unknown in the remaining of the equations. When you have isolated all variables like this you know the values of all variables. This method works for many systems but not for all. – HelloGoodbye Sep 11 '14 at 13:00

## 6 Answers

We have in general $$(x+y)^2-4xy=(x-y)^2.$$ In our case that gives $(x-y)^2=289$, so $x-y=\pm 17$.

Now solve the system $x+y=13$, $x-y=17$ and the system $x+y=13$, $x-y=-17$.

Remark: This procedure for finding $x$ and $y$ given their sum and product goes back to Neo-Babylonian times. (Of course, algebraic notation was not used, but an equivalent algorithm was taught.)

• what a very interesting answer! – Trux Sep 10 '14 at 16:07

Start with $$x+y=13 \iff y=13-x$$ so that $$-30=xy=x(13-x)=13x-x^2 \iff x^2-13x-30=0$$ which solves to give $x=-2$ and $x=15$. The corresponding $y$ values are $15$ and $-2$.

The solutions of the system of equations $xy=p$ and $x+y=s$ are the roots of the quadratic equation:

$$x^2-sx+p=0$$ so in your case we solve $$x^2-13x-30=0$$ using the discriminant: $$\Delta=13^2+4\times 30=17^2$$ so the two roots are $$x_1=\frac{13+17}{2}=15\quad;\quad x_2=\frac{13-17}{2}=-2$$

$$xy=-30$$ $$x+y=13$$

from second equation $y=13-x$ then put on first we get $$x(13-x)=-30$$ $$x^2-13x-30=0$$ $$x_{1,2}=\frac{13\pm\sqrt{189}}{2}=\frac{13\pm17}{2}$$ $$x_1=\frac{13+17}{2}=15,x_2=\frac{13-17}{2}=-2$$ $$y_1=13-15=-2,y_2=13-(-2)=15$$ so the solutions are $(15,-2)$ and $(-2,15)$

The other answers here show the strategies of:

$1$) Substitution (the most general). See Kim Jong Un's answer on this question.

$2)$ Solving a quadratic equation that has the roots $x,y$ (this uses the Vieta's formulas). See Sami Ben Romdhane's answer.

$3)$ Using the fact that $(x+y)^2-4xy=(x-y)^2$ to have the numeric value of $x-y$. Then $(x+y)-(x-y)=2y$, an easy way to get the value of $y$. See André Nicolas' answer.

I'm posting another method that works great for this particular problem.

Add the equations in a specific way to get:\begin{align}xy+2(x+y)&=-30+2\cdot 13=-4\\\iff (x+2)(y+2)&=0\end{align}

Thus either $x=-2$ or $y=-2$, which give the solutions $(-2,15)$ and $(15,-2)$, respectively.

The sum

$$x + y = 13 = -a$$

and the product

$$xy = -30 = b$$

gives rise to the quadratic equation

$$z^2 + az + b = 0.$$

Consequently, we have to solve the quadratic equation

$$z^2 - 13z - 30 = 0$$

for $z$, in order to get $x$ and $y$.

Since the discriminant $a^2 - 4b = {17}^2$, $z^2 - 13z - 30$ is factorable as:

$$z^2 - 13z - 30 = (z - 15)(z + 2).$$

Setting it equal to zero, we get the roots: $z = 15$ or $z = -2$.

Since the equations

$$x + y = 13$$

and

$$xy = -30$$

are symmetric in $x$ and $y$, we get the solutions:

$$x = 15, y = -2$$

or

$$x = -2, y = 15.$$