# How to solve systems of three equations?

Either I forgot or never did learn to do it well. I need to solve the following system:

$$9a+3b+c=0$$ $$25a-5b+c=0$$ $$a-b+c=12$$

The first one, is "add the first equation with the third one, this will eliminate an x-term". So I assume that, in my context, this will eliminate at least one term when I try it.

Adding the first with the third one: $$9a+3b+c=0$$ $$a-b+c=12$$ I get: $$10a-2b+2c$$ Aw... No term was removed. So something's not well.

Either my system is wrong or I am not following the instructions well. If you want to know where my system comes from, it is from the following question:

Determine the quadratic function such that $f(3) = 0$, $f(-5) = 0$ and $f(-1)=12$.

If I'm not mistaken, this involves solving the system I got above.

Can you tell me what did I do wrong following those instructions? I'm not really looking for the solution - instead, I'd prefer to understand how to do this.

-

How to solve systems of three [linear] equations?

Don't necessarily take such instructions literally: what you refer to (adding the first equation to the third) was probably correct for the example used in the particular problem demonstrated.

Essentially, solving a system of linear equations (aka Gaussian Elimination) is just like using elementary row operations in matrices, except you have the variables. But how you proceed depends on the coefficients:

$$9a+3b+c=0\tag{1}$$ $$25a-5b+c=0\tag{2}$$ $$a-b+c=12\tag{3}$$

To get you started:

Add $-9(3)$ to $(1)$: that eliminates $a$...

$\;\;-9a + 9 b - 9c = -108$
$+\; 9a + 3b + c = 0$
$= 0\; + 12b - 8c = -108$
$= 3b - 2c = -26\quad\quad\quad\quad (R_1)$

From here you can solve for for $b$ in terms of $c$, then back-substitute, etc.

Or, you can eliminate, say, $c$ altogether to solve for $b$:

For example, you can use $-25(\text{equation }\;3) + (\text{equation}\;2)$ to get a second equation without the $a$ variable...

$-25a + 25b - 25c = 300$
$+\; 25a - 5b + \;\;c = \;\;0$
$= 0\;\;20b - 24c = 300$
$= 5b - 6c = 75\quad\quad\quad\quad (R_2)$

Now continue the process using $3(R_1)+(R_2)$ to get rid of the $c$-term...

Then back substitute to solve for $b$, and then using $b, c$ solve for $a$.

-
RHS should be -108, I believe. Need to multiply both sides of $(3)$ by $-9$. –  icurays1 Dec 7 '12 at 2:59

Determine the quadratic function such that $f(3) = 0$, $f(-5) = 0$ and $f(-1) = 12$.

Any quadratic polynomial will have only two roots. From the question, you know that the only two roots are $3$ and $-5$. Hence, we have $$f(x) = a(x-3)(x+5)$$ In addition, we are given thaat $f(-1) = 12$. This implies $$a(-4)(4) = 12 \implies a = -\dfrac34$$ Hence, $$f(x) = -\dfrac34 (x-3)(x+5) = \dfrac34(3-x)(x+5)$$ To solve by your method, subtract equation $3$ from $1$ and $3$ from $2$ to eliminate $c$. If we do this, we then get that $$8a+4b = -12$$ $$24a-4b = -12$$ Add the above two equations to get $$32a = - 24 \implies a = - \dfrac34$$ We have $8a+4b = -12 \implies 4b = - 12 +6 = -6 \implies b = - \dfrac32$. Now that we have values for $a$ and $b$ plug it in any of the three original equations you had to get that $c = \dfrac{45}4$.

-

@Marvis' answer is the best way to go about getting that quadratic, but to answer "how do I solve this system of linear equations", the answer is: you can do other operations besides adding two equations to each other. In particular, you can add a multiple of one equation to another. So, if you wanted to eliminate $a$ from the first equation, you could multiply the third equation by $-9$ then add it to the first: \begin{align*} -9(a-b+c)&=-9\cdot 12\\ + (9a+3b+c)&=0\\ \Rightarrow -9a+9a+9b+3b-9c+c&=-9\cdot 12 \end{align*}

The first equation would then read:

$$12b-8c=-108$$

From here you could put $b$ in terms of $c$, and substitute, etc. This process is called Gaussian elimination. There are lots of good YouTube videos on the subject as well.

-