System of Linear Equations Solution

Learn about the system of linear equations of matrices using R, Rcpp, Armadillo, and Eigen.

System of linear equations

A system of linear equations takes the following form:

𝐴π‘₯=𝑏𝐴π‘₯ = 𝑏

In this equation:

  • 𝐴𝐴 is a square coefficient matrix.
  • π‘₯π‘₯ is the vector of unknowns.
  • 𝑏𝑏 is the RHS (right hand side) vector.

It can be solved by multiplying the inverse of matrix 𝐴𝐴 by RHS constant vector 𝑏𝑏:

π‘₯=π΄βˆ’1𝑏π‘₯ = 𝐴^{βˆ’1}𝑏

Let’s suppose, the system of linear equations is formed by two equations and two unknowns:

x1Β βˆ’Β 1βˆ—x2=22βˆ—x1Β +Β 2βˆ—x2=1\begin{alignat}{2} x_1 \space - \space 1*x_2=2\\ 2*x_1 \space + \space 2*x_2 = 1 \end{alignat}

Get hands-on with 1200+ tech skills courses.