# Engineering Analysis/L2 Space

The L$_2$ space is very important to engineers, because functions in this space do not need to be continuous. Many discontinuous engineering functions, such as the delta (impulse) function, the unit step function, and other discontinuous functions are part of this space.

## L2 Functions

A large number of functions qualify as L$_2$ functions, including uncommon, discontinuous, piece-wise, and other functions. A function which, over a finite range, has a finite number of discontinuities is an L$_2$ function. For example, a unit step and an impulse function are both L$_2$ functions. Also, other functions useful in signal analysis, such as square waves, triangle waves, wavelets, and other functions are L$_2$ functions.
In practice, most physical systems have a finite amount of noise associated with them. Noisy signals and random signals, if finite, are also L$_2$ functions: this makes analysis of those functions using the techniques listed below easy.

## Null Function

The null functions of L$_2$ are the set of all functions φ in L$_2$ that satisfy the equation:
    $\int _{a}^{b}|\phi (x)|^{2}dx=0$
for all a and b.

## Norm

The L$_2$ norm is defined as follows:
[L2 Norm]
    $\|f(x)\|_{L_{2}}={\sqrt {\int _{a}^{b}|f(x)|^{2}dx}}$
If the norm of the function is 1, the function is normal.
We can show that the derivative of the norm squared is:
    ${\frac {\partial \|x\|^{2}}{\partial x}}=2x$

## Scalar Product

The scalar product in L$_2$ space is defined as follows:
[L2 Scalar Product]
    $\langle f(x),g(x)\rangle _{L_{2}}=\int _{a}^{b}f(x)g(x)dx$
If the scalar product of two functions is zero, the functions are orthogonal.
We can show that given coefficient matrices A and B, and variable x, the derivative of the scalar product can be given as:
    ${\frac {\partial }{\partial x}}\langle Ax,Bx\rangle =A^{T}Bx+B^{T}Ax$
We can recognize this as the product rule of differentiation. Generalizing, we can say that:
    ${\frac {\partial }{\partial x}}\langle f(x),g(x)\rangle =f'(x)g(x)+f(x)g'(x)$
We can also say that the derivative of a matrix A times a vector x is:
    ${\frac {d}{dx}}Ax=A^{T}$

## Metric

The metric of two functions (we will not call it the "distance" here, because that word has no meaning in a function space) will be denoted with ρ(x,y). We can define the metric of an L$_2$ function as follows:
[L2 Metric]
    $\rho (x,y)_{L_{2}}={\sqrt {\int _{a}^{b}|f(x)-g(x)|^{2}dx}}$

## Cauchy-Schwarz Inequality

The Cauchy-Schwarz Inequality still holds for L$_2$ functions, and is restated here:
    $|\langle f(x),g(x)\rangle |\leq \|f\|\|g\|$

## Linear Independence

A set of functions in L$_2$ are linearly independent if:
    $a_{1}f_{1}(x)+a_{2}f_{2}(x)+\cdots +a_{n}f_{n}(x)=0$
If and only if all the a coefficients are 0.

## Grahm-Schmidt Orthogonalization

The Grahm-Schmidt technique that we discussed earlier still works with functions, and we can use it to form a set of linearly independent, orthogonal functions in L$_2$.
For a set of functions φ, we can make a set of orthogonal functions ψ that space the same space but are orthogonal to one another:
[Grahm-Schmidt Orthogonalization]
    $\psi _{1}=\phi _{1}$
    $\psi _{i}=\phi _{i}-\sum _{n=1}^{i-1}{\frac {\langle \psi _{n},\phi _{i}\rangle }{\langle \psi _{n},\psi _{n}\rangle }}\psi _{n}$

## Basis

The L$_2$ is an infinite-basis set, which means that any basis for the L$_2$ set will require an infinite number of basis functions. To prove that an infinite set of orthogonal functions is a basis for the L$_2$ space, we need to show that the null function is the only function in L$_2$ that is orthogonal to all the basis functions. If the null function is the only function that satisfies this relationship, then the set is a basis set for L$_2$.
By definition, we can express any function in L$_2$ as a linear sum of the basis elements. If we have basis elements φ, we can define any other function ψ as a linear sum:
    $\psi (x)=\sum _{n=1}^{\infty }a_{n}\phi _{n}(x)$
We will explore this important result in the section on Fourier Series.