Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question

5 Answers 5

up vote 2 down vote accepted

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$.

share|improve this answer

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?

share|improve this answer

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$.

share|improve this answer
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.

share|improve this answer

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$.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.