# How to solve systems of equations with multiplication & addition.

So I have a system of equations:

$$a + b = 12$$ $$a \cdot b = 36$$

In this case, $a$ and $b$ are both $6$, this can be easily done in your head. However, how can you scale this for larger problems?

-

There are two ways to solve a system of equations, the first one being substitution and other one being elimination. In this case, we will use substitution which requires us to put one variable in terms of another. Currently we have the following equations:

\begin{align} &a + b = 12\\ &a \cdot b = 36\\ \end{align}

Since we have two variables and as I said before, we have to rearrange one in terms of another. We can either choose $a$ or $b$. We'll choose $a$. If rearrange for $a$ we get:

$$a = -b+12$$

Now notice what we can do? Since,we have said that $a = b-12$, we can substitute $a$ into our second equation so we get:

$$(-b+12)(b) = 36$$

Now we can expand and see that we have a quadratic equation: $$-b^2 + 12b = 36$$

Now we bring $36$ to the left side and make equation equal to $0$.

$$-b^2 - 12b - 36 = 0$$

There is no need to get complex here but for future equations, you should check if the equation has $1$, $2$, or no real roots through the discriminant $b^2-4ac$. If the value is below zero then it has no real roots, if it is above zero than it has $2$ real roots and if it is equal to zero then it has $1$ root. In this case, the discriminant is equal to zero and therefore, has only one root.

You can use whatever method you like to solve equation but the answer that you will get is $6$.

-

If you are given numbers $r$ and $s$, and you have to find numbers $a$ and $b$ such that $$a+b=r,\qquad ab=s$$ then you can think about the polynomial $$(x-a)(x-b)=x^2-(a+b)x+ab=x^2-rx+s$$ So, the solutions of the quadratic equation $$x^2-rx+s=0$$ are the numbers $a$ and $b$ that you want. Can you solve a quadratic equation?

-

Solve the first equation for $a$ and substitute it into the second equation.

Then you get a quadratic equation of $b$.

So you just need to solve a quadratic equation to find values of $b$.

Use the first equation to find the values of $a$.

-
So from there I get this, right? (12-b) * b = 36 –  MarJamRob Mar 2 '13 at 5:53
Yes. You are right. –  Primo Mar 2 '13 at 6:07

You want to isolate the variables, so that the definition of one of the variables depends on one of the other variables, making fewer independent unknowns. If a*b=36, that means a=36/b. That means a+b=12 can be phrased as (36/b)+b=12.

As to the scale, that gets you pretty far. It doesn't always reduce the equation to just one unknown, but if you can eliminate them to where only one unknown is in each term (i.e., getting rid of xy makes life easier), you're talking about a system of linear equations. There are methods of finding out which of those equations have any solution, and what kind of solution it has.

-

The following method goes back to Neo-Babylonian times, perhaps earlier. Note that $$(a-b)^2=(a+b)^2-4ab.$$ Thus $a-b=\pm \sqrt{r^2-4s}$.

We now know $a+b$ and $a-b$, and can easily calculate $a$ and $b$.

-
Could you have a look here? After you seeing my message, please, ping me in the chatroom. (I will delete it, since it will be no longer needed.) –  Martin Sleziak Aug 5 at 7:00
@Martin Sleziak: I do not know how to ping in the chatroom, and after having trouble with LaTeX there, stopped using it. I notice that the vandals have struck again, but this time at something mechanical that hundreds of people on the site can explain well. –  André Nicolas Aug 5 at 7:08
If it is really a problem, I will copy the message from the chatroom here: I have noticed that this question was autodeleted and two good answers were removed with it. Maybe they might be salvaged by being moved here: math.stackexchange.com/questions/193668/… (Perhaps with adding explanation that these answers are about the first part of the question, concerning $\sin x+\sqrt3\cos x$.) –  Martin Sleziak Aug 5 at 7:12
BTW since there is no discussion about mathematics in that chatroom, using TeX/MathJax in this room isn't really needed. –  Martin Sleziak Aug 5 at 7:14
@MartinSleziak: Then I would be happy enough to join, if I can find the relevant "room." But here it is past midnight. –  André Nicolas Aug 5 at 7:26