> [!summary]
This note simplifies a system of linear equations by using matrices and vector manipulation.
>
**Key Result:**
$A \vec{x} = x_{1} \vec{a_{1}} + x_{2} \vec{a_{2}}+ \dots + x_{n} \vec{a_{n}} = \vec{b}$
>[!info]+ Read Time
**⏱ 3 mins**
# Definition
Matrix-vector multiplication manipulation of a system of [[Linear Equations|linear equations]] into a [[Matrix Notation|coefficient matrix]] and the associated [[Scalar & Vectors|vector]].
## Derivation
> [!warning] Assumptions
To derive an equation for matrix-vector multiplication, assume the following:
> - A [[Linear Equations|system of linear equations]], with $m$ equations and $n$ variables, looks like:
> $
\begin{align*}
a_{1}x_{1} + a_{2}x_{2} \dots a_{n}x_{n} &=b_{1} \\
a_{21}x_{1} + a_{22}x_{2} \dots a_{2n}x_{n}&=b_{2} \\
\vdots\\
a_{m1}x_{1} + a_{m2}x_{2} \dots a_{mn}x_{n}&=b_{m}
\end{align*}
> $
> - The [[Matrix Notation|coefficient matrix]] is denoted as:
> $
A =
\begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{pmatrix}
> $
> - The [[Row & Columns Vectors|column vector]] is denoted as:
> $c_{n} = \begin{bmatrix}
a_{1n} \\
a_{2n} \\
\vdots \\
a_{mn}
\end{bmatrix}
> $
> - From the properties of [[!! Properties of Matrix Addition & Scalar Multiplication|matrix addition and multiplication]] two matrices can be added together to give the result $\begin{bmatrix} a \\ b\end{bmatrix}+ \begin{bmatrix} c \\ d \end{bmatrix}=\begin{bmatrix}ac \\ bd\end{bmatrix}$
Given a system of linear equation the linear equations can be rewritten using the column vector to denote the constants ($a_{mn}$) and the solution values $b_{m}$ to give the following result.
$
x_1
\begin{bmatrix}
a_{11} \\
a_{21} \\
\vdots \\
a_{m1}
\end{bmatrix}
+
x_2
\begin{bmatrix}
a_{12} \\
a_{22} \\
\vdots \\
a_{m2}
\end{bmatrix}
+ \cdots +
x_n
\begin{bmatrix}
a_{1n} \\
a_{2n} \\
\vdots \\
a_{mn}
\end{bmatrix}
=
\begin{bmatrix}
b_1 \\
b_2 \\
\vdots \\
b_m
\end{bmatrix}
$
The constant column vectors are in $\mathbb{R}^m$. The unknown variables ($x_{1}+\dots+x_{n}$) are in $\mathbb{R}^n$. The resultant variables ($b_{1}\dots b_{m}$) is in $\mathbb{R}^m$. Combining the constant columns vector and multiplying it with unknown variables gives the following result.
> [!note]
The variables ($x_{1}+\dots+x_{n}$) are written as a matrix with $n$ columns or $\begin{bmatrix} x_{1} \\ x_{2} \\ \vdots \\ x_{n}\end{bmatrix}$
$
\underbrace{ \begin{bmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{bmatrix} }_{ A }
\underbrace{ \begin{bmatrix}
x_1 \\
x_2 \\
\vdots \\
x_n
\end{bmatrix} }_{ \vec{x} }
=
\underbrace{ \begin{bmatrix}
b_1 \\
b_2 \\
\vdots \\
b_m
\end{bmatrix} }_{ \vec{b} }
$
> [!bug] Simplification
This is often simplified in the following ways:
> - Letting the whole constant matrix be written as $A$
> - Letting each column vector and solutions values be written as vector (e.g. $\begin{bmatrix}a_{11} \\a_{21} \\\vdots \\a_{m1}\end{bmatrix}=\vec{a_{1}}$)
> - The variables and constant vectors can be written as [[Vector Equations|a vector equation]]
This simplification results in:
$
A \vec{x} = x_{1} \vec{a_{1}} + x_{2} \vec{a_{2}}+ \dots + x_{n} \vec{a_{n}} = \vec{b}
$
# Resources
<iframe width="560" height="315" src="https://www.youtube.com/embed/4uJNuGfbxLg?si=wSlSdGZNLsTeFIM7" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>