# Function Orthogonality
### Inner Product
We know that we can determine if two vectors are orthogonal by taking their dot product and determining if it is $0$. In the case of functions, we can apply the same sort of reasoning using the **[Inner Product](Inner%20Product.md)** (defined [here](https://youtu.be/TgKwz5Ikpc8?t=682) via 3b1b).
We can see [here](https://mathworld.wolfram.com/InnerProduct.html) that the inner product is defined as a generalization of the dot product. A **vector space** combined with it's inner product is called an **inner product space**. Examples include:
1. The real numbers, $\mathbb{R}$, where the inner product is given by:
$\langle x,y \rangle = xy$
2. The Euclidean space $\mathbb{R}^n$, where the inner product is given by the [Dot Product](Dot%20Product.md):
$\langle (x_1, x_2, \dots, x_n), (y_1, y_2, \dots, y_n) \rangle
= x_1y_1 + x_2y_2 + \dots + x_ny_n$
3. The vector space of *real functions* whose domain is the closed interval $[a,b]$ with inner product:
$\langle f, g \rangle = \int_a^b fgdx$
To see more of the nuance related to this, again watch [this video](https://www.youtube.com/watch?v=cXNEIHpnYlg).
### Orthogonality
So, what does this mean in terms of function orthogonality? Well, if the inner product of our two functions is equal to $0$ then our functions are said to be *orthogonal*. In other words, we want to see if the following is true:
$\langle f, g \rangle = \int_a^b fgdx = 0$
A specific example of two orthogonal functions can be seen below via looking at $sin(x)$ and $sin(2x)$. We see that are first we can take a subset of $x$ and evaluate them both across the subset, then take the dot product of those resulting vectors.

This yields an approximation, since we only evaluated on a subset of $x$ (where $x \in \mathbb{R}$). What we really to need to do is let our interval between the values of our subset of of $x$ decrease, taking the limit as it goes to $0$. This will yield an integral, known as the *inner product*:

---
References
[Function Orthogonality Explained](https://www.youtube.com/watch?v=cXNEIHpnYlg)
[Inner product of two functions](https://math.stackexchange.com/questions/1414389/what-is-the-geometric-meaning-of-the-inner-product-of-two-functions?noredirect=1&lq=1)