FS02E1: Function Inner-Product, Orthogonality, and Projection Exercises
FS02 introduced a geometric way to think about functions. For real-valued functions on an interval
[a,b], the inner product is
From this one definition come the ideas of:
This companion is designed as deliberate practice. Every problem is stated first. Hints come next.
Only after that are the complete worked solutions given.
The goal is not speed. The goal is to make the projection mechanism so familiar that the Fourier
coefficient derivations in FS04 and FS05 will feel like the same geometry in a trigonometric
basis.
Figure 1. The exercise path. The problems begin with direct inner products and norms, then
move through orthogonality and projection, and finish with weighted products and a preview of
building an orthogonal basis.
1 Problems
Problem 1: a vector projection warm-up
Let
Find the scalar c such that
is the projection of v onto e. Then compute the residual
and verify
Problem 2: a basic function inner product
On [−1, 1], compute
Is the result positive, negative, or zero? What does that sign tell us geometrically?
Problem 3: even and odd functions
On [−1, 1], compute
Then explain why the answer could have been predicted before integrating.
Problem 4: the interval matters
For the functions
compute the inner product on:
- [−2, 2],
- [0, 2].
Are the functions orthogonal on both intervals?
Problem 5: norm and normalization of a constant function
On [−L,L], where L > 0, let
Find:
- ∥f∥,
- a normalized function f(x) pointing in the same function-space direction.
Verify directly that
Problem 6: norm and normalization of x
On [−2, 2], compute
Then construct the normalized function
Problem 7: projection of x2 onto the constant function
On [−1, 1], project
onto
Find the projection coefficient
Then write
and verify explicitly that
Problem 8: projection onto a constant equals an average
On [0, 2], let
Project f onto the constant function 1. Then independently calculate the average value
Compare the two results.
Problem 9: project x3 onto x
On [−2, 2], project
onto
Find the coefficient c, the projected function cϕ, and the residual. Verify residual orthogonality
directly.
Problem 10: rescaling a basis function
On [−1, 1], project
first onto
and then onto
Compare:
- the two scalar projection coefficients,
- the two projected functions.
Explain why the coefficients differ even though the projected function is the same.
Problem 11: Pythagorean theorem for orthogonal functions
Suppose
Prove directly that
Do not skip the cross terms. Show explicitly why they vanish.
Problem 12: angle between two functions
On [−1, 1], find the angle 𝜃 between
using
Give the exact value of cos 𝜃 and an approximate angle in degrees.
Problem 13: projection onto two orthogonal functions
On [−1, 1], use the mutually orthogonal functions
Project
onto the span of these three functions.
Find the three coefficients
Then simplify the projected function.
Problem 14: verify the three-function residual
Use the projection found in Problem 13. Define
where P is the projection onto the three-function span.
Verify separately that
and
Problem 15: weighted projection
Define the weighted inner product on [0, 1] by
Project
onto the constant function
Compare the result with the unweighted projection of x onto 1 on [0, 1].
Problem 16: build a new orthogonal function by subtracting a projection
On [−1, 1], begin with
and subtract its projection onto the constant function 1.
Call the residual
Then:
- find q(x),
- verify q is orthogonal to 1,
- find ∥q∥,
- normalize q.
This is a preview of the Gram-Schmidt idea.
2 Hints
- For vector projection, use the same formula later used for functions:
- The integrand for ⟨1,x2⟩ is simply x2.
- The product xx2 = x3 is odd.
- Orthogonality is a property of the functions together with the chosen interval.
- For f = 1, the norm squared is the length of the interval.
- Start from
- For projection onto a constant, the denominator is the interval length.
- Compare the constant-projection formula with the ordinary average-value formula.
- On a symmetric interval, both numerator and denominator are even integrals.
- A rescaled basis function spans the same one-dimensional subspace.
- Expand the square of the norm using the inner product before using orthogonality.
- Compute the three quantities ⟨f,g⟩, ∥f∥, and ∥g∥ separately.
- Symmetry immediately gives the coefficient of x.
- If Problem 13 is correct, the residual must be orthogonal to every basis function used in the
projection.
- Remember that the Weight x is part of both numerator and denominator.
- Problem 7 already gives the projection of x2 onto 1 on [−1, 1].
3 Worked solutions
Solution 1: vector projection warm-up
The projection coefficient is
Compute the numerator:
| v ⋅ e | = (3)(2) + (4)(0) | (44)
|
| = 6. | (45) |
Compute the denominator:
| e ⋅ e | = (2)(2) + (0)(0) | (46)
|
| = 4. | (47) |
Thus
The projected vector is
The residual is
| r | = v − ce | (51)
|
| = −![[ ]
3
0](https://images.physicslibrary.org/cache/objects/1520/make4ht/FunctionInnerProductOrthogonalityAndProjectionExercises48x.png) | (52)
|
| = . | (53) |
Now check orthogonality:
| r ⋅ e | = (0)(2) + (4)(0) | (54)
|
| = 0. | (55) |
This is the finite-dimensional model for every projection calculation in the rest of the
companion.
Solution 2: basic function inner product
Use
An antiderivative is
Therefore
| ⟨1,x2⟩ | = −11 | (58)
|
| = − | (59)
|
| = . | (60) |
The inner product is positive. In the geometric language of FS02, the angle between these two
nonzero functions is acute rather than 90∘. They are not orthogonal.
Solution 3: even and odd functions
The inner product is
| ⟨x,x2⟩ | = ∫
−11x3 dx. | (61) |
An antiderivative is
Hence
| ∫
−11x3 dx | = −11 | (63)
|
| = − | (64)
|
| = 0. | (65) |
The same answer could have been predicted immediately because:
- x is odd,
- x2 is even,
- odd times even is odd,
- the integral of an odd function over a symmetric interval is zero.
Thus x and x2 are orthogonal on [−1, 1].
Solution 4: the interval matters
First use [−2, 2]:
| ⟨1,x⟩ | = ∫
−22xdx | (66)
|
| = −22 | (67)
|
| = 2 − 2 | (68)
|
| = 0. | (69) |
Thus 1 and x are orthogonal on [−2, 2].
Now use [0, 2]:
| ⟨1,x⟩ | = ∫
02xdx | (70)
|
| = 02 | (71)
|
| = 2. | (72) |
This is not zero. Therefore the same two formulas are not orthogonal on [0, 2].
Figure 2. Orthogonality depends on the interval. On a symmetric interval the positive and
negative contributions of the odd product cancel; on [0,2] there is no matching negative part.
Solution 5: norm and normalization of a constant function
The norm is
With f = 1,
| ∥1∥2 | = ∫
−LL12 dx | (74)
|
| = ∫
−LL1 dx | (75)
|
| = 2L. | (76) |
Therefore
Normalize by dividing by the norm:
Check its norm:
| ∥f∥2 | = ∫
−LL 2dx | (79)
|
| = ∫
−LL dx | (80)
|
| = (2L) | (81)
|
| = 1. | (82) |
Thus
Figure 3. Normalization changes the length of a function-space vector without changing its
direction. The normalized function has norm one.
Solution 6: norm and normalization of x
Start with
Because x2 is even,
| ∥x∥2 | = 2 ∫
02x2 dx | (85)
|
| = 2 02 | (86)
|
| = 2 | (87)
|
| = . | (88) |
Hence
The normalized function is
| x(x) | =  | (90)
|
| = x. | (91) |
Solution 7: project x2 onto the constant function
Use
The numerator was already found in Problem 2:
The denominator is
| ⟨1, 1⟩ | = ∫
−111 dx | (94)
|
| = 2. | (95) |
Therefore
| c | =  | (96)
|
| = . | (97) |
Thus the projected function is
The residual is
Check the residual inner product with 1:
| ⟨r, 1⟩ | = ∫
−11 dx | (100)
|
| = ∫
−11x2dx − ∫
−111 dx | (101)
|
| = − (2) | (102)
|
| = 0. | (103) |
So the residual contains no remaining constant component.
Figure 4. Projection splits x2 into a constant component 1∕3 and an orthogonal residual x2 − 1∕3.
The residual has zero inner product with the constant basis function.
Solution 8: constant projection equals the average
Project x2 onto 1 on [0, 2]:
The numerator is
| ∫
02x2 dx | = 02 | (105)
|
| = . | (106) |
The denominator is
Therefore
Now calculate the average directly:
| favg | = ∫
02x2 dx | (109)
|
| =   | (110)
|
| = . | (111) |
The two results are identical. Projection onto the constant function extracts the average value on
the interval.
Solution 9: project x3 onto x
Use
The numerator is
| ⟨x3,x⟩ | = ∫
−22x4 dx | (113)
|
| = 2 ∫
02x4 dx | (114)
|
| = 2 02 | (115)
|
| = 2 | (116)
|
| = . | (117) |
The denominator is
| ⟨x,x⟩ | = ∫
−22x2 dx | (118)
|
| = . | (119) |
Therefore
| c | =  | (120)
|
| =   | (121)
|
| = . | (122) |
The projection is
The residual is
Now verify orthogonality:
| ⟨r,x⟩ | = ∫
−22 xdx | (125)
|
| = ∫
−22x4 dx − ∫
−22x2 dx | (126)
|
| = −  | (127)
|
| = − | (128)
|
| = 0. | (129) |
Solution 10: rescaling the basis function
First project x3 onto x on [−1, 1].
The numerator is
The denominator is
Hence
| c1 | =  | (132)
|
| = . | (133) |
Thus
Now use ϕ2 = 2x. The numerator is
| ⟨x3, 2x⟩ | = 2 ∫
−11x4 dx | (135)
|
| = . | (136) |
The denominator is
| ⟨2x, 2x⟩ | = 4 ∫
−11x2 dx | (137)
|
| = . | (138) |
Therefore
| c2 | =  | (139)
|
| = . | (140) |
But the projected function is
| P2(x) | = c2(2x) | (141)
|
| = (2x) | (142)
|
| = x. | (143) |
Thus
The coefficient changed because the basis vector itself was rescaled. The one-dimensional subspace
did not change. Projection depends on the subspace, while the numerical coefficient depends on
how the basis vector is normalized.
Solution 11: Pythagorean theorem for orthogonal functions
Start from
Use linearity in both slots for real functions:
| ∥c1ϕ1 + c2ϕ2∥2 | = c
12⟨ϕ
1,ϕ1⟩ | (146)
|
| + c1c2⟨ϕ1,ϕ2⟩ | (147)
|
| + c2c1⟨ϕ2,ϕ1⟩ | (148)
|
| + c22⟨ϕ
2,ϕ2⟩. | (149) |
Orthogonality gives
Symmetry gives
Therefore both cross terms vanish:
| ∥c1ϕ1 + c2ϕ2∥2 | = c
12⟨ϕ
1,ϕ1⟩ + c22⟨ϕ
2,ϕ2⟩ | (152)
|
| = c12∥ϕ
1∥2 + c
22∥ϕ
2∥2. | (153) |
This is exactly the function-space analogue of the ordinary Pythagorean theorem.
Solution 12: angle between 1 and x2
The numerator is
The first norm is
| ∥1∥ | =  | (155)
|
| = . | (156) |
The second norm is
| ∥x2∥ | =  | (157)
|
| = . | (158) |
Therefore
| cos 𝜃 | =  | (159)
|
| =  | (160)
|
| = . | (161) |
Thus
The angle is acute because the inner product is positive.
Solution 13: projection onto three orthogonal functions
We use
Because the functions are mutually orthogonal, each coefficient can be calculated independently.
For ϕ0:
| c0 | =  | (164)
|
| =  | (165)
|
| = . | (166) |
For ϕ1 = x, symmetry gives
so
Now find c2. The numerator is
 | = ∫
−11 dx | (169)
|
| = −  | (170)
|
| = − | (171)
|
| =  | (172)
|
| = . | (173) |
The denominator is
 | = ∫
−11 2dx | (174)
|
| = ∫
−11 dx | (175)
|
| = − + (2) | (176)
|
| = − +  | (177)
|
| = − | (178)
|
| =  | (179)
|
| = . | (180) |
Therefore
| c2 | =  | (181)
|
| =   | (182)
|
| = . | (183) |
Thus the projection is
| P(x) | = +   | (184)
|
| = + x2 − | (185)
|
| = x2 − . | (186) |
Figure 5. Projection onto several mutually orthogonal functions is obtained one component at a
time. Orthogonality prevents the coefficient calculations from interfering with one another.
Solution 14: verify the three-function residual
From Problem 13,
Therefore
| r(x) | = x4 − P(x) | (188)
|
| = x4 − x2 + . | (189) |
First check ⟨r, 1⟩:
| ⟨r, 1⟩ | = ∫
−11 dx | (190)
|
| = − + (2) | (191)
|
| = − + . | (192) |
Use denominator 35:
− +  | = − +  | (193)
|
| = 0. | (194) |
Next check ⟨r,x⟩. The residual is even and x is odd, so the product is odd:
Finally check ⟨r,x2 − 1∕3⟩. A direct expansion gives
|   | (196)
|
| = x6 − x4 + x2 − . | (197) |
Therefore
 | = − +  − (2) | (198)
|
| = − + − . | (199) |
Put everything over 105:
Thus the residual is orthogonal to every function in the projection subspace.
Solution 15: weighted projection
The weighted projection coefficient is
The numerator is
| ⟨x, 1⟩w | = ∫
01x(x)(1) dx | (202)
|
| = ∫
01x2 dx | (203)
|
| = . | (204) |
The denominator is
| ⟨1, 1⟩w | = ∫
01x(1)(1) dx | (205)
|
| = . | (206) |
Thus
| cw | =  | (207)
|
| = . | (208) |
For comparison, the ordinary unweighted projection is
| c | =  | (209)
|
| = . | (210) |
The weighted inner product gives greater importance to larger x, so the projected constant shifts
upward from 1∕2 to 2∕3.
Figure 6. Weighting changes the geometry. With w(x) = x, the region near x = 1 contributes
more strongly, so the best constant component of f(x) = x moves from 1∕2 to 2∕3.
Solution 16: subtracting a projection to make a new orthogonal function
From Problem 7, the projection of x2 onto the constant function is
Therefore define
By construction,
We can verify this directly:
| ⟨q, 1⟩ | = ∫
−11 dx | (214)
|
| = − | (215)
|
| = 0. | (216) |
Now compute the norm squared:
| ∥q∥2 | = ∫
−11 2dx | (217)
|
| = . | (218) |
Thus
A normalized version is
Figure 7. Subtracting the projection of x2 onto the constant function produces x2 − 1∕3, which is
orthogonal to 1. This is the essential idea behind Gram-Schmidt orthogonalization.
4 What these exercises are preparing us to do
The repeated pattern is now clear. Given a candidate basis function ϕ, the coefficient of the
component of f along ϕ is
If the basis function is normalized,
so
For several mutually orthogonal functions,
with
The next mathematical question is therefore unavoidable:
FS03 answers that question by deriving the required trigonometric integrals from first
principles.
Figure 8. FS02E1 completes the projection toolkit. FS03 supplies the missing trigonometric fact:
distinct sine and cosine harmonics are orthogonal over the appropriate interval.
5 Further practice
- On [−3, 3], compute the norm of f(x) = 1 and normalize it.
- Determine whether x and x4 are orthogonal on [−2, 2].
- Project x4 onto the constant function on [−2, 2].
- Project x5 onto x on [−1, 1].
- Show that if ϕ and ψ are orthogonal, then Aϕ and Bψ are also orthogonal for any
finite constants A and B.
- On [−1, 1], calculate the angle between 1 and x4.
- With the weighted inner product
project f(x) = x onto 1.
- Starting from 1, x, and x2, explain in words why the first two already form an orthogonal
pair on [−1, 1] but x2 must have a constant component removed before all three can be
mutually orthogonal.
6 Summary
The function inner product
turns many familiar vector ideas into tools for functions.
A function is orthogonal to another when their inner product is zero. The norm is
Normalization gives
The projection coefficient of f onto a nonzero function ϕ is
The residual
satisfies
For mutually orthogonal basis functions, the coefficients are extracted independently.
A weighted inner product changes the geometry by changing how strongly different parts of the
interval contribute.
FS03 now specializes these general ideas to sine and cosine functions and proves their orthogonality
one integral at a time.
References
References
[1] PhysicsLibrary, FS02: Inner Products of Functions.
[2] E. Kreyszig, Advanced Engineering Mathematics, Wiley.
[3] R. Haberman, Applied Partial Differential Equations with Fourier Series and
Boundary Value Problems, Pearson.