From Vectors to Functions

Change of basis: the same idea connects $\mathbb{R}^2$ to Fourier series

From Vectors to Functions: Change of Basis

A vector doesn’t change when you describe it in a different basis—only its coordinates do. This is change of basis in two dimensions. The remarkable thing is that the exact same idea works in infinite dimensions: a function is a “vector,” sines and cosines are the “basis,” and Fourier coefficients are the “coordinates.”

R² — Change of Basis (drag vector or basis vectors)
Finite ($\mathbb{R}^2$)Function Space
Vector $\mathbf{v}$Function $f(x)$
Basis $\{e_1, e_2\}$Basis $\{1, \cos x, \sin x, \cos 2x, \ldots\}$
Dot product $\mathbf{v} \cdot e_1$Inner product $\int f(x)\cos(nx)\,dx$
Coordinates $(v_1, v_2)$Fourier coefficients $(a_0, a_1, b_1, \ldots)$
Change-of-basis matrix $P$(infinite-dimensional)
Function Space — f(x) and its Fourier reconstruction
Fourier Coefficients — coordinates in the sine/cosine basis
Finite Dimensions ($\mathbb{R}^2$)
0° (standard basis)
Loading...

Function Space
5 terms

Loading...

Change of Basis in $\mathbb{R}^2$

The vector $\mathbf{v} = (2, 1)$ in the standard basis is the same arrow in the plane no matter how you describe it. But if you rotate your basis vectors by 45°, the same vector gets different coordinates. The vector hasn’t moved—your description of it has changed.

The change-of-basis matrix $P$ has the new basis vectors as its columns (expressed in the old coordinates). To find the coordinates in the new basis, you compute $P^{-1}\mathbf{v}$. Drag the basis vectors or adjust the angle slider to see this in action.

The Change-of-Basis Matrix

If the new basis is $\{b_1, b_2\}$, the matrix $P = [b_1 \mid b_2]$ converts from new coordinates to old: if $[\mathbf{v}]_B = (x', y')$, then $\mathbf{v} = x'b_1 + y'b_2 = P[\mathbf{v}]_B$. Going the other direction: $[\mathbf{v}]_B = P^{-1}\mathbf{v}$.

Function Spaces

Here is the profound leap. A function $f(x)$ on $[0, 2\pi]$ can be thought of as a vector in an infinite-dimensional space. Each point $x$ gives one “component” of the vector. The space of all such functions is a vector space—you can add functions and scale them, and all the axioms hold.

Inner Products

The dot product $\mathbf{v} \cdot \mathbf{w} = v_1 w_1 + v_2 w_2$ generalizes to the inner product of functions:

$$\langle f, g \rangle = \frac{1}{\pi} \int_0^{2\pi} f(x)\,g(x)\,dx$$

This measures “how much of $g$ is in $f$”—exactly like the dot product measures how much of one vector points in the direction of another.

Orthogonality

The standard basis vectors are orthogonal: $e_1 \cdot e_2 = 0$. The sine and cosine functions have the same property:

$$\int_0^{2\pi} \sin(mx)\sin(nx)\,dx = 0 \quad \text{for } m \neq n$$

This is not a coincidence—it’s the exact same structure. The sines and cosines form an orthogonal basis for function space, just as $e_1$ and $e_2$ form an orthogonal basis for $\mathbb{R}^2$.

Fourier Series as Change of Basis

The Fourier coefficients $a_n$ and $b_n$ are found by projecting $f$ onto each basis function:

$$a_n = \frac{1}{\pi} \int_0^{2\pi} f(x)\cos(nx)\,dx \qquad b_n = \frac{1}{\pi} \int_0^{2\pi} f(x)\sin(nx)\,dx$$

This is the infinite-dimensional version of $[\mathbf{v}]_B = P^{-1}\mathbf{v}$. The coefficients are the coordinates of $f$ in the sine/cosine basis. The reconstruction $f(x) \approx a_0/2 + \sum(a_n\cos(nx) + b_n\sin(nx))$ is the change of basis in action.

The Profound Connection

Everything in linear algebra—basis, coordinates, inner products, projections, orthogonality—works in infinite dimensions. Fourier analysis isn’t a separate subject from linear algebra. It is linear algebra, in a bigger space. The 2D rotation you see in the top canvas and the Fourier decomposition in the bottom canvas are the same mathematical operation, generalized.