# Fundamental Mathematics/Matrix/System of linear equations

## System of linear equations

System of linear equation of 2 variables has general form

${\displaystyle A_{11}x+A_{12}y=C_{1}}$
${\displaystyle A_{21}x+A_{22}y=C_{2}}$

Which can be written as matrix

${\displaystyle [A_{11}|A_{12}][x]=[C_{1}]}$
${\displaystyle [A_{21}|A_{22}][y]=[C_{2}]}$

### To solve for y value

Divide 1st equation by A11 and 2nd equation by A21

${\displaystyle x+{\frac {A_{12}}{A_{11}}}y={\frac {C_{1}}{A_{11}}}}$
${\displaystyle x+{\frac {A_{22}}{A_{21}}}y={\frac {C_{2}}{A_{21}}}}$

Subtract 2 equation above

${\displaystyle y{\frac {A_{12}}{A_{11}}}-{\frac {A_{22}}{A_{21}}}={\frac {C_{1}}{A_{11}}}-{\frac {C_{2}}{A_{21}}}}$
${\displaystyle y={\frac {{\frac {C_{1}}{A_{11}}}-{\frac {C_{2}}{A_{21}}}}{{\frac {A_{12}}{A_{11}}}-{\frac {A_{22}}{A_{21}}}}}}$
${\displaystyle [A_{11}C_{1}]}$
${\displaystyle [A_{12}C_{2}]}$
${\displaystyle ----}$
${\displaystyle [A_{11}A_{12}]}$
${\displaystyle [A_{21}A_{22}]}$

### To solve for x value

Divide 1st equation by A12 and 2nd equation by A22

${\displaystyle {\frac {A_{11}}{A_{12}}}x+y={\frac {C_{1}}{A_{12}}}}$
${\displaystyle {\frac {A_{21}}{A_{22}}}x+y={\frac {C_{2}}{A_{22}}}}$

Subtract 2 equation above

${\displaystyle x{\frac {A_{11}}{A_{12}}}-{\frac {A_{21}}{A_{22}}}={\frac {C_{1}}{A_{12}}}-{\frac {C_{2}}{A_{22}}}}$
${\displaystyle x={\frac {{\frac {C_{1}}{A_{12}}}-{\frac {C_{2}}{A_{22}}}}{{\frac {A_{11}}{A_{12}}}-{\frac {A_{21}}{A_{22}}}}}}$