# 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}𝑏$

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

$\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.