When two finite dimensional vectors are orthogonal, i.e. perpendicular, their dot product is exactly zero, e.g. $$\mathbf{a}\cdot\mathbf{b}=a_1b_1+\cdots+a_nb_n=0.\tag{1}$$
When I studied functional analysis a long time ago, we used functions as "vectors" by way of an inner product. Consider the two functions $f(x)=\sin x$ and $g(x)=\cos x$. Functions $f$ and $g$ are said to be orthogonal over $[a,b]$ if (and only if?) $$\langle f,g\rangle=\int_a^bf(x)g(x)dx=0,\tag{2}$$ for some interval $[a,b]$. I kind of just accepted this definition, but the other day I was thinking about this...
Now, when it comes to vectors of finite dimension satisfying equation (1) the geometric interpretation of the two vectors is that they are perpendicular, e.g. imagine two $n$-dimensional lines in $\mathbb{R}^n$ and normal to each other.
Supposing (2) holds, then what does this say about $f$ and $g$ except that they are simply called orthogonal? Does (2) imply some (not necessarily geometric) relationship between functions $f$ and $g$ ?
EDIT
Didn't see these before, but related:
Let $V$ be the space of functions spanned by $f$ and $g$; that is, the space of all linear combinations $a f + b g$ (that is, the function $x \mapsto a f(x) + b g(x)$) where $a,b$ are real numbers.
Then, assuming $f$ and $g$ are linearly independent, $V$ is a two-dimensional inner product space — you really can think of this in the same fashion as any other two-dimensional inner space. Sure, $V$ is a small slice of the whole space of functions of the appropriate type, but it's the only slice that matters when $f$ and $g$ are the only functions under consideration!
In fact, you can even decompose the original space of functions into the sum of $V$ and its orthogonal complement $V^\bot$, in much the same way you can think of $\mathbb{R}^3$ as the sum of the $xy$-plane and the $z$ axis. (just that, in the analogy, you have a complicated space of functions rather than the simple $z$-axis)
e.g. if you took some orthonormal basis $u,v$ for $V$, then every function can be written as an ordered triple $h = (h_1, h_2, h_3)$ where $h_1,h_2 \in \mathbb{R}$ and $h_3 \in V^\bot$, corresponding to the function $h = h_1u + h_2v + h_3$. Then the inner product becomes
$$ \langle h, k \rangle = h_1 k_1 + h_2 k_2 + \langle h_3, k_3 \rangle$$