big rename

This commit is contained in:
2021-12-23 15:41:07 +00:00
parent f8d7ee4668
commit 51a5b12813
92 changed files with 0 additions and 892 deletions

View File

@@ -0,0 +1,174 @@
---
author: Alvie Rahman
date: \today
title: MMME1026 // Calculus
tags: [ uni, nottingham, mechanical, engineering, mmme1026, maths, calculus ]
---
# Calculus of One Variable Functions
## Key Terms
<details>
<summary>
### Function
A function is a rule that assigns a **unique** value $f(x)$ to each value $x$ in a given *domain*.
</summary>
The set of value taken by $f(x)$ when $x$ takes all possible value in the domain is the *range* of
$f(x)$.
</details>
<details>
<summary>
### Rational Functions
A function of the type
$$ \frac{f(x)}{g(x)} $$
</summary>
where $f$ and $g$ are polynomials, is called a rational function.
Its range has to exclude all those values of $x$ where $g(x) = 0$.
</details>
<details>
<summary>
### Inverse Functions
Consider the function $f(x) = y$.
If $f$ is such that for each $y$ in the range there is exactly one $x$ in the domain,
we can define the inverse $f^{-1}$ as:
$$f^{-1}(y) = f^{-1}(f(x)) = x$$
</summary>
</details>
<details>
<summary>
### Limits
Consider the following:
$$f(x) = \frac{\sin x}{x}$$
The value of the function can be easily calculated when $x \neq 0$, but when $x=0$, we get the
expression $\frac{\sin 0 }{0}$.
However, when we evaluate $f(x)$ for values that approach 0, those values of $f(x)$ approach 1.
This suggests defining the limit of a function
$$\lim_{x \rightarrow a} f(x)$$
to be the limiting value, if it exists, of $f(x)$ as $x$ gets approaches $a$.
</summary>
#### Limits from Above and Below
Sometimes approaching 0 with small positive values of $x$ gives you a different limit from
approaching with small negative values of $x$.
The limit you get from approaching 0 with positive values is known as the limit from above:
$$\lim_{x \rightarrow a^+} f(x)$$
and with negative values is known as the limit from below:
$$\lim_{x \rightarrow a^-} f(x)$$
If the two limits are equal, we simply refer to the *limit*.
</details>
## Important Functions
<details>
<summary>
### Exponential Functions
$$f(x) = e^x = \exp x$$
</summary>
It can also be written as an infinite series:
$$\exp x = e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + ...$$
The two important limits to know are:
- as $x \rightarrow + \infty$, $\exp x \rightarrow +\infty$ ($e^x \rightarrow +\infty$)
- as $x \rightarrow -\infty$, $\exp x \rightarrow 0$ ($e^x \rightarrow 0$)
Note that $e^x > 0$ for all real values of $x$.
</details>
<details>
<summary>
### Hyperbolic Functions (sinh and cosh)
The hyperbolic sine ($\sinh$) and hyperbolic cosine function ($\cosh$) are defined by:
$$\sinh x = \frac 1 2 (e^x - e^{-x}) \text{ and } \cosh x = \frac 1 2 (e^x + e^{-x})$$
$$\tanh = \frac{\sinh x}{\cosh x}$$
</summary>
![[Fylwind at English Wikipedia, Public domain, via Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Sinh_cosh_tanh.svg)](./images/Sinh_cosh_tanh.svg)
Some key facts about these functions:
- $\cosh$ has even symmetry and $\sinh$ and $\tanh$ have odd symmetry
- as $x \rightarrow + \infty$, $\cosh x \rightarrow +\infty$ and $\sinh x \rightarrow +\infty$
- $\cosh^2x - \sinh^2x = 1$
- $\tanh$'s limits are -1 and +1
- Derivatives:
- $\frac{\mathrm{d}}{\mathrm{d}x} \sinh x = \cosh x$
- $\frac{\mathrm{d}}{\mathrm{d}x} \cosh x = \sinh x$
- $\frac{\mathrm{d}}{\mathrm{d}x} \tanh x = \frac{1}{\cosh^2x}$
</details>
<details>
<summary>
### Natural Logarithm
$$\ln{e^y} = \ln{\exp y} = y$$
</summary>
Since the exponential of any real number is positive, the domain of $\ln$ is $x > 0$.
</details>
<details>
<summary>
### Implicit Functions
An implicit function takes the form
$$f(x, y) = 0$$
</summary>
To draw the curve of an implicit function you have to rewrite it in the form $y = f(x)$.
There may be more than one $y$ value for each $x$ value.
</details>

View File

@@ -0,0 +1,390 @@
---
author: Alvie Rahman
date: \today
title: MMME1026 // Complex Numbers
tags: [ uni, nottingham, mechanical, engineering, mmme1026, maths, complex_numbers ]
---
# Complex Numbers
## What is a Complex Number?
- $i$ is the unit imaginary number, which is defined by:
$$ i^2 = -1 $$
- An arbritary complex number is written in the form
$$z = x + iy$$
Where:
- $x$ is the real part of $z$ (which you may seen written as $\Re(z) = x$ or Re$(z) = x$)
- $y$ is the imaginary part of $z$ (which you may seen written as $\Im(z) = y$ or Im$(z) = y$)
- Two complex numbers are equal if both their real and imaginary parts are equal
e.g. $$(3 + 4i) + (1 -2i) = (3+1) + i(4-2) = 2 + 2i$$
### The Complex Conjugate
Given complex number $z$:
$$z = z + iy$$
The complex conjugate of z, $\bar z$ is:
$$\bar{z} = z -iy$$
### Division of Complex Numbers
- Multiply numerator and denominator by the conjugate of the denominator
<details>
<summary>
#### Example
</summary>
> \begin{align*}
z_1 &= 5 + i \\
z_2 &= 1 -i \\
\\
\frac{z_1}{z_2} &= \frac{5+i}{1-i} \cdot \frac{\bar{z_2}}{\bar{z_2}} = \frac{(5+i)(1+i)}{(1-i)(1+i)} \\
&= \frac{5 + i + 5i -1}{1 + 1} \\
&= \frac{4 + 6i}{2} = 2 + 3i
> \end{align*}
</details>
### Algebra and Conjugation
When taking complex conjugate of an algebraic expresion, we can replace $i$ by $-i$ before or after
doing the algebraic operations:
\begin{align*}
\overline{z_1+z_2} &= \bar{z_1}+\bar{z_2} \\
\overline{z_1z_2} &= \bar{z_1}\bar{z_2} \\
\overline{z_1/z_2} &= \frac{\bar{z_1}}{\bar{z_2}}
\end{align*}
The conjugate of a real number is the same as that number.
#### Application
If $z$ is a root of the polynomial equation
$$0 = az^2 + bz + c$$
with **real** coefficients $a$, $b$, and $c$, then $\bar{z}$ is also a root because
\begin{align*}
0 &= \overline{az^2 + bz + c} \\
&= \bar{a}\bar{z}^2 + \bar{b}\bar{z} + \bar{c} \\
&= a\bar{z}^2 + b\bar{z} + c
\end{align*}
### The Argand Diagram
A general complex number $z = x + iy$ has two components so it can can be represented as a point in
the plane with Cartesion coordinates $(x, y)$.
\begin{align*}
4-2i &\leftrightarrow (4, -2) \\
-i &\leftrightarrow (0, -1) \\
z &\leftrightarrow (x, y) \\
\bar z &\leftrightarrow (x, -y)
\end{align*}
### Plotting on a Polar Graph
We can also describe points in the complex plain with polar coordinates $(r, \theta)$:
\begin{align*}
z &= r(\cos\theta + i\sin\theta) &\text{ polar form of $z$} \\
r &= \sqrt{x^2+y^2} &\text{(modulus)}\\
\theta &= \arg z,\text{ where} \tan \theta = \frac y x &\text{(argument)} \\
x &= r\cos \theta \\
y &= r\sin \theta
\end{align*}
Be careful when turning $(x, y)$ into $(r, \theta)$ form as $\tan^{-1} \frac y x = \theta$ does not
always hold true as there are many solutions.
#### Choosing $\theta$ Correctly
1. Determine which quadrant the point is in (draw a picture).
2. Find a value of $\theta$ such that $\tan \theta = \frac y x$ and check that it is consistent.
If it puts you in the wrong quadrant, add or subtract $\pi$.
## Exponential Functions
- The exponential function $f(x) = \exp x$ may be wirtten as an infinite series:
$$\exp x = e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots $$
- The function $f(x) = e^{-x}$ is just $\frac 1 {e^x}$
- Note the important properties:
\begin{align*}
e^{a+b} &= e^a e^b \\
(e^a)^b &= e^{ab}
\end{align*}
## Euler's Formula
$$e^{i\theta} = \cos\theta + i\sin\theta$$
- Properties of $e^{i\theta}$: For any real angle $\theta$ we have
$$|e^{i\theta}| = |\cos\theta + i\sin\theta| = \sqrt{\cos^2\theta + \sin^2\theta} = 1$$
and
$$ \arg {e^{i\theta}} = \theta $$
- A complex number in *polar form*, where $r = |z|$, and $\theta = \arg z$, may alternatively be
written in its *exponential form*:
$$z = re^{i\theta}$$
**Note**: $$\bar z = r\cos\theta - ir\sin\theta = re^{-i\theta}$$
<details>
<summary>
### Example 1
Write $z = -1 + i$ in exponential form
</summary>
> $\arg z = \frac {3\pi} 4$
> $|z| = \sqrt 2$
>
> So $z = \sqrt2e^{i\frac{3\pi} 4}$
</details>
<details>
<summary>
### Example 2
The equations for a mechanical vibration problem are found to have the following mathematical
solution:
$$z(t) = \frac{e^{i\omega t}}{\omega_0^2-\omega^2 + i\gamma}$$
</summary>
where $t$ represents time and $\omega$, $\omega_0$ and $\gamma$ are all positive real physical
constants.
Although $z(t)$
is complex and cannot directly represent a physical solution, it turns out that the real and
imaginary parts $x(t)$ and $y(t)$ in $z(t) = x(t) + iy(t)$ can. Polar notation can be used to extract
this physical information efficiently as follows:
a. Put the denominator in the form
$$ae^{i\delta}$$
where you should give explicit expressions for $a$ and $\delta$ in terms of $\gamma$, $\gamma_0$,
and $\gamma$.
> \begin{align*}
a &= \sqrt{\gamma^2 + (\omega_0^2 - \omega^2)^2} \\
\delta &= \tan^{-1}\frac \delta {\omega_0^2 - \omega^2}
> \end{align*}
b. Hence find the constants $b$ and $\varphi$ such that
$$x(t) = b\cos(\omega t + \varphi)$$
and write a similar expression for $y(t)$.
> \begin{align*}
z &= \frac{e^i\omega t}{ae^{i\delta}} = \frac 1 a e^{i (\omega t - \delta)} \\
x + iy &= \frac 1 a \cos(\omega t - \delta) + \frac 1 a \sin(\omega t - \delta) \\
\therefore \Re z &= x = \frac 1 a \cos(\omega t - \delta), \\
\Im z &= y = \frac 1 a \sin(\omega t - \delta) \\
\\
b &= \frac 1 a = \frac 1 {\sqrt{\gamma^2 + (\omega_0^2 - \omega^2)^2}} \\
\varphi &= -\delta = \tan^{-1}\frac \delta {\omega_0^2 - \omega^2}\\
\\
y(t) &= \frac 1 a \sin(\omega t - \delta) \\
> \end{align*}
</details>
## Products of Complex Numbers
Suppose we have 2 complex numbers:
$$z_1 = x_1 + iy_1 = r_1e^{i\theta_1}$$
$$z_2 = x_2 + iy_2 = r_2e^{i\theta_2}$$
Using $e^a e^b = e^{a+b}$, the product is:
\begin{align*}
z_3 = z_1 z_2 &= (r_1e^{i\theta_1})(r_2e^{i\theta_2}) \\
&= r_1r_2e^{i\theta_1}e^{i\theta_2} \\
&= r_1r_2e^{i(\theta_1+\theta_2)} \\
\\
|z_1z_2| &= |z_1|\times|z_2| \\
\arg z_1z_2 &= \arg z_1 \times \arg z_2
\end{align*}
## de Moivre's Theorem
Let $z = re^{i\theta}$. Consider $z^n$.
Since $z = r(\cos\theta + i\sin\theta)$,
\begin{align*}
z^n &= r^n(\cos\theta + i\sin\theta)^n &\text{(1)} \\
\end{align*}
But also
\begin{align*}
z^n &= (re^{i\theta})^n \\
&= r^n(e^{i\theta})^n \\
&= r^ne^{in\theta} \\
&= r^n(\cos{n\theta} + i\sin{n\theta}) &\text{(2)} \\
\end{align*}
By equating (1) and (2), we find de Moivre's theorem:
\begin{align*}
r^n(\cos\theta +i\sin\theta)^n &= r^n(\cos{n\theta} + i\sin{n\theta}) \\
(\cos\theta +i\sin\theta)^n &= (\cos{n\theta} + i\sin{n\theta})
\end{align*}
<details>
<summary>
### Example 1
Write $1+i$ in polar form and use de Moivre's theorem to calculate $(1+i)^{15}$.
</summary>
> \begin{align*}
r &= |1+i| = \sqrt2 \\
\theta &= \arg{1+i} = \frac \pi 4 \\
\\
\text{So } 1 + i &= \sqrt2(\cos{\frac pi 4} + i\sin{\frac \pi 4}) = \sqrt2e^{i\frac \pi 4} \text{ and}\\
(i+i)^{15} &= (\sqrt2)^{15}\left(\cos{\frac \pi 4} + i\sin{\frac \pi 4}\right)^{15} \\
&= 2^{\frac 15 2} \left(\cos{\frac{15\pi} 4} + i\sin{\frac{15\pi} 4}\right) \\
&= 2^{\frac 15 2} \left(\frac 1 {\sqrt2} - \frac i {\sqrt2}\right) \\
&= 2^7 (1 - i) \\
&= 128 - 128i
> \end{align*}
</details>
<details>
<summary>
### Example 2
Use de Moivre's theorem to show that
\begin{align*}
\cos{2\theta} &= \cos^2\theta-\sin^2\theta \\
\text{and} \\
\sin{2\theta} &= 2\sin\theta\cos\theta
\end{align*}
</summary>
> Let $n=2$:
> \begin{align*}
(\cos\theta+i\sin\theta)^2 &= \cos^2\theta + 2i\sin\theta\cos\theta - \sin^2\theta \\
\text{Real part: } \cos^2\theta - \sin^2\theta &= \cos{2\theta}\\
\text{Imaginary part: } 2\sin\theta\cos\theta &= \sin{2\theta}
> \end{align*}
</details>
<details>
<summary>
### Example 3
Given that $n \in \mathbb{N}$ and $\omega = -1 + i$, show that
$w^n + \bar{w}^n = 2^{\frac n 2 + 1}\cos{\frac{3n\pi} 4}$ with Euler's formula.
</summary>
> \begin{align*}
r &= \sqrt{2} \\
\arg \omega = \theta &= \frac 3 4 \pi \\
\\
\omega^n &= r^n(cos{n\theta} + i\sin{n\theta}) \\
\bar\omega^n &= r^n(cos{n\theta} - i\sin{n\theta}) \\
\omega^n + \bar\omega^n &= r^n(2\cos{n\theta}) \\
&= 2^{\frac n 2 + 1}\cos{\frac {3n\pi} 4}
> \end{align*}
</details>
## Complex Roots of Polynomials
<details>
<summary>
### Example
Find which complex numbers $z$ satisfy
$$z^3 = 8i$$
</summary>
> 1. Write $8i$ in exponential form,
>
> $|8i| = 8$ and $\arg{8i} = \frac \pi 2$
>
> $\therefore 8i = 8e^{i\frac \pi 2}$
>
>
> 2. Let the solution be $r = re^{i\theta}$.
>
> Then $z^3 = r^3e^{3i\theta}$.
>
> 3. $z^3 = r^3e^{3i\theta} = 8e^{i\frac \pi 2}$
>
> i. Compare modulus:
>
> $r^3 = 8 \rightarrow r = 2$
>
> ii. Compare argument:
>
> $$3\theta = \frac \pi 2$$
>
> is a solution but there are others since
>
> $$e^{i\frac \pi 2} = e^{i \frac \pi 2 + 2n\pi}$$
>
> so we get a solution whenever
>
> $$3\theta = \frac \pi 2 + 2n\pi$$
>
> for any integer `n`
>
> - $n = 0 \rightarrow z = \sqrt3 + i$
> - $n = 1 \rightarrow z = -\sqrt3 + i$
> - $n = 2 \rightarrow z = -2i$
> - $n = 3 \rightarrow z = \sqrt3 + i$
> - $n = 4 \rightarrow z = -\sqrt3 + i$
> - The solutions start repeating as you can see
>
> In general, an $n$-th order polynomial has exactly $n$ complex roots.
> Some of these complex roots may be real numbers.
>
> 4. There are three solutions
</details>

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -0,0 +1,265 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with matplotlib (http://matplotlib.org/) -->
<svg id="svg6564" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="403pt" width="403pt" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 403 403" xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs>
<style id="style6568" type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:100000;}</style>
<path id="m6d0dc4c4e2" stroke-width=".5" d="m0 0v-4" stroke="#000"/>
<path id="m2997e254fe" stroke-width=".5" d="m0 0v4" stroke="#000"/>
<path id="BitstreamVeraSans-Roman-31" d="m12.406 8.2969h16.11v55.625l-17.532-3.516v8.985l17.438 3.515h9.859v-64.609l16.11-0.0001v-8.2969h-41.985z"/>
<path id="BitstreamVeraSans-Roman-2212" d="m10.594 35.5h62.594v-8.297h-62.594z"/>
<path id="BitstreamVeraSans-Roman-30" d="m31.781 66.406q-7.609 0-11.453-7.5-3.828-7.484-3.828-22.531 0-14.984 3.828-22.484 3.844-7.5004 11.453-7.5004 7.672 0 11.5 7.5004 3.844 7.5 3.844 22.484 0 15.047-3.844 22.531-3.828 7.5-11.5 7.5m0 7.813q12.266 0 18.735-9.703 6.468-9.688 6.468-28.141 0-18.406-6.468-28.109-6.469-9.6879-18.735-9.6879-12.25 0-18.719 9.6875-6.4682 9.7034-6.4682 28.109 0 18.453 6.4682 28.141 6.469 9.703 18.719 9.703"/>
<path id="BitstreamVeraSans-Roman-78" d="m54.891 54.688l-19.782-26.61 20.797-28.078h-10.594l-15.921 21.484-15.907-21.484h-10.609l21.25 28.609-19.438 26.079h10.594l14.5-19.485 14.5 19.485z"/>
<path id="md69bb88a81" stroke-width=".5" d="m0 0h4" stroke="#000"/>
<path id="m1d1e712049" stroke-width=".5" d="m0 0h-4" stroke="#000"/>
<path id="BitstreamVeraSans-Roman-79" d="m32.172-5.0781q-3.797-9.7659-7.422-12.734-3.609-2.985-9.656-2.985h-7.1878v7.516h5.2818q3.703 0 5.75 1.765 2.062 1.7504 4.546 8.2972l1.61 4.0938-22.11 53.813h9.516l17.094-42.766 17.094 42.766h9.515z"/>
<path id="BitstreamVeraSans-Roman-3d" d="m10.594 45.406h62.594v-8.203h-62.594zm0-19.922h62.594v-8.296h-62.594z"/>
<path id="BitstreamVeraSans-Roman-28" d="m31 75.875q-6.531-11.219-9.719-22.219-3.172-10.984-3.172-22.265 0-11.266 3.203-22.328 3.204-11.063 9.688-22.251h-7.812q-7.313 11.485-10.954 22.563-3.6402 11.078-3.6402 22.016 0 10.89 3.6092 21.921 3.625 11.047 10.985 22.563z"/>
<path id="BitstreamVeraSans-Roman-69" d="m9.4219 54.688h8.9841v-54.688h-8.9841zm0 21.296h8.9841v-11.39h-8.9841z"/>
<path id="BitstreamVeraSans-Roman-6e" d="m54.891 33.016v-33.016h-8.985v32.719q0 7.765-3.031 11.609-3.031 3.86-9.078 3.86-7.281 0-11.485-4.641-4.203-4.625-4.203-12.641v-30.906h-9.0309v54.688h9.0309v-8.5q3.235 4.937 7.594 7.374 4.375 2.438 10.094 2.438 9.422 0 14.25-5.828 4.844-5.828 4.844-17.156"/>
<path id="BitstreamVeraSans-Roman-29" d="m8.0156 75.875h7.8124q7.313-11.516 10.953-22.563 3.641-11.031 3.641-21.921 0-10.938-3.641-22.016-3.64-11.078-10.953-22.563h-7.8124q6.4844 11.188 9.6874 22.25 3.203 11.063 3.203 22.329 0 11.281-3.203 22.265-3.203 11-9.6874 22.219"/>
<path id="BitstreamVeraSans-Roman-73" d="m44.281 53.078v-8.5q-3.797 1.953-7.906 2.922-4.094 0.984-8.5 0.984-6.687 0-10.031-2.046-3.344-2.047-3.344-6.157 0-3.125 2.391-4.906 2.39-1.781 9.625-3.391l3.078-0.687q9.562-2.047 13.594-5.781 4.031-3.735 4.031-10.422 0-7.6252-6.031-12.078-6.032-4.4379-16.579-4.4379-4.39 0-9.156 0.8594-4.765 0.85938-10.031 2.5625l-0.0001 9.281q4.9841-2.5935 9.8121-3.8904 4.828-1.2812 9.578-1.2812 6.344 0 9.75 2.1718 3.422 2.1718 3.422 6.1248 0 3.656-2.468 5.61-2.454 1.953-10.813 3.765l-3.125 0.735q-8.344 1.75-12.062 5.39-3.7035 3.641-3.7035 9.985 0 7.718 5.4685 11.906 5.469 4.203 15.531 4.203 4.969 0 9.36-0.734 4.406-0.719 8.109-2.188"/>
<path id="BitstreamVeraSans-Roman-68" d="m54.891 33.016v-33.016h-8.985v32.719q0 7.765-3.031 11.609-3.031 3.86-9.078 3.86-7.281 0-11.485-4.641-4.203-4.625-4.203-12.641v-30.906h-9.0309v75.984h9.0309v-29.796q3.235 4.937 7.594 7.374 4.375 2.438 10.094 2.438 9.422 0 14.25-5.828 4.844-5.828 4.844-17.156"/>
<path id="BitstreamVeraSans-Roman-63" d="m48.781 52.594v-8.406q-3.812 2.109-7.64 3.156-3.829 1.047-7.735 1.047-8.75 0-13.594-5.547-4.828-5.532-4.828-15.547 0-10.016 4.828-15.563 4.844-5.5309 13.594-5.5309 3.906 0 7.735 1.0469 3.828 1.0469 7.64 3.156v-8.3122q-3.765-1.75-7.797-2.625-4.015-0.8907-8.562-0.8907-12.36 0-19.641 7.7657-7.2654 7.7652-7.2654 20.953 0 13.375 7.3434 21.031 7.36 7.672 20.157 7.672 4.14 0 8.093-0.859 3.953-0.844 7.672-2.547"/>
<path id="BitstreamVeraSans-Roman-6f" d="m30.609 48.391q-7.218 0-11.421-5.641-4.204-5.641-4.204-15.453 0-9.813 4.172-15.453 4.188-5.6409 11.453-5.6409 7.188 0 11.375 5.6559 4.204 5.672 4.204 15.438 0 9.719-4.204 15.406-4.187 5.688-11.375 5.688m0 7.609q11.719 0 18.407-7.625 6.703-7.609 6.703-21.078 0-13.422-6.703-21.078-6.688-7.6409-18.407-7.6409-11.765 0-18.437 7.6407-6.6564 7.6562-6.6564 21.078 0 13.469 6.6564 21.078 6.672 7.625 18.437 7.625"/>
<path id="BitstreamVeraSans-Roman-61" d="m34.281 27.484q-10.89 0-15.093-2.484-4.204-2.484-4.204-8.5 0-4.781 3.157-7.5938 3.156-2.7968 8.562-2.7968 7.485 0 12 5.2966 4.516 5.297 4.516 14.078v2zm17.922 3.719v-31.203h-8.984v8.2969q-3.078-4.9688-7.672-7.3438t-11.235-2.375q-8.39 0-13.359 4.7188-4.953 4.7187-4.953 12.625 0 9.219 6.172 13.906 6.187 4.688 18.437 4.688h12.61v0.89q0 6.203-4.078 9.594-4.079 3.391-11.453 3.391-4.688 0-9.141-1.125-4.438-1.125-8.531-3.375v8.312q4.922 1.906 9.562 2.844 4.641 0.953 9.031 0.953 11.875 0 17.735-6.156 5.859-6.141 5.859-18.641"/>
<path id="BitstreamVeraSans-Roman-74" d="m18.312 70.219v-15.531h18.5v-6.985h-18.5v-29.687q0-6.688 1.829-8.5941 1.828-1.9063 7.453-1.9063h9.218v-7.5156h-9.218q-10.406 0-14.36 3.875-3.9528 3.8906-3.9528 14.141v29.687h-6.5937v6.985h6.5937v15.531z"/>
<clipPath id="p875ac5675d">
<rect id="rect6866" y="12.96" width="338.8" x="51.435" height="344.88"/>
</clipPath>
</defs>
<metadata id="metadata6870">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g id="figure_1">
<g id="patch_1">
<path id="path6572" fill="none" d="m0 403.2h403.2v-403.2h-403.2v403.2z"/>
</g>
<g id="axes_1">
<g id="patch_2">
<path id="path6576" fill="none" d="m51.435 357.84h338.8v-344.88h-338.8l-0.005 344.88z"/>
</g>
<g id="line2d_1">
<path id="path7422" stroke-linejoin="round" d="m202.58 447.3l2.46-19.45 2.97-21.01 2.96-18.8 2.97-16.83 2.97-15.08 2.97-13.52 2.96-12.12 2.97-10.88 2.97-9.77 2.97-8.79 2.96-7.92 2.97-7.14 2.97-6.46 2.97-5.87 3.39-6.05 3.39-5.47 3.39-4.97 3.82-5.09 4.24-5.17 4.66-5.24 6.36-6.68 13.56-14.09 4.67-5.31 4.24-5.26 3.81-5.2 3.39-5.09 3.39-5.6 2.97-5.41 2.97-5.94 2.97-6.56 2.96-7.25 2.97-8.03 2.97-8.92 2.97-9.93 2.96-11.04 2.97-12.31 2.55-11.68 2.54-12.819 2.54-14.09 2.55-15.489 2.54-17.03 2.54-18.729 1.61-13.013" transform="scale(.8)" stroke="#b30000" stroke-miterlimit="1e5" stroke-width="2.5" fill="none"/>
</g>
<g id="line2d_2">
<path id="path7415" stroke-linejoin="round" d="m202.79 16.2l0.55 4.635 2.97 22.175 2.97 19.799 2.97 17.675 2.96 15.771 2.97 14.065 2.97 12.54 2.97 11.17 2.96 9.94 2.97 8.83 2.97 7.84 2.97 6.95 2.96 6.13 2.97 5.41 2.54 4.11 2.55 3.66 2.54 3.24 2.54 2.86 2.55 2.5 2.54 2.17 2.55 1.85 2.54 1.55 2.54 1.27 2.55 1 2.54 0.74 2.54 0.48 2.55 0.22 2.54-0.02 2.54-0.27 2.55-0.52 2.54-0.78 2.54-1.04 2.55-1.32 2.54-1.6 2.55-1.9 2.54-2.22 2.54-2.56 2.55-2.92 2.54-3.31 2.54-3.73 2.55-4.19 2.54-4.68 2.54-5.21 2.55-5.8 2.54-6.43 2.55-7.14 2.54-7.9 2.54-8.73 2.55-9.65 2.54-10.66 2.54-11.76 2.55-12.976 2.54-14.31 2.54-15.774 2.55-17.387 2.54-19.158 0.56-4.635" transform="scale(.8)" stroke="#00b300" stroke-miterlimit="1e5" stroke-dasharray="7.5, 7.50000000000000000" stroke-width="2.5" fill="none"/>
</g>
<g id="line2d_3">
<path id="path6585" d="m51.435 206.95l106.16-0.1 12.2-0.24 7.46-0.35 5.76-0.48 4.41-0.59 3.73-0.7 3.39-0.86 3.06-1 2.71-1.1 2.71-1.34 2.72-1.59 2.71-1.86 2.71-2.13 3.05-2.69 3.73-3.6 10.18-10.06 3.05-2.62 2.71-2.07 2.72-1.79 2.71-1.53 2.71-1.28 3.06-1.16 3.05-0.92 3.39-0.79 3.73-0.65 4.41-0.53 5.43-0.43 7.12-0.31 10.17-0.21 17.98-0.1 61.38-0.02h28.49" clip-path="url(#p875ac5675d)" stroke="#0000b3" stroke-dasharray="1.000000,3.000000" stroke-width="2" fill="none"/>
</g>
<g id="patch_3">
<path id="path6588" d="m51.435 357.84h338.8" stroke="#000" stroke-linecap="square" fill="none"/>
</g>
<g id="patch_4">
<path id="path6591" d="m51.435 357.84v-344.88" stroke="#000" stroke-linecap="square" fill="none"/>
</g>
<g id="patch_5">
<path id="path6594" d="m390.24 357.84v-344.88" stroke="#000" stroke-linecap="square" fill="none"/>
</g>
<g id="patch_6">
<path id="path6597" d="m51.435 12.96h338.8" stroke="#000" stroke-linecap="square" fill="none"/>
</g>
<g id="matplotlib.axis_1">
<g id="xtick_1">
<g id="line2d_4">
<path id="path6602" d="m199.66 357.84v-344.88" clip-path="url(#p875ac5675d)" stroke="#000" stroke-dasharray="1.000000,3.000000" stroke-width=".5" fill="none"/>
</g>
<g id="line2d_5">
<g id="g6608">
<use id="use6610" xlink:href="#m6d0dc4c4e2" stroke="#000000" y="357.84" x="199.6621875" stroke-width=".5"/>
</g>
</g>
<g id="line2d_6">
<g id="g6616">
<use id="use6618" xlink:href="#m2997e254fe" stroke="#000000" y="12.96" x="199.6621875" stroke-width=".5"/>
</g>
</g>
<g id="text_1"><!-- 1 -->
<g id="g6625" transform="translate(190.82 370.96) scale(.12 -.12)">
<use id="use6627" xlink:href="#BitstreamVeraSans-Roman-2212"/>
<use id="use6629" x="83.7890625" xlink:href="#BitstreamVeraSans-Roman-31"/>
</g>
</g>
</g>
<g id="xtick_2">
<g id="line2d_7">
<path id="path6633" d="m220.84 357.84v-344.88" clip-path="url(#p875ac5675d)" stroke="#000" stroke-dasharray="1.000000,3.000000" stroke-width=".5" fill="none"/>
</g>
<g id="line2d_8">
<g id="g6636">
<use id="use6638" xlink:href="#m6d0dc4c4e2" stroke="#000000" y="357.84" x="220.8375" stroke-width=".5"/>
</g>
</g>
<g id="line2d_9">
<g id="g6641">
<use id="use6643" xlink:href="#m2997e254fe" stroke="#000000" y="12.96" x="220.8375" stroke-width=".5"/>
</g>
</g>
<g id="text_2"><!-- 0 -->
<g id="g6649" transform="translate(217.02 370.96) scale(.12 -.12)">
<use id="use6651" xlink:href="#BitstreamVeraSans-Roman-30"/>
</g>
</g>
</g>
<g id="xtick_3">
<g id="line2d_10">
<path id="path6655" d="m242.01 357.84v-344.88" clip-path="url(#p875ac5675d)" stroke="#000" stroke-dasharray="1.000000,3.000000" stroke-width=".5" fill="none"/>
</g>
<g id="line2d_11">
<g id="g6658">
<use id="use6660" xlink:href="#m6d0dc4c4e2" stroke="#000000" y="357.84" x="242.0128125" stroke-width=".5"/>
</g>
</g>
<g id="line2d_12">
<g id="g6663">
<use id="use6665" xlink:href="#m2997e254fe" stroke="#000000" y="12.96" x="242.0128125" stroke-width=".5"/>
</g>
</g>
<g id="text_3"><!-- 1 -->
<g id="g6668" transform="translate(238.2 370.96) scale(.12 -.12)">
<use id="use6670" xlink:href="#BitstreamVeraSans-Roman-31"/>
</g>
</g>
</g>
<g id="text_4"><!-- x -->
<g id="g6676" transform="translate(217.29 387.57) scale(.12 -.12)">
<use id="use6678" xlink:href="#BitstreamVeraSans-Roman-78"/>
</g>
</g>
</g>
<g id="matplotlib.axis_2">
<g id="ytick_1">
<g id="line2d_13">
<path id="path6683" d="m51.435 206.96h338.8" clip-path="url(#p875ac5675d)" stroke="#000" stroke-dasharray="1.000000,3.000000" stroke-width=".5" fill="none"/>
</g>
<g id="line2d_14">
<g id="g6689">
<use id="use6691" xlink:href="#md69bb88a81" stroke="#000000" y="206.955" x="51.435" stroke-width=".5"/>
</g>
</g>
<g id="line2d_15">
<g id="g6697">
<use id="use6699" xlink:href="#m1d1e712049" stroke="#000000" y="206.955" x="390.24" stroke-width=".5"/>
</g>
</g>
<g id="text_5"><!-- 1 -->
<g id="g6702" transform="translate(29.744 210.27) scale(.12 -.12)">
<use id="use6704" xlink:href="#BitstreamVeraSans-Roman-2212"/>
<use id="use6706" x="83.7890625" xlink:href="#BitstreamVeraSans-Roman-31"/>
</g>
</g>
</g>
<g id="ytick_2">
<g id="line2d_16">
<path id="path6710" d="m51.435 185.4h338.8" clip-path="url(#p875ac5675d)" stroke="#000" stroke-dasharray="1.000000,3.000000" stroke-width=".5" fill="none"/>
</g>
<g id="line2d_17">
<g id="g6713">
<use id="use6715" xlink:href="#md69bb88a81" stroke="#000000" y="185.4" x="51.435" stroke-width=".5"/>
</g>
</g>
<g id="line2d_18">
<g id="g6718">
<use id="use6720" xlink:href="#m1d1e712049" stroke="#000000" y="185.4" x="390.24" stroke-width=".5"/>
</g>
</g>
<g id="text_6"><!-- 0 -->
<g id="g6723" transform="translate(39.8 188.71) scale(.12 -.12)">
<use id="use6725" xlink:href="#BitstreamVeraSans-Roman-30"/>
</g>
</g>
</g>
<g id="ytick_3">
<g id="line2d_19">
<path id="path6729" d="m51.435 163.84h338.8" clip-path="url(#p875ac5675d)" stroke="#000" stroke-dasharray="1.000000,3.000000" stroke-width=".5" fill="none"/>
</g>
<g id="line2d_20">
<g id="g6732">
<use id="use6734" xlink:href="#md69bb88a81" stroke="#000000" y="163.845" x="51.435" stroke-width=".5"/>
</g>
</g>
<g id="line2d_21">
<g id="g6737">
<use id="use6739" xlink:href="#m1d1e712049" stroke="#000000" y="163.845" x="390.24" stroke-width=".5"/>
</g>
</g>
<g id="text_7"><!-- 1 -->
<g id="g6742" transform="translate(39.8 167.16) scale(.12 -.12)">
<use id="use6744" xlink:href="#BitstreamVeraSans-Roman-31"/>
</g>
</g>
</g>
<g id="text_8"><!-- y -->
<g id="g6750" transform="translate(22.249 188.95) rotate(-90) scale(.12 -.12)">
<use id="use6752" xlink:href="#BitstreamVeraSans-Roman-79"/>
</g>
</g>
</g>
<g id="legend_1">
<g id="patch_7">
<path id="path6756" d="m248.34 350.64h134.7v-67.73h-134.7z" stroke="#000" fill="#fff"/>
</g>
<g id="line2d_22">
<path id="path6759" d="m258.42 294.57h20.16" stroke="#b30000" stroke-linecap="square" stroke-width="2" fill="none"/>
</g>
<g id="text_9"><!-- y = sinh(x) -->
<g id="g6773" transform="translate(294.42 299.61) scale(.144 -.144)">
<use id="use6775" xlink:href="#BitstreamVeraSans-Roman-79"/>
<use id="use6777" x="59.1796875" xlink:href="#BitstreamVeraSans-Roman-20"/>
<use id="use6779" x="90.966796875" xlink:href="#BitstreamVeraSans-Roman-3d"/>
<use id="use6781" x="174.755859375" xlink:href="#BitstreamVeraSans-Roman-20"/>
<use id="use6783" x="206.54296875" xlink:href="#BitstreamVeraSans-Roman-73"/>
<use id="use6785" x="258.642578125" xlink:href="#BitstreamVeraSans-Roman-69"/>
<use id="use6787" x="286.42578125" xlink:href="#BitstreamVeraSans-Roman-6e"/>
<use id="use6789" x="349.8046875" xlink:href="#BitstreamVeraSans-Roman-68"/>
<use id="use6791" x="413.18359375" xlink:href="#BitstreamVeraSans-Roman-28"/>
<use id="use6793" x="452.197265625" xlink:href="#BitstreamVeraSans-Roman-78"/>
<use id="use6795" x="511.376953125" xlink:href="#BitstreamVeraSans-Roman-29"/>
</g>
</g>
<g id="line2d_24">
<path id="path6798" d="m258.42 315.71h20.16" stroke="#00b300" stroke-dasharray="6.000000,6.000000" stroke-width="2" fill="none"/>
</g>
<g id="text_10"><!-- y = cosh(x) -->
<g id="g6806" transform="translate(294.42 320.75) scale(.144 -.144)">
<use id="use6808" xlink:href="#BitstreamVeraSans-Roman-79"/>
<use id="use6810" x="59.1796875" xlink:href="#BitstreamVeraSans-Roman-20"/>
<use id="use6812" x="90.966796875" xlink:href="#BitstreamVeraSans-Roman-3d"/>
<use id="use6814" x="174.755859375" xlink:href="#BitstreamVeraSans-Roman-20"/>
<use id="use6816" x="206.54296875" xlink:href="#BitstreamVeraSans-Roman-63"/>
<use id="use6818" x="261.5234375" xlink:href="#BitstreamVeraSans-Roman-6f"/>
<use id="use6820" x="322.705078125" xlink:href="#BitstreamVeraSans-Roman-73"/>
<use id="use6822" x="374.8046875" xlink:href="#BitstreamVeraSans-Roman-68"/>
<use id="use6824" x="438.18359375" xlink:href="#BitstreamVeraSans-Roman-28"/>
<use id="use6826" x="477.197265625" xlink:href="#BitstreamVeraSans-Roman-78"/>
<use id="use6828" x="536.376953125" xlink:href="#BitstreamVeraSans-Roman-29"/>
</g>
</g>
<g id="line2d_26">
<path id="path6831" d="m258.42 336.85h20.16" stroke="#0000b3" stroke-dasharray="1.000000,3.000000" stroke-width="2" fill="none"/>
</g>
<g id="text_11"><!-- y = tanh(x) -->
<g id="g6839" transform="translate(294.42 341.89) scale(.144 -.144)">
<use id="use6841" xlink:href="#BitstreamVeraSans-Roman-79"/>
<use id="use6843" x="59.1796875" xlink:href="#BitstreamVeraSans-Roman-20"/>
<use id="use6845" x="90.966796875" xlink:href="#BitstreamVeraSans-Roman-3d"/>
<use id="use6847" x="174.755859375" xlink:href="#BitstreamVeraSans-Roman-20"/>
<use id="use6849" x="206.54296875" xlink:href="#BitstreamVeraSans-Roman-74"/>
<use id="use6851" x="245.751953125" xlink:href="#BitstreamVeraSans-Roman-61"/>
<use id="use6853" x="307.03125" xlink:href="#BitstreamVeraSans-Roman-6e"/>
<use id="use6855" x="370.41015625" xlink:href="#BitstreamVeraSans-Roman-68"/>
<use id="use6857" x="433.7890625" xlink:href="#BitstreamVeraSans-Roman-28"/>
<use id="use6859" x="472.802734375" xlink:href="#BitstreamVeraSans-Roman-78"/>
<use id="use6861" x="531.982421875" xlink:href="#BitstreamVeraSans-Roman-29"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@@ -0,0 +1,744 @@
---
author: Alvie Rahman
date: \today
title: MMME1026 // Systems of Equations and Matrices
tags: [ uni, nottingham, mechanical, engineering, mmme1026, maths, systems_of_equations, matrices ]
---
# Systems of Equations (Simultaneous Equations)
## Gaussian Elimination
Gaussian eliminiation can be used when the number of unknown variables you have is equal to the
number of equations you are given.
I'm pretty sure it's the name for the method you use to solve simultaneous equations in school.
For example if you have 1 equation and 1 unknown:
\begin{align*}
2x &= 6 \\
x &= 3
\end{align*}
### Number of Solutions
Let's generalise the example above to
$$ax = b$$
There are 3 possible cases:
\begin{align*}
a \ne 0 &\rightarrow x = \frac b a \\
a = 0, b \ne 0 &\rightarrow \text{no solution for $x$} \\
a = 0, b = 0 &\rightarrow \text{infinite solutions for $x$}
\end{align*}
### 2x2 Systems
A 2x2 system is one with 2 equations and 2 unknown variables.
<details>
<summary>
#### Example 1
\begin{align*}
3x_1 + 4x_2 &= 2 &\text{(1)} \\
x_1 + 2x_2 &= 0 &\text{(2)} \\
\end{align*}
</summary>
\begin{align*}
3\times\text{(2)} = 3x_1 + 6x_2 &= 0 &\text{(3)} \\
\text{(3)} - \text{(1)} = 0x_1 + 2x_2 &= -2 \\
x_2 &= -1
\end{align*}
We've essentially created a 1x1 system for $x_2$ and now that's solved we can back substitute it
into equation (1) (or equation (2), it doesn't matter) to work out the value of $x_1$:
\begin{align*}
3x_1 + 4x_2 &= 2 \\
3x_1 - 1 &= 2 \\
3x_1 &= 6 \\
x_1 &= 2
\end{align*}
You can check the values for $x_1$ and $x_2$ are correct by substituting them into equation (2).
</details>
### 3x3 Systems
A 3x3 system is one with 3 equations and 3 unknown variables.
<details>
<summary>
#### Example 1
\begin{align*}
2x_1 + 3x_2 - x_3 &= 5 &\text{(1)} \\
4x_1 + 4x_2 - 3x_3 &= 5 &\text{(2)} \\
2x_1 - 3x_2 + x_3 &= 5 &\text{(3)} \\
\end{align*}
</summary>
The first step is to eliminate $x_1$ from (2) and (3) using (1):
\begin{align*}
\text{(2)}-2\times\text{(1)} = -2x_2 -x_3 &= -1 &\text{(4)} \\
\text{(3)}-\text{(1)} = -6x_2 + 3x_3 &= -6 &\text{(5)} \\
\end{align*}
This has created a 2x2 system of $x_2$ and $x_3$ which can be solved as any other 2x2 system.
I'm too lazy to type up the working, but it is solved like any other 2x2 system.
\begin{align*}
x_2 &= -2
x_3 &= 5
\end{align*}
These values can be back-substituted into any of the first 3 equations to find out $x_1$:
\begin{align*}
-2x_1 + 3x_2 - x_3 = 2x_1 + 6 - 3 = 5 \rightarrow x_1 = 1
\end{align*}
</details>
<details>
<summary>
#### Example 2
\begin{align*}
x_1 + x_2 - 2x_3 &= 1 &R_1 \\
2x_1 - x_2 - x_3 &= 1 &R_2 \\
x_1 + 4x_2 + 7x_3 &= 2 &R_3 \\
\end{align*}
</summary>
1. Eliminate $x_1$ from $R_2$, $R_3$:
\begin{align*}
x_1 + x_2 - 2x_3 &= 1 &R_1' = R_1\\
- 3x_2 - 5x_3 &= -1 &R_2' = R_2 - 2R_1 \\
3x_2 + 5x_3 &= 1 &R_3' = R_3 - R_1 \\
\end{align*}
We've created another 2x2 system of $R_2'$ and $R_3'$
2. Eliminate $x_2$ from $R_3''$
\begin{align*}
x_1 + x_2 - 2x_3 &= 1 &R_1'' = R_1' = R_1\\
- 3x_2 - 5x_3 &= -1 &R_2'' = R_2' = R_2 - 2R_1 \\
0x_3 &= 0 &R_3'' = R_3 '+ R_2' \\
\end{align*}
We can see that $x_3$ can be any number, so there are infinite solutions. Let:
$$x_3 = t$$
where $t$ can be any number
3. Substitute $x_3$ into $R_2''$:
$$R_2'' = -3x_2 - 5t = -1 \rightarrow x_2 = \frac 1 3 - \frac{5t} 3$$
4. Substitute $x_2$ and $x_3$ into $R_1''$:
$$R_1'' = x_1 + \frac 1 3 - \frac{5t} 3 + 2t = 1 \rightarrow x_1 = \frac 2 3 - \frac t 3$$
</details>
## Systems of Equations and Matrices
Many problems in engineering have a very large number of unknowns and equations to solve
simultaneously.
We can use matrices to solve these efficiently.
Take the following simultaneous equations::
\begin{align*}
3x_1 + 4x_2 &= 2 &\text{(1)} \\
x_1 + 2x_2 &= 0 &\text{(2)}
\end{align*}
They can be represented by the following matrices:
\begin{align*}
A &= \begin{pmatrix} 3 & 4 \\ 1 & 2 \end{pmatrix} \\
\pmb x &= \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} \\
\pmb b &= \begin{pmatrix} 2 \\ 0 \end{pmatrix} \\
\end{align*}
You can then express the system as:
$$A\pmb x = \pmb b$$
<details>
<summary>
#### A 3x3 System as a Matrix
</summary>
\begin{align*}
2x_1 + 3x_2 - x_3 &= 5 \\
4x_1 + 4x_2 - 3x_3 &= 3 \\
2x_1 - 3x_2 + x_3 &= -1
\end{align*}
Could be expressed in the form $A\pmb x = \pmb b$ where:
\begin{align*}
A &= \begin{pmatrix} 2 & 3 & -1 \\ 4 & 4 & -3 \\ 2 & -3 & -1 \end{pmatrix} \\
\pmb x &= \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} \\
\pmb b &= \begin{pmatrix} 5 \\ 3 \\ -1 \end{pmatrix} \\
\end{align*}
</details>
<details>
<summary>
#### An $m\times n$ System as a Matrix
</summary>
\begin{align*}
a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &= b_1 \\
a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &= b_2 \\
\cdots \\
a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n &= b_m \\
\end{align*}
Could be expressed in the form $A\pmb x = \pmb b$ where:
\begin{align*}
A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{pmatrix},
\pmb x = \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix},
\pmb b = \begin{pmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{pmatrix}
\end{align*}
</details>
# Matrices
## Order of a Matrix
The order of a matrix is its size e.g. $3\times2$ or $m\times n$
## Column Vectors
- Column vectors are matrices with only one column:
$$ \begin{pmatrix} 1 \\ 2 \end{pmatrix} \begin{pmatrix} 4 \\ 45 \\ 12 \end{pmatrix} $$
- Column vector variables typed up or printed are expressed in $\pmb{bold}$ and when it is
handwritten it is \underline{underlined}:
$$ \pmb x = \begin{pmatrix} -3 \\ 2 \end{pmatrix}$$
## Matrix Algebra
### Equality
Two matrices are the same if:
- Their order is the same
- Their corresponding elements are the same
### Addition and Subtraction
Only possible if their order is the same.
\begin{align*}
A + B&= \begin{pmatrix} a_{11} + b_{11} & a_{12} + b_{12} & \cdots & a_{1n} + b_{1n} \\
a_{21} + b_{21} & a_{22} + b_{22} & \cdots & a_{2n} + b_{2n} \\
\vdots & & & \vdots \\
a_{m1} + b_{m1} & a_{m2} + b_{m2} & \cdots & a_{mn} + b_{mn}
\end{pmatrix} \\
A - B&= \begin{pmatrix} a_{11} - b_{11} & a_{12} - b_{12} & \cdots & a_{1n} - b_{1n} \\
a_{21} - b_{21} & a_{22} - b_{22} & \cdots & a_{2n} - b_{2n} \\
\vdots & & & \vdots \\
a_{m1} - b_{m1} & a_{m2} - b_{m2} & \cdots & a_{mn} - b_{mn}
\end{pmatrix},
\end{align*}
### Zero Matrix
This is a matrix whose elements are all zeros.
For any matrix $A$,
$$A + 0 =A$$
We can only add matrices of the same order, therefore 0 must be of the same order as $A$.
### Multiplication
Let
$$
\begin{matrix}
A & m\times n \\
B & p\times q
\end{matrix}
$$
To be able to multiply $A$ by $B$, $n = p$.
If $n \ne p$, then $AB$ does not exist.
$$
\begin{matrix}
A & B & = & C \\
m\times n & p \times q & & m\times q
\end{matrix}
$$
When $C = AB$ exists,
$$C_{ij} = \sum_r\! a_{ir}b_{rj}$$
That is, $C_{ij}$ is the 'product' of the $i$th row of $A$ and $j$th column of $B$.
#### Multiplication of a Matrix by a Scalar
If $\lambda$ is a scalar, we define
$$
\lambda a = \begin{pmatrix} \lambda a_{11} & \lambda a_{12} & \cdots & \lambda a_{1n} \\
\lambda a_{21} & \lambda a_{22} & \cdots & \lambda a_{2n} \\
\vdots & & & \vdots \\
\lambda a_{m1} & \lambda a_{m2} & \cdots & \lambda a_{mn}
\end{pmatrix},
$$
<details>
<summary>
#### Example 1
</summary>
$$
\begin{pmatrix} 1 & -1 \\ 2 & 1 \end{pmatrix}
\begin{pmatrix} 0 & 1 \\ 3 & 2 \end{pmatrix} =
\begin{pmatrix} -3 & -1 \\ 3 & 4 \end{pmatrix}
$$
$$
\begin{pmatrix} 0 & 1 \\ 3 & 2 \end{pmatrix}
\begin{pmatrix} 1 & -1 \\ 2 & 1 \end{pmatrix} =
\begin{pmatrix} 2 & 1 \\ 7 & -1 \end{pmatrix}
$$
</details>
<details>
<summary>
#### Example 2
</summary>
$$
A = \begin{pmatrix} 4 & 1 & 6 \\ 3 & 2 & 1 \end{pmatrix},\,
B = \begin{pmatrix} 1 & 1 \\ 1 & 2 \\ 1 & 0 \end{pmatrix}
$$
$$
AB = \begin{pmatrix} 11 & 6 \\ 6 & 7 \end{pmatrix},\,
BA = \begin{pmatrix} 7 & 3 & 7 \\ 10 & 5 & 8 \\ 4 & 1 & 6 \end{pmatrix}
$$
</details>
### Other Properties of Matrix Algebra
- $(\lambda A)B = \lambda(AB) = A(\lambda B)$
- $A(BC) = (AB)C = ABC$
- $(A+B)C = AC + BC$
- $C(A+B) = CA + CB$
- In general, $AB \ne BA$ even if both exist
- $AB = 0$ does not always mean $A = 0$ or $B = 0$:
$$\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \begin{pmatrix}3 & 0 \\ 0 & 0 \end{pmatrix} =
\begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix} = 0$$
<details>
<summary>
It follows that $AB = AC$ does not imply that $B=C$ as
$$AB = AC \leftrightarrow A(B + C) = 0$$
and as $A$ and $(B-C)$ are not necessarily 0, $B$ is not necessarily equal to $C$:
</summary>
$$AB = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \begin{pmatrix}0 & 0 \\ 1 & 0 \end{pmatrix} =
\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$$
and
$$AC = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \begin{pmatrix}1 & 2 \\ 1 & 0 \end{pmatrix} =
\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} = AB$$
but $B \ne C$
</details>
## Special Matrices
### Square Matrix
Where $m = n$
<details>
<summary>
#### Example 1
A $3\times3$ matrix.
</summary>
$$\begin{pmatrix}1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9\end{pmatrix}$$
</details>
<details>
<summary>
#### Example 2
A $2\times2$ matrix.
</summary>
$$\begin{pmatrix}1 & 2 \\ 4 & 5 \end{pmatrix}$$
</details>
### Identity Matrix
The identity matrix is a square matrix whose eleements are all 0, except the leading diagonal which
is 1s.
The leading diagonal is the top left to bottom right corner.
It is usually denoted by $I$ or $I_n$.
The identity matrix has the properties that
$$AI = IA = A$$
for any square matrix $A$ of the same order as I, and
$$Ix = x$$
for any vector $x$.
<details>
<summary>
#### Example 1
The $3\times3$ identity matrix.
</summary>
$$\begin{pmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{pmatrix}$$
</details>
<details>
<summary>
#### Example 2
The $2\times2$ identity matrix.
</summary>
$$\begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix}$$
</details>
### Transposed Matrix
The transpose of matrix $A$ of order $m\times n$ is matrix $A^T$ which has the order $n\times m$.
It is found by reflecting it along the leading diagonal, or interchanging the rows and columns of
$A$.
![by [Lucas Vieira](https://commons.wikimedia.org/wiki/File:Matrix_transpose.gif)](./images/Matrix_transpose.gif)
Let matrix $D = EF$, then $D^T = (EF)^T = E^TF^T$
#### Example 1
$$
A = \begin{pmatrix}3 & 2 & 1 \\ 4 & 5 & 6 \end{pmatrix},\,
A^T = \begin{pmatrix}3 & 4 \\ 2 & 5 \\ 1 & 6\end{pmatrix}
$$
#### Example 2
$$
B = \begin{pmatrix}1 \\ 4\end{pmatrix},\,
B^T = \begin{pmatrix}1 & 4\end{pmatrix}
$$
#### Example 3
$$
C = \begin{pmatrix}1 & 2 & 3 \\ 0 & 5 & 1 \\ 2 & 3 & 7\end{pmatrix},\,
C^T = \begin{pmatrix}1 & 0 & 2 \\ 2 & 5 & 4 \\ 3 & 1 & 7\end{pmatrix}
$$
### Orthogonal Matrices
A matrix, $A$, such that
$$A^{-1} = A^T$$
is said to be orthogonal.
Another way to say this is
$$AA^T = A^TA = I$$
### Symmetric Matrices
A square matrix which is symmetric about its leading diagonal:
$$A = A^T$$
You can also express this as the matrix $A$, where
$$a_{ij} = a_{ji}$$
is satisfied to all elements.
<details>
<summary>
#### Example 1
</summary>
$$\begin{pmatrix}
1 & 0 & -1 & 3 \\
0 & 3 & 4 & -1 \\
-2 & 4 & -1 & 6 \\
3 & -7 & 6 & 2
\end{pmatrix}$$
</details>
### Anti-Symmetric
A square matrix is anti-symmetric if
$$A = -A^T$$
This can also be expressed as
$$a_{ij} = -a_{ji}$$
This means that all elements on the leading diagonal must be 0.
<details>
<summary>
#### Example 1
</summary>
$$\begin{pmatrix}
0 & -1 & 5 \\
1 & 0 & 1 \\
-5 & -1 & 0
\end{pmatrix}$$
</details>
## The Determinant
### Determinant of a 2x2 System
The determinant of a $2x2$ system is
$$D = a_{11}a_{22} - a_{12}a_{21}$$
It is denoted by
$$
\begin{vmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{vmatrix}
\text{ or }
\det
\begin{pmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{pmatrix}
$$
- A system of equations has a unique solution if $D \ne 0$
- If $D = 0$, then there are either
- no solutions (the equations are inconsistent)
- intinitely many solutions
### Determinant of a 3x3 System
Let
$$
A = \begin{pmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{pmatrix}
$$
\begin{align*}
\det A = &a_{11} \times \det \begin{pmatrix}a_{22} & a_{23} \\ a_{32} & a_{33} \end{pmatrix} \\
&-a_{12} \times \det \begin{pmatrix}a_{21} & a_{23} \\ a_{31} & a_{33} \end{pmatrix} \\
&+a_{13} \times \det \begin{pmatrix}a_{21} & a_{22} \\ a_{31} & a_{32} \end{pmatrix}
\end{align*}
The $2x2$ matrices above are created by removing any elements on the same row or column as its corresponding
coefficient:
![](./images/vimscrot-2021-11-02T16:19:40,013146580+00:00.png)
### Chessboard Determinant
$\det A$ may be obtained by expanding out any row or column.
To figure out which coefficients should be subtracted and which ones added use the chessboard
pattern of signs:
$$\begin{pmatrix} + & - & + \\ - & + & - \\ + & - & + \end{pmatrix}$$
### Properties of Determinants
- $$\det A = \det A^T$$
- If all elements of one row of a matrix are multiplied by a constant $z$, the determinant of the
new matrix is $z$ times the determinant of the original matrix:
\begin{align*}
\begin{vmatrix} za & zb \\ c & d \end{vmatrix} &= zad - zbc \\
&= z(ad-bc) \\
&= z\begin{vmatrix} a & b \\ c & d \end{vmatrix}
\end{align*}
This is also true if a column of a matrix is mutiplied by a constant.
**Application** if the fator $z$ appears in each elements of a row or column of a determinant it
can be factored out
$$\begin{vmatrix}2 & 12 \\ 1 & 3 \end{vmatrix} = 2\begin{vmatrix}1 & 6 \\ 1 & 3 \end{vmatrix} = 2 \times 3
\begin{vmatrix} 1 & 2 \\ 1 & 1 \end{vmatrix}$$
**Application** if all elements in one row or column of a matrix are zero, the value of the
determinant is 0.
$$\begin{vmatrix} 0 & 0 \\ c & d \end{vmatrix} = 0\times d - 0\times c = 0$$
**Application** if $A$ is an $n\times n$ matrix,
$$\det(zA) = z^n\det A$$
- Swapping any two rows or columns of a matrix changes the sign of the determinant
\begin{align*}
\begin{vmatrix} c & d \\ a & b \end{vmatrix} &= cb - ad \\
&= -(ad - bc) \\
&= -\begin{vmatrix} a & b \\ c & d \end{vmatrix}
\end{align*}
**Application** If any two rows or two columns are identical, the determinant is zero.
**Application** If any row is a mutiple of another, or a column a multiple of another column, the
determinant is zero.
- The value of a determinant is unchanged by adding to any row a constant multiple of another row,
or adding to any column a constant multiple of another column
- If $A$ and $B$ are square matrices of the same order then
$$\det(AB) = \det A \times \det B $$
## Inverse of a Matrix
If $A$ is a square matrix, then its inverse matrix is $A^{-1}$ and is defined by the property that:
$$A^{-1}A = AA^{-1} = I$$
- Not every matrix has an inverse
- If the inverse exists, then it is very useful for solving systems of equations:
\begin{align*}
A\pmb{x} = \pmb b \rightarrow A^{-1}A\pmb x &= A^{-1}\pmb b \\
I\pmb x &= A^{-1}\pmb b \\
\pmb x &= A^{-1}\pmb b
\end{align*}
Therefore there must be a unique solution to $A\pmb x = \pmb b$: $\pmb x = A^{-1}\pmb b$.
- If $D = EF$ then
$$D^-1 = (EF)^{-1} = F^{-1}E^{-1}$$
### Inverse of a 2x2 Matrix
If $A$ is the $2x2$ matrix
$$
A = \begin{pmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{pmatrix}
$$
and its determinant, $D$, satisfies $D \ne 0$, $A$ has the inverse $A^{-1}$ given by
$$
A^{-1} = \frac 1 D \begin{pmatrix}
a_{22} & -a_{12} \\
-a_{21} & a_{11}
\end{pmatrix}
$$
If $D = 0$, then matrix $A$ has no inverse.
<details>
<summary>
#### Example 1
Find the inverse of matrix $A = \begin{pmatrix} -1 & 5 \\ 2 & 3 \end{pmatrix}$.
</summary>
1. Calculate the determinant
$$\det A = -1 \times 3 - 5 \times 2 = -13$$
Since $\det A \ne 0$, the inverse exists.
2. Calculate $A^{-1}$
$$ A^{-1} = \frac 1 {-13} \begin{pmatrix} 3 & -5 \\ -2 & -1\end{pmatrix}$$