# Solving a system of equations using the inverse matrix versus using Gaussian elimination?

To solve the system of equations:

$$2x-3y-4z = 2$$

$$-z = 5$$

$$x-2y+z = 3$$

you could use matrices, the two primary methods I have come across involve using the inverse (method 1) or just using Gaussian elimination straight away on an augmented matrix (method 2). I have attached the two methods below:  My question is whether there is any advantage of using method 1, as you have to carry out the same process as method 2 of Gaussian elimination, but then also have to multiply matrices afterwards, meaning method 2 is surely always quicker? Thanks.

• Personal opinion: Gaussian elimination is better. Fewer intermediate steps so less likely to go wrong. – Sonal_sqrt Aug 30 '19 at 10:49
• since $z$ is given, you can easily substitute and solve 2 equations – farruhota Aug 30 '19 at 11:05
• @farruhota yeah, I was just using the example to specifically learn the matrix method, thanks for pointing it out though! – Jamminermit Aug 30 '19 at 11:39
• There will be no inverse if the system has an infinity or no solutions. – Bernard Massé Aug 30 '19 at 11:45
• There are other ways of computing the inverse besides using Gaussian elimination, which is what you’re doing. – amd Aug 30 '19 at 20:23

If all you want is to solve $$A \vec{x} = \vec{b}$$, where $$A$$ is an invertible matrix, by either
1) Determining $$A^{-1}$$ using Gaussian elimination on $$A$$ augmented with the identity matrix, then computing $$A^{-1} \vec{b}$$, or
2) Using Gaussian elimination on $$A$$ augmented with $$\vec{b}$$,
Probably the main benefit of method one is that you have $$A^{-1}$$ to work with at the end of your problem. Suppose your teacher gives you several problems with the same matrix but different $$\vec{b}$$ vectors. Using method one you only have to use Gaussian elimination once, to find $$A^{-1}$$. After that all you have to do is compute $$A^{-1} \vec{b}$$ for each different $$\vec{b}$$.