solve a system of equations by matrices

99 Views Asked by At

Is there any way to solve the system of linear equations by matrices ??

for example:

$$\left\{\begin{aligned} 2x+3y-z&=p \\ px+(p+1)y-pz&=1 \\ x+y+pz&=2 \end{aligned} \right. $$

Thank you :)

1

There are 1 best solutions below

2
On

You can write this system as a matrix (assuming $p$ is known - if not, it will not be a system of linear equations):

$$\underbrace{\begin{bmatrix}2 & 3 & -1 \\ p & p+1 & -p \\ 1 & 1 & p \end{bmatrix}}_A \underbrace{\begin{bmatrix}x \\ y \\ z \end{bmatrix}}_v = \underbrace{\begin{bmatrix}p \\ 1 \\ 2\end{bmatrix}}_b$$

So the solution is $$v = A^{-1} b,$$ so all you have to do is invert $A$ and multipy it (the inverse of $A$) with $b$ in order to get $v$. This can be done easiest via Gauss algorithm if you have to do it by hand with no other means.