Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Inner product spaces and orthogonality, revisited

~16 min

Linear Algebra's dot product measures whether two vectors are perpendicular. The same idea, pointed at functions instead of vectors, is the single fact every Fourier coefficient formula in chapter 3 is built from. This section carries orthogonality across that bridge: same definition, same test for zero, a genuinely new kind of object it applies to.

Perpendicular vectors in the plane point in genuinely independent directions. Nothing about one is "contained" in the other. The inner product \int fg\,dx measures the function version of the same idea: overlap. Multiply f and g together and integrate. A large positive result means the two functions tend to be positive, or both negative, together: real overlap. A large negative result means they tend to point opposite ways. An integral of exactly 0 means the positive overlap and the negative overlap cancel perfectly. The two functions share none of the same "direction," in exactly the sense that two perpendicular vectors share none of the same direction. Take \sin x and \sin 2x: they're orthogonal on [-\pi,\pi] — running from negative to positive \pi, the usual constant, roughly 3.14 — not because either function is small, but because their product spends equal area above and below zero across that stretch.

The trap is treating "orthogonal" as a property of one pair that automatically spreads to the rest of a list. It doesn't. Confirming \sin x \perp \cos x says nothing yet about whether \cos x \perp \cos 2x. That's a completely different integral. It has to be checked on its own before either pair's result can be trusted to represent the whole family.

An inner product on a vector space assigns a number \langle u, v\rangle to every pair of vectors, generalizing the familiar dot product u\cdot v = \sum u_iv_i on \mathbb{R}^n. An inner product space is a vector space equipped with such a rule. Two vectors are orthogonal when \langle u,v\rangle = 0; this zero-inner-product property is exactly what orthogonality means, whether the objects being compared are vectors or, as below, functions. Nothing in that definition requires u and v to be arrows in \mathbb{R}^n. The same structure transfers directly to functions, by defining the inner product of two functions f,g on an interval [a,b] as \langle f, g\rangle = \int_a^b f(x)g(x)\,dx. Two functions are orthogonal on [a,b] exactly when this integral is 0. It's the function-space version of a right angle, verified by computing an integral instead of a dot product.

The specific fact this course leans on constantly is that the family \{1, \cos x, \sin x, \cos 2x, \sin 2x, \dots\} is mutually orthogonal on [-\pi,\pi]. Every distinct pair from that list has inner product 0. This isn't obvious from staring at the functions. It has to be verified by direct integration, using the product-to-sum identities (\sin A\sin B, \cos A\cos B, and \sin A\cos B each rewrite as a sum of two simple cosines or sines) to turn each integral into something computable by hand. A set is only confirmed orthogonal once every pair of its distinct members has been checked this way. One confirmed pair says nothing about any other pair in the same set.

Theorem

The Cauchy–Schwarz Inequality

Recalled from Linear Algebra — Vectors, Matrices, and the Geometry of Data · The angle between two vectors, and Cauchy-Schwarz — first taught there.

🔖

For any vectors \mathbf{u}, \mathbf{v} \in \mathbb{R}^n: |\mathbf{u} \cdot \mathbf{v}| \le \lVert\mathbf{u}\rVert\,\lVert\mathbf{v}\rVert

with equality exactly when \mathbf{u} and \mathbf{v} are parallel (one is a scalar multiple of the other, or either vector is \mathbf{0}).

If \mathbf{v} = \mathbf{0} both sides are 0 and the inequality holds trivially, so assume \mathbf{v} \neq \mathbf{0}.

Build a function of a single real variable t by looking at the squared length of \mathbf{u} - t\mathbf{v}. A squared length can never be negative, so for every t, 0 \le \lVert\mathbf{u} - t\mathbf{v}\rVert^2 = (\mathbf{u} - t\mathbf{v})\cdot(\mathbf{u} - t\mathbf{v}).

Expand the dot product using bilinearity: 0 \le \mathbf{u}\cdot\mathbf{u} - 2t\,(\mathbf{u}\cdot\mathbf{v}) + t^2\,(\mathbf{v}\cdot\mathbf{v}) = \lVert\mathbf{v}\rVert^2\,t^2 - 2(\mathbf{u}\cdot\mathbf{v})\,t + \lVert\mathbf{u}\rVert^2.

This is a quadratic in t with positive leading coefficient \lVert\mathbf{v}\rVert^2 (since \mathbf{v} \neq \mathbf{0}), and it never dips below 0 — so it can have at most one real root, meaning its discriminant cannot be positive: \left(-2(\mathbf{u}\cdot\mathbf{v})\right)^2 - 4\lVert\mathbf{v}\rVert^2\lVert\mathbf{u}\rVert^2 \le 0.

Simplify: 4(\mathbf{u}\cdot\mathbf{v})^2 \le 4\lVert\mathbf{u}\rVert^2\lVert\mathbf{v}\rVert^2 \quad\Longrightarrow\quad (\mathbf{u}\cdot\mathbf{v})^2 \le \lVert\mathbf{u}\rVert^2\lVert\mathbf{v}\rVert^2.

Taking square roots of both (nonnegative) sides gives |\mathbf{u}\cdot\mathbf{v}| \le \lVert\mathbf{u}\rVert\,\lVert\mathbf{v}\rVert.

Equality case. The discriminant is exactly 0 precisely when the quadratic touches 0 at its unique root t_0, i.e. when \lVert\mathbf{u} - t_0\mathbf{v}\rVert^2 = 0 for some t_0 — which forces \mathbf{u} - t_0\mathbf{v} = \mathbf{0}, so \mathbf{u} = t_0\mathbf{v}. Equality in the inequality therefore holds exactly when \mathbf{u} is a scalar multiple of \mathbf{v} (covering \mathbf{u} = \mathbf{0} as the t_0 = 0 case).

Sanity check: take \mathbf{u} = \mathbf{v}. Then the left side is |\mathbf{u}\cdot\mathbf{u}| = \lVert\mathbf{u}\rVert^2 and the right side is \lVert\mathbf{u}\rVert\,\lVert\mathbf{u}\rVert = \lVert\mathbf{u}\rVert^2 — equality, exactly as the parallel case demands since a vector is trivially a scalar multiple of itself.

Predict, then check the shaded area

Pick f and g, predict whether they're orthogonal on [-\pi,\pi], then see the actual integral.

Loading interactive…

Worked example

Verifying an orthogonal pair by direct integration

  1. 1

    Verify that \sin x and \sin 2x are orthogonal on [-\pi,\pi].

  2. 2

    \langle \sin x, \sin 2x\rangle = \int_{-\pi}^{\pi} \sin x \sin 2x\,dx. Use the product-to-sum identity \sin A\sin B = \frac12[\cos(A-B)-\cos(A+B)] with A=x, B=2x: \sin x\sin 2x = \tfrac12[\cos(-x) - \cos(3x)] = \tfrac12[\cos x - \cos 3x].

  3. 3
    \int_{-\pi}^{\pi}\tfrac12[\cos x-\cos 3x]\,dx = \tfrac12\Big[\sin x - \tfrac13\sin 3x\Big]_{-\pi}^{\pi}.

    both \sin(n\pi) and \sin(-n\pi) are 0 for every integer n

  4. 4

    Every term evaluates to 0 at both endpoints. \boxed{\int_{-\pi}^{\pi}\sin x\sin 2x\,dx = 0} The prediction confirmed: orthogonal.

Watch the running integral decide it

Drag m and n. Predict whether the running integral lands back on 0 at x=\pi.

Loading interactive…

Worked example

The same-index case is different

  1. 1

    Compute \displaystyle\int_{-\pi}^{\pi}\sin(3x)\sin(3x)\,dx.

    Special case. This is the m=n case the widget above lets a reader drag straight into. It behaves nothing like the m\ne n case.

  2. 2

    \sin(3x)\sin(3x) = \sin^2(3x) = \frac{1-\cos(6x)}{2}, using \sin^2\theta = \frac{1-\cos2\theta}{2}.

  3. 3
    \int_{-\pi}^{\pi}\frac{1-\cos 6x}{2}\,dx = \frac12\Big[x - \tfrac16\sin 6x\Big]_{-\pi}^{\pi} = \frac12\big[(\pi-0)-(-\pi-0)\big] = \pi.
  4. 4
    \boxed{\int_{-\pi}^{\pi}\sin^2(3x)\,dx = \pi \ne 0}

    Not orthogonal to itself. Nothing ever is, since \sin^2 is never negative. This exact number, \pi, is what makes chapter 3's coefficient formulas divide by \pi specifically.

Loading interactive…

Worked example

A shortcut from section 1: symmetry decides it instantly

  1. 1

    Determine \displaystyle\int_{-\pi}^{\pi}\sin x\cos x\,dx without a product-to-sum identity.

    Alternative method. \sin x is odd and \cos x is even, so their product \sin x\cos x is odd (odd \times even = odd, from section 1). An odd integrand over a symmetric interval integrates to 0 automatically, with no antiderivative needed at all.

  2. 2

    \sin x\cos x is odd, and [-\pi,\pi] is symmetric about 0.

  3. 3
    \boxed{\int_{-\pi}^{\pi}\sin x\cos x\,dx = 0}

    Faster than the product-to-sum route above, but only because this particular pair happens to multiply to an odd function. The shortcut doesn't apply to the \sin\cdot\sin or \cos\cdot\cos pairs, which are always even and need the full identity.

Worked example

One confirmed pair doesn't confirm the set

  1. 1

    Having just confirmed \sin x \perp \cos x above, is it safe to conclude \cos x \perp \cos 2x as well, without checking?

    Common trap. It's tempting to treat one confirmed orthogonal pair as evidence the whole trig family is "just orthogonal," and skip the next pair's integral.

  2. 2

    \cos x\cos 2x = \tfrac12[\cos(x)+\cos(3x)], by the product-to-sum identity \cos A\cos B=\frac12[\cos(A-B)+\cos(A+B)]. That's a completely different computation from either integral above.

  3. 3
    \int_{-\pi}^{\pi}\tfrac12[\cos x+\cos 3x]\,dx = \tfrac12\Big[\sin x+\tfrac13\sin 3x\Big]_{-\pi}^{\pi} = 0.
  4. 4

    \boxed{\cos x\perp\cos 2x\text{ on }[-\pi,\pi]}. True, but only because this integral was actually computed, not because a different pair checked out earlier. Chapter 3's coefficient formulas rely on every pair in the family being orthogonal, established pair by pair (or proven once, in general, the way a full course would).

Loading interactive…

Where this goes next

Fourier coefficient formulas, chapter 3

Every Fourier coefficient formula is a direct consequence of this orthogonality. Multiplying a periodic function by one member of the trig family and integrating makes every other term in its Fourier series vanish, by the exact orthogonality computed above. That leaves only the one coefficient being solved for. Chapter 5 goes further and reframes this whole picture geometrically. There, a Fourier coefficient turns out to be an ordinary orthogonal projection, precisely the operation the next section studies.

Check your understanding (counts toward your progress)

Unlike the m\neq n case above, evaluate this same-index integral: \displaystyle\int_{-\pi}^{\pi}\cos^2(2x)\,dx.

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Any equivalent form counts — 2x+3, 3 + 2·x, … Use the keypad below the field for fractions, roots, and other symbols.

Why

\cos^2(2x) = \frac{1+\cos(4x)}{2}; integrating over [-\pi,\pi], the \cos(4x) term vanishes and \frac12 integrated over a length-2\pi interval gives \pi — the same-index case is never zero.

Correct answer

Also accepted:

Why

Use the power-reduction identity \cos^2\alpha = \frac{1+\cos(2\alpha)}{2} before integrating.

Is \displaystyle\int_{-\pi}^{\pi}\cos(x)\cos(3x)\,dx equal to 0?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

\cos x and \cos 3x are two distinct members of the trig family — the product-to-sum identity turns this integral into a sum of two sines evaluated at \pm\pi, both zero.

Why

\cos x\cos 3x = \frac12[\cos(2x)+\cos(4x)], and integrating each cosine term over a full number of its own periods on [-\pi,\pi] gives 0.

Use the product-to-sum identity to rewrite \cos x\cos 3x as a sum of two cosines, then integrate each separately.

You've confirmed \sin x \perp \cos x on [-\pi,\pi]. Does that alone confirm \cos x \perp \cos 2x too?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Every pair is a separate integral — confirming one pair says nothing about a different pair.

Why

Orthogonality of a set requires every distinct pair to check out, and each pair is its own integral; one confirmed pair provides no shortcut for any other pair.

Practice: One more pair, one more same-index case (4 problems · doesn’t affect your progress)

Compute \displaystyle\int_{-\pi}^{\pi}\sin(2x)\cos(x)\,dx to verify the orthogonality relation.

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Why

\sin(2x) is odd and \cos(x) is even, so their product is odd; an odd integrand over the symmetric interval [-\pi,\pi] integrates to 0.

Correct answer

Also accepted:

Why

0

Find \displaystyle\int_{-\pi}^{\pi}\cos(2x)\cos(2x)\,dx.

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Any equivalent form counts — 2x+3, 3 + 2·x, … Use the keypad below the field for fractions, roots, and other symbols.

Why

Same-index case: \cos^2(2x)=\frac{1+\cos(4x)}{2}, and integrating over [-\pi,\pi] leaves \pi once the \cos(4x) term vanishes.

Correct answer

Also accepted:

Why

pi

For functions f,g on [a,b], what does \langle f,g\rangle=\int_a^b f(x)g(x)\,dx=0 mean?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

The inner product being 0 says nothing about f and g being equal — two very different, nonzero functions can still have zero overlap.

Plenty of nonzero function pairs have inner product 0 — a zero inner product doesn't force either function itself to be zero.

Why

A zero inner product is exactly the function-space definition of orthogonality — the same test that decides perpendicularity for ordinary vectors.

f and g are orthogonal on [a,b]

You've verified \cos x \perp \sin x and \cos x \perp \sin(2x) on [-\pi,\pi]. Have you confirmed the set \{\cos x, \sin x, \sin 2x\} is mutually orthogonal?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Two pairs were checked, but a 3-element set has three distinct pairs — the third one, \sin x against \sin(2x), hasn't been touched yet.

Why

Mutual orthogonality requires every distinct pair to be verified; with three functions there are three pairs, and only two have been checked so far.

No — \sin x \perp \sin(2x) still needs its own check

Feeling good about this section?

Take the section quiz

Every answer gets a full explanation at the end.

Graph settings

Calculator

Sign in to save highlights

Insert an equation

  • No matches.