Start here

Welcome to Linear Algebra

Straight lines, flat planes, adding and scaling — the simplest ideas in mathematics, scaled up to thousands of unknowns, run search engines, video games, image compression and satellite navigation.

1. What linear algebra is about

Most of the mathematics you have met so far is about one unknown at a time: solve for $x$, differentiate $f(x)$, find the area under one curve. Real problems rarely come that way. The price of bread depends on the price of wheat, which depends on the price of fuel, which depends on the price of transport… An engineer designing a bridge has a separate unknown force in every one of its hundreds of beams. A weather model tracks temperature, pressure and wind at millions of points at once. Linear algebra is the mathematics of many unknowns handled together.

The word linear is the key. A linear relationship only adds things and multiplies them by numbers — no squares, no square roots, no sines. That sounds restrictive, but two facts make it enormously powerful. First, a huge number of real relationships are linear, or very nearly linear over the range we care about. Second, linear problems can be solved completely, by systematic methods that a computer can run on a million unknowns in seconds. The tools that make this possible — matrices and vectors — are what this course is about.

📦 You already know…

$$\begin{aligned}2x+y&=5\\ x-y&=1\end{aligned}\quad\Longrightarrow\quad x=2,\ y=1$$ two equations, two unknowns, solved by substitution or elimination.

🚀 This course begins with…

$$\begin{bmatrix}2&1\\1&-1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}5\\1\end{bmatrix},\qquad A\mathbf{x}=\mathbf{b}$$ the same problem, written so that it works just as well with $1000$ unknowns.

2. Where you will meet it

Linear algebra is probably the most widely used branch of university mathematics. A few places it is working for you today:

🔎 Web search

Google's original PageRank scored every web page by the links pointing to it. The scores are the entries of one enormous vector $\mathbf{r}$ satisfying $A\mathbf{r}=\mathbf{r}$ — an eigenvector.

Chapters 2, 7

🎮 Computer graphics

Every rotation, zoom and camera move in a video game or animated film is a matrix multiplying the coordinates of millions of points, many times a second on the graphics card.

Chapters 2, 6

🖼️ Image compression

A photo is a matrix of pixel values. JPEG rewrites small blocks of it in a cleverly chosen orthogonal basis and throws away the coordinates your eye cannot see.

Chapters 5, 8

🛰️ Satellite navigation

A GPS receiver works out four unknowns — its three coordinates and its clock error — from the signals of four or more satellites, by solving linearised systems again and again.

Chapters 1, 8

📈 Data fitting

The "line of best fit" through noisy measurements — in a physics lab, an economic forecast or a medical study — is a least-squares solution of a system with too many equations.

Chapter 8

⚙️ Engineering & science

Forces in trusses, currents in circuits, flows in pipe networks, balancing chemical equations, vibrations of buildings — all lead to linear systems and eigenvalues.

Chapters 1, 7

3. A first look: matrices move the plane

A $2\times2$ matrix $A=\begin{bmatrix}a&b\\c&d\end{bmatrix}$ is more than a table of numbers: it is a machine that moves points. It sends the point $(x,y)$ to $$A\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}ax+by\\cx+dy\end{bmatrix}.$$ Straight lines stay straight, the origin stays put, and evenly spaced grid lines stay evenly spaced — that is what linear means geometrically. Play with the lab: four numbers can rotate, stretch, shear, reflect or flatten the whole plane.

Teaser — A Matrix Transforms the Plane

The faint grid and the dashed letter F are the original plane; the coloured grid and the solid F are where the matrix sends them. The red and blue arrows are the images of $(1,0)$ and $(0,1)$ — they are exactly the two columns of $A$. The shaded parallelogram is the image of the unit square; its area is $|ad-bc|$, the determinant you will meet in Chapter 3. Play morphs the plane smoothly from "do nothing" ($I$) to $A$.

column 1 $=A(1,0)$—
column 2 $=A(0,1)$—
$\det A=ad-bc$—
morph $t$ (shows $(1-t)I+tA$)—
✏️ Example 1 — A mixing problem as $A\mathbf{x}=\mathbf{b}$
A foundry needs $10$ tonnes of an alloy containing $34\%$ copper. It has one alloy with $25\%$ copper and another with $40\%$ copper. How much of each should it melt together? Write the problem in the form $A\mathbf{x}=\mathbf{b}$.
Unknowns Let $x$ = tonnes of the $25\%$ alloy and $y$ = tonnes of the $40\%$ alloy.
Equations Total mass: $x+y=10$. Copper: $0.25x+0.40y=0.34(10)=3.4$. In matrix form $$\begin{bmatrix}1&1\\0.25&0.40\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}10\\3.4\end{bmatrix}.$$
Solve Multiply the copper equation by $4$: $x+1.6y=13.6$. Subtract the mass equation: $0.6y=3.6$, so $y=6$ and $x=4$. The foundry needs $4$ tonnes of the $25\%$ alloy and $6$ tonnes of the $40\%$ alloy.
Check $0.25(4)+0.40(6)=1+2.4=3.4$ tonnes of copper, which is $34\%$ of $10$ tonnes ✓. Chapter 1 turns "subtract a multiple of one equation from another" into an algorithm that works for any number of equations.
✏️ Example 2 — A tiny search engine
Three web pages link to each other: $A$ links to $B$ and $C$; $B$ links to $C$; $C$ links to $A$. In a simplified PageRank, every page shares its score equally among the pages it links to, a page's score is the total it receives, and the scores add up to $1$. Find the scores $r_A,r_B,r_C$.
Equations $A$ gives half its score to $B$ and half to $C$; $B$ gives all of its score to $C$; $C$ gives all of its score to $A$. So $$r_A=r_C,\qquad r_B=\tfrac12r_A,\qquad r_C=\tfrac12r_A+r_B,\qquad r_A+r_B+r_C=1.$$
Solve Put $r_A=s$. Then $r_B=\tfrac12s$ and $r_C=s$; the third equation is satisfied automatically ($\tfrac12s+\tfrac12s=s$). The last equation gives $s+\tfrac12s+s=\tfrac52s=1$, so $s=\tfrac25$: $$r_A=0.4,\qquad r_B=0.2,\qquad r_C=0.4.$$
Meaning $B$ ranks lowest: only half of one page's score flows into it. In matrix form the first three equations say $M\mathbf{r}=\mathbf{r}$ with $M=\begin{bmatrix}0&0&1\\ \tfrac12&0&0\\ \tfrac12&1&0\end{bmatrix}$ — the score vector is an eigenvector of $M$ with eigenvalue $1$ (Chapter 7). Google's real version adds a "damping factor" and has billions of unknowns, but the idea is exactly this.
✏️ Example 3 — Where does a matrix send a point?
Let $R=\begin{bmatrix}0&-1\\1&0\end{bmatrix}$ and $S=\begin{bmatrix}1&1\\0&1\end{bmatrix}$. Find the images of the point $(2,1)$ under $R$ and under $S$, and describe what each matrix does.
$R$ $R\begin{bmatrix}2\\1\end{bmatrix}=\begin{bmatrix}0\cdot2+(-1)\cdot1\\1\cdot2+0\cdot1\end{bmatrix}=\begin{bmatrix}-1\\2\end{bmatrix}$. Also $R$ sends $(1,0)\mapsto(0,1)$ and $(0,1)\mapsto(-1,0)$: it rotates the plane by $90^\circ$ anticlockwise. Its determinant is $0\cdot0-(-1)\cdot1=1$: areas are unchanged.
$S$ $S\begin{bmatrix}2\\1\end{bmatrix}=\begin{bmatrix}2+1\\1\end{bmatrix}=\begin{bmatrix}3\\1\end{bmatrix}$. In general $S(x,y)=(x+y,\,y)$: each point slides sideways by its height. This is a shear, like pushing the top of a pack of cards. Its determinant is $1\cdot1-1\cdot0=1$, so again no area is gained or lost.
Try it Choose "rotation by 90°" and "shear" in the lab above and watch the F.

4. The eight chapters at a glance

1 · Linear systems→2 · Matrices→3 · Determinants→4 · Vectors in ℝⁿ→5 · Vector spaces→6 · Linear transformations→7 · Eigenvalues→8 · Orthogonality
Chapter 1

Systems of Linear Equations

Solution sets, augmented matrices, row operations, and Gaussian elimination — the engine of the whole course.

$\left[\begin{array}{cc|c}2&1&5\\1&-1&1\end{array}\right]$
Open chapter →
Chapter 2

Matrices

Matrix arithmetic, inverses, LU factorisation, and models of change: Markov chains and input–output economics.

$AB\ne BA,\quad A^{-1}A=I$
Open chapter →
Chapter 3

Determinants

One number that says whether a matrix can be inverted — and how much it scales area and volume.

$\det\begin{bmatrix}a&b\\c&d\end{bmatrix}=ad-bc$
Open chapter →
Chapter 4

Vectors in ℝⁿ

Arrows and lists of numbers: length, angle, dot and cross products, lines and planes in space.

$\mathbf{u}\cdot\mathbf{v}=\|\mathbf{u}\|\|\mathbf{v}\|\cos\theta$
Open chapter →
Chapter 5

Vector Spaces

Span, linear independence, basis and dimension; the four fundamental subspaces of a matrix; change of basis.

$\operatorname{rank}A+\operatorname{nullity}A=n$
Open chapter →
Chapter 6

Linear Transformations

Functions that respect addition and scaling; kernel and range; every such map is a matrix.

$T(\mathbf{u}+\mathbf{v})=T(\mathbf{u})+T(\mathbf{v})$
Open chapter →
Chapter 7

Eigenvalues and Eigenvectors

Directions a matrix only stretches; diagonalisation; long-term behaviour of populations and Markov chains.

$A\mathbf{v}=\lambda\mathbf{v}$
Open chapter →
Chapter 8

Orthogonality and Least Squares

Perpendicular bases, Gram–Schmidt, projections, best-fit lines, and the spectral theorem for symmetric matrices.

$A^{T}A\hat{\mathbf{x}}=A^{T}\mathbf{b}$
Open chapter →
🗺️ How the chapters connect
  1. Systems (Ch. 1) are where everything starts: row reduction is the one algorithm you will use in every later chapter — to invert matrices, find bases, compute kernels and eigenvectors.
  2. Matrices (Ch. 2) package a whole system as $A\mathbf{x}=\mathbf{b}$. Multiplying matrices means doing one transformation after another; an inverse undoes it.
  3. Determinants (Ch. 3) compress a square matrix into one number: $\det A\ne0$ exactly when $A\mathbf{x}=\mathbf{b}$ has a unique solution for every $\mathbf{b}$.
  4. Vectors (Ch. 4) bring geometry: lengths, angles, perpendicularity, lines and planes in space.
  5. Vector spaces (Ch. 5) abstract the common pattern, so the same theorems work for arrows, polynomials, signals and matrices. Dimension and rank measure "how much freedom" a system has.
  6. Linear transformations (Ch. 6) are the functions of linear algebra — and every one of them between $\mathbb{R}^n$ and $\mathbb{R}^m$ is multiplication by a matrix.
  7. Eigenvalues (Ch. 7) find the special directions a transformation only stretches; they explain long-term behaviour and make powers $A^k$ easy.
  8. Orthogonality (Ch. 8) brings the geometry of Chapter 4 back to solve the problems of Chapter 1 that have no exact solution, in the best possible way.

Threads to watch for: the same question asked in different languages — "does $A\mathbf{x}=\mathbf{b}$ have a solution, and is it unique?" — answered by row reduction, by determinants, by rank, by invertibility and by eigenvalues; and the habit of turning geometry into algebra and back again.

🧭 How to use this course
  • Read with a pen. Try every worked example before opening its solution, then compare step by step. Linear algebra is learned by doing row reductions, not by watching them.
  • Play with the labs. Each section has two interactives; change the settings until you can predict what will happen before you press ▶ Play.
  • Do the exercises in order. They run from routine to challenging, and every part has a full solution. Check every answer by substituting it back — linear algebra is unusually easy to check.
  • Use the quiz as a gate. Five questions end every section; if you score below 4, reread before moving on.
  • Bilingual terms. Dotted words show their Arabic name and meaning; the ع button shows Arabic terms throughout. The Glossary and Formula Sheet collect everything in one place.

5. Readiness check — are you ready?

Eight quick questions on the school algebra this course uses every day: solving small systems, fractions, coordinates and function notation. Answer all of them; for each one you miss you will get a link to a review page.

Q1. The solution of $\ x+y=7,\ \ x-y=1\ $ is
Q2. If $2x+3y=12$ and $x=3$, then $y=$
Q3. $\dfrac23+\dfrac14=$
Q4. $\dfrac34\div\dfrac12=$
Q5. The solution of $\tfrac12x-3=2$ is
Q6. The slope of the line $2x+4y=8$ is
Q7. Which line passes through the point $(2,-1)$?
Q8. If $f(x)=3x-1$, then $f(2)+f(-1)=$

When you are ready, start with Chapter 1 — Systems of Linear Equations.