Using the standard inner product , compute on the interval and on the interval . On which interval are and orthogonal?
Multiply first, then integrate over each interval to see where the positive and negative areas cancel to .
We already know how to add and scale functions like vectors, and now we need a dot product for functions so we can check when two curves are perpendicular and project one function onto another.
For regular vectors, the dot product multiplies matching entries and adds them up, and two vectors are perpendicular when that sum is zero. How do we do the same thing for two continuous functions and on an interval?
On an interval , the standard inner product and the condition for orthogonality are:
Here is how we check which pairs of , , and are orthogonal on the interval .
The functions and are orthogonal only when the interval sits symmetrically around so the negative area below the -axis cancels the positive area above it; when the interval shifts to one side, such as , the areas no longer cancel and becomes nonzero.
Once we have an inner product, how do we measure the size of a single function and how far apart two functions are across an interval?
Squaring inside the integral makes the value at every positive or zero so positive and negative heights cannot cancel out:
We can now find the sizes of our first two basis polynomials, and , on .
We can change the interval of integration or multiply by a weight function when we care more about accuracy in some parts of the interval than others. Before we use a new rule , we have to check whether it obeys the same three rules as the dot product so lengths and projections still work the same way.
Any valid inner product must pass three checks for all functions and any constant :
Here is the deciding check for four candidate rules on .
Back on with the standard inner product , we know and are orthogonal, and and are orthogonal, but and have an overlap of . We want to adjust so that all three polynomials are mutually orthogonal on .
Just as with vectors, the projection of a function onto a basis function is Overlap divided by Size:
Subtracting the projections of onto and removes the overlap so all three basis functions are orthogonal.
While the parabola sits entirely above the -axis, its area with cannot cancel to zero; shifting it down to dips the middle below the axis just enough for the negative middle area to cancel the two positive outer areas.
Now we want to find the straight line that stays as close as possible to across the entire interval , minimizing the least-squares distance . Because and are already orthogonal on , we can find the closest line by projecting onto and separately.
Subtracting this projection from leaves the error , which is orthogonal to both and ; since it is odd, it is also orthogonal to , so it is the next orthogonal polynomial in our Gram-Schmidt list.
The flat tangent line matches right at the origin but leaves large vertical gaps near and , whereas the projection line cuts through to minimize the total squared gap across the whole interval.
Polynomials work well on a short interval, but when we want to approximate a function that repeats itself like a sound wave or an electrical signal, we need basis functions that oscillate. On the full period with the inner product , the family of waves is already mutually orthogonal without running Gram-Schmidt.
Because and oscillate symmetrically between and , their average height over is , which multiplies by the interval width to give a squared size of for every wave:
Now we want to approximate the square wave on , which equals on and jumps to on , using a sum of smooth sines and cosines called its Fourier series. Because our sine and cosine waves are already orthogonal on , we project onto each wave using Overlap over Size.
Everything in inner product spaces for functions comes from replacing the vector dot product with an integral over a chosen interval . Under the standard inner product , two functions are orthogonal when the positive and negative areas of their product cancel to , which always depends on the interval: on , but on . Squaring keeps positive and negative parts from canceling, giving the norm and the least-squares distance . If you are given a new candidate rule for , test Symmetry, Linearity, and Positivity ( for every nonzero ): a weighted integral is valid whenever across the interval (like ), and fails Positivity if is negative anywhere on the interval (like on ) or if derivatives turn a nonzero constant like into zero.
Every projection uses Overlap over Size:
When your basis is not yet orthogonal (such as on or ), run Gram-Schmidt by subtracting the projections of each new function onto the earlier orthogonal ones (giving on ). When your basis is already mutually orthogonal (such as the Legendre polynomials on or the waves on , where and ), do not run Gram-Schmidt again: project onto each basis function separately and add the projections to get the best polynomial or Fourier approximation. On any symmetric interval like or , check even and odd symmetry before integrating so you can spot zero overlaps like or immediately.
Using the standard inner product , compute on the interval and on the interval . On which interval are and orthogonal?
Multiply first, then integrate over each interval to see where the positive and negative areas cancel to .
On the interval with the standard inner product , find the norm and the distance between and .
For the distance, expand the squared vertical gap before integrating, and remember to take the square root at the end of both calculations.
Test whether each rule on the interval is a valid inner product. If a rule fails, name which check (Symmetry, Linearity, or Positivity) it breaks and give a counterexample: (a) (b) (c) (d)
For weighted integrals (a) and (b), check whether the weight stays strictly positive across . For (c), swap and or test a nonzero constant function. For (d), test scaling by a negative number.
On the interval with the standard inner product , run the Gram-Schmidt process on the basis to find three mutually orthogonal polynomials.
Start with . On , odd powers no longer cancel to zero, so for the third polynomial you must subtract the projections of onto both and .
Using the orthogonal Legendre basis on with , find the best least-squares quadratic approximation to .
Project onto each of the three orthogonal basis functions , , and using Overlap over Size, then add the three projections together.
On with , let for and elsewhere on . Find the Fourier series approximation of through frequency by projecting onto .
Use symmetry first to eliminate the sine waves. When computing the overlaps, integrate from to where , but keep the basis wave sizes over the full interval .