FS05E1: Fourier Sine- and Constant-Coefficient Derivation Exercises
FS05 completed the real Fourier coefficient set on [−π,π]:
and
This companion concentrates on the two pieces introduced most directly in FS05: the sine
coefficients bn and the constant projection a0∕2. The goal is to make the coefficient formulas
behave like projection tools rather than formulas to memorize.
The interval remains [−π,π] throughout. Rescaling to [−L,L] belongs to FS06.
Figure 1. The exercise sequence moves from direct sine-harmonic isolation and the constant
projection to parity shortcuts, integration by parts, odd piecewise functions, residual checks, and
complete coefficient bookkeeping.
1 Three reusable checks
Sine-coefficient extraction check
A sine-coefficient extraction check verifies that multiplication by sin(mx) followed by integration
over a complete period removes the constant term, all cosine terms, and all sine harmonics except
the mth one.
For a finite trigonometric polynomial,
the check should end with
Constant-projection mean check
A constant-projection mean check verifies both
and
The second expression is the mean value of f over one complete period.
Sine-projection residual check
After projecting f onto sin(mx),
define
A correct projection satisfies
Figure 2. Sine-harmonic isolation acts as an orthogonality filter. Multiplication by the target sine
harmonic and integration over a full period removes every component except the matching sine
term.
2 Problems
All problems are stated before the hints and complete worked solutions.
Problem 1: isolate one sine coefficient from a known finite sum
Let
Evaluate
by expanding every contribution. Do not simply read the answer from the given function.
Problem 2: rebuild the general sine-coefficient formula
Assume
Multiply by sin(mx), integrate over [−π,π], and derive Equation (3) for 1 ≤ m ≤ N.
Problem 3: recover the constant coefficient and the mean
For
compute a0 by integration. Then identify the actual constant term a0∕2 and the mean value of f
over one period.
Problem 4: sine projection from the general projection formula
Use
with
on [−π,π] to derive Equation (3) directly.
Problem 5: residual orthogonality for the ramp
For
the first sine coefficient is
Define
Verify directly that
Problem 6: odd-function shortcut for bn
Suppose f is odd. Starting from Equation (3), prove
Problem 7: even functions have no sine coefficients
Suppose f is even. Prove that
for every positive integer n.
Problem 8: the odd ramp f(x) = x
For
find a0, all an, and all bn. Carry out the integration by parts explicitly and show that
Write the resulting real Fourier series.
Problem 9: odd square wave
Define
Find a0, all an, and all bn. Show explicitly why only odd sine harmonics survive.
Problem 10: a DC offset plus an odd ramp
Let
Determine a0, an, and bn. Explain why adding the constant 2 changes only the constant projection
and leaves all nonzero harmonic coefficients unchanged from the ramp example.
Problem 11: finite-width odd pulse
For 0 < α < π, define
Find all Fourier coefficients. Show that
Problem 12: a two-level waveform with nonzero mean
Define
Find the constant projection and all sine coefficients. Interpret the result by writing f as a
constant plus an odd square wave.
Problem 13: normalized sine basis
Define
Show that ∥ϕn∥ = 1. If
show that
Then verify that
Problem 14: energy bookkeeping for a finite orthogonal sum
Let
Compute
using orthogonality rather than expanding the entire square. Then verify the result by identifying
the squared norms of the constant and sine components.
Problem 15: direct coefficient check for a mixed finite sum
For
compute a0, b3, and b5 using their integral formulas. Explain why the cosine term does not
contaminate either sine coefficient.
Problem 16: derive the complete coefficient bookkeeping for a shifted square wave
Let
Find a0, all an, and all bn. Then rewrite the function as
where q(x) is the odd square wave from Problem 9, and show that this decomposition predicts the
same coefficients immediately.
Figure 3. The constant projection is the mean level. A waveform can often be understood as a
horizontal mean level plus an oscillatory part whose average over one period is zero.
3 Hints
- Expand the integral into five terms. Only the sin 4x sin 4x term has a nonzero full-period
integral.
- Use the three orthogonality relations from FS03. Keep the n = m sine-sine term
separate.
- Every nonconstant sine or cosine harmonic integrates to zero over [−π,π].
- Evaluate ⟨sin(mx), sin(mx)⟩ before simplifying the projection formula.
- Evaluate ∫
x sin xdx by parts, then subtract 2 ∫
sin 2xdx.
- If f and sin(nx) are both odd, what is the parity of their product?
- An even function times an odd function is odd.
- Use odd symmetry first. For the remaining integral choose u = x and dv = sin(nx) dx.
- Use odd symmetry. Then evaluate ∫
0π sin(nx) dx.
- Split f = 2 + x before integrating.
- Use odd symmetry and note that the function vanishes outside [0,α] on the positive
half interval.
- First calculate the mean. Then write the waveform as 2+q(x) where q is an odd square
wave of amplitude 1.
- The norm squared of sin(nx) is π.
- Orthogonal components contribute additively to the squared norm.
- Apply the coefficient formulas directly. The mixed sine-cosine inner products vanish.
- The average of the two levels is 3 and half their difference is 2.
4 Complete worked solutions
Solution 1: isolate one sine coefficient from a known finite sum
We must evaluate
∫
−ππf(x) sin 4xdx | = ∫
−ππ sin 4xdx. | (39) |
Distribute the integral:
| ∫
−ππ sin 4xdx + ∫
−ππ cos x sin 4xdx | (40)
|
| − ∫
−ππ sin 2x sin 4xdx + ∫
−ππ cos 3x sin 4xdx | (41)
|
| + ∫
−ππ sin 24xdx. | (42) |
The first integral vanishes because a sine harmonic has zero full-period average. The second and
fourth vanish by sine-cosine orthogonality. The third vanishes because the two sine harmonics have
different indices. The last integral is
Therefore
The extraction procedure recovers the coefficient multiplying sin 4x.
Solution 2: rebuild the general sine-coefficient formula
Start with
Multiply by sin(mx):
| f(x) sin(mx) | = sin(mx) | (46)
|
| + ∑
n=1Na
n cos(nx) sin(mx) | (47)
|
| + ∑
n=1Nb
n sin(nx) sin(mx). | (48) |
Integrate from −π to π:
| ∫
−ππf(x) sin(mx) dx | = ∫
−ππ sin(mx) dx | (49)
|
| + ∑
n=1Na
n ∫
−ππ cos(nx) sin(mx) dx | (50)
|
| + ∑
n=1Nb
n ∫
−ππ sin(nx) sin(mx) dx. | (51) |
Now apply orthogonality.
The constant-sine integral is zero:
Every cosine-sine inner product is zero:
For the sine-sine terms,
Therefore every sine term disappears except n = m:
Divide by π:
Solution 3: recover the constant coefficient and the mean
Use
Thus
| a0 | = ∫
−ππ dx | (58)
|
| =  ![[6 (2 π) + 0 + 0 + 0]](https://images.physicslibrary.org/cache/objects/1540/make4ht/FourierSineAndConstantCoefficientDerivationExercises60x.png) | (59)
|
| = 12. | (60) |
The Fourier series contains the constant term
The mean is
∫
−ππf(x) dx | = (12π) | (62)
|
| = 6. | (63) |
So the constant term and the mean agree, as they must.
Solution 4: sine projection from the general projection formula
The projection coefficient of f onto ϕ is
Set
The numerator is
The denominator is
| ⟨sin(mx), sin(mx)⟩ | = ∫
−ππ sin 2(mx) dx | (67)
|
| = π. | (68) |
Therefore
This is exactly bm.
Figure 4. After the mth sine projection is removed, the residual has zero inner product with that
same sine basis function. This is the function-space analogue of a perpendicular vector residual.
Solution 5: residual orthogonality for the ramp
We need
Separate the terms:
For the first integral, x sin x is even, so
Integrate by parts with
so
Then
| ∫
0πx sin xdx | =
0π + ∫
0π cos xdx | (75)
|
| = π. | (76) |
Thus
Also,
Therefore
| ∫
−ππr
1(x) sin xdx | = 2π − 2π | (79)
|
| = 0. | (80) |
The residual is orthogonal to the basis function used in the projection.
Solution 6: odd-function shortcut for bn
If f is odd, then sin(nx) is also odd. The product of two odd functions is even:
Therefore
| bn | = ∫
−ππf(x) sin(nx) dx | (82)
|
| = ∫
0πf(x) sin(nx) dx. | (83) |
This is the odd-function shortcut.
Solution 7: even functions have no sine coefficients
If f is even and sin(nx) is odd, their product is odd:
An odd integrand has zero integral over a symmetric interval:
Hence
Figure 5. Parity predicts whole families of Fourier coefficients before any detailed integration: even
functions have no sine coefficients, while odd functions have no constant or cosine coefficients.
Solution 8: the odd ramp f(x) = x
Because x is odd,
For the sine coefficient,
| bn | = ∫
0πx sin(nx) dx. | (88) |
Use integration by parts:
so
Then
| ∫
0πx sin(nx) dx | = 0π + ∫
0π cos(nx) dx | (91)
|
| = − +  0π | (92)
|
| = − . | (93) |
Therefore
Thus
The convergence symbol reminds us that pointwise convergence details are treated later in the
series.
Figure 6. The ramp coefficient requires one integration by parts. The boundary term supplies the
alternating factor (−1)n, while the remaining sine boundary term vanishes.
Solution 9: odd square wave
The square wave is odd, so
Use the odd-function shortcut:
| bn | = ∫
0π sin(nx) dx | (98)
|
| =  0π | (99)
|
| =  ![[1 − cos(nπ)]](https://images.physicslibrary.org/cache/objects/1540/make4ht/FourierSineAndConstantCoefficientDerivationExercises101x.png) | (100)
|
| =  . | (101) |
If n is even,
so
If n is odd,
so
Hence
Solution 10: a DC offset plus an odd ramp
Write
The constant part contributes only to a0.
First,
| a0 | = ∫
−ππ(2 + x) dx | (108)
|
| =  ![[4π + 0]](https://images.physicslibrary.org/cache/objects/1540/make4ht/FourierSineAndConstantCoefficientDerivationExercises112x.png) | (109)
|
| = 4. | (110) |
Thus
For n ≥ 1,
| an | = ∫
−ππ(2 + x) cos(nx) dx. | (112) |
The constant-cosine integral is zero, and x cos(nx) is odd. Therefore
For the sine coefficient,
| bn | = ∫
−ππ(2 + x) sin(nx) dx. | (114) |
The constant-sine integral is zero. The remaining integral is exactly the ramp coefficient from
Problem 8:
Thus
Adding a constant shifts the mean but does not change the nonzero harmonic content.
Solution 11: finite-width odd pulse
The pulse is odd, so
Use the odd-function shortcut. On the positive half interval the function equals A only from 0 to
α:
| bn | = ∫
0πf(x) sin(nx) dx | (118)
|
| = ∫
0α sin(nx) dx | (119)
|
| =  0α | (120)
|
| =  . | (121) |
This formula contains the square wave as the special case α = π.
Solution 12: a two-level waveform with nonzero mean
The waveform has level 1 for half the period and level 3 for the other half.
Compute the constant coefficient:
| a0 | =  ![[∫ 0 ∫ π ]
1 dx + 3dx
− π 0](https://images.physicslibrary.org/cache/objects/1540/make4ht/FourierSineAndConstantCoefficientDerivationExercises127x.png) | (122)
|
| =  ![[π + 3π]](https://images.physicslibrary.org/cache/objects/1540/make4ht/FourierSineAndConstantCoefficientDerivationExercises129x.png) | (123)
|
| = 4. | (124) |
Therefore
Now write
where
The constant 2 has no sine coefficients, so f has the same sine coefficients as q:
Thus
for even n, and
for odd n.
Figure 7. A two-level waveform with unequal positive levels is naturally decomposed into its mean
level plus an odd square wave. The mean contributes only the constant projection; the odd part
contributes only sine harmonics.
Solution 13: normalized sine basis
Compute the norm:
| ∥ϕn∥2 | = ∫
−ππ 2dx | (131)
|
| = ∫
−ππ sin 2(nx) dx | (132)
|
| = (π) | (133)
|
| = 1. | (134) |
Thus ∥ϕn∥ = 1.
The coefficient in the normalized basis is
| cn | = ⟨f,ϕn⟩ | (135)
|
| = ∫
−ππf(x) dx | (136)
|
| = ∫
−ππf(x) sin(nx) dx. | (137) |
Since
we obtain
Then
| cnϕn(x) | =   | (140)
|
| = bn sin(nx). | (141) |
The coordinate changes when the basis is normalized, but the projected function does
not.
Solution 14: energy bookkeeping for a finite orthogonal sum
Write
The three components
are mutually orthogonal on [−π,π].
Therefore the squared norm is the sum of the squared component norms:
| ∫
−ππf(x)2 dx | = ∫
−ππ22 dx + 9 ∫
−ππ sin 2xdx + 16 ∫
−ππ sin 22xdx | (144)
|
| = 4(2π) + 9π + 16π | (145)
|
| = 33π. | (146) |
This is a finite-dimensional version of the energy bookkeeping that later develops into Parseval’s
theorem.
Solution 15: direct coefficient check for a mixed finite sum
The function is
For the constant coefficient,
| a0 | = ∫
−ππf(x) dx | (148)
|
| = (−2π) | (149)
|
| = −2. | (150) |
Thus the actual constant term is
For b3,
| b3 | = ∫
−ππf(x) sin 3xdx. | (152) |
The constant-sine term vanishes. The cosine-sine term vanishes. The sin 5x sin 3x term vanishes
because the harmonic indices differ. Only
survives, so
Similarly,
The cosine term does not contaminate either sine coefficient because cosine and sine harmonics are
orthogonal over the full interval.
Solution 16: complete coefficient bookkeeping for a shifted square wave
The waveform is
The mean of the two half-period levels is
Therefore we expect
Verify directly:
| a0 | =  ![[∫ 0 ∫ π ]
1 dx + 5dx
− π 0](https://images.physicslibrary.org/cache/objects/1540/make4ht/FourierSineAndConstantCoefficientDerivationExercises159x.png) | (159)
|
| =  ![[π + 5π]](https://images.physicslibrary.org/cache/objects/1540/make4ht/FourierSineAndConstantCoefficientDerivationExercises161x.png) | (160)
|
| = 6. | (161) |
Now write
where q(x) is the odd square wave from Problem 9.
The constant 3 contributes no nonzero harmonic coefficients. Because q is odd, it contributes no
cosine coefficients. Hence
The sine coefficients are twice those of the unit-amplitude odd square wave:
Thus for even n,
and for odd n,
So the waveform has the Fourier representation
This final problem illustrates the clean separation
5 Further practice
- For
compute a0 and b2 directly from the integral formulas.
- For f(x) = x, verify explicitly that the second sine-projection residual
is orthogonal to sin 2x.
- For
explain from parity which Fourier coefficients must vanish before performing any
integration.
- Compute b1 and b2 for f(x) = x3.
- For the finite-width odd pulse of Problem 11, set α = π∕2 and determine which first eight
sine coefficients vanish.
- For
find the complete coefficient set using results already derived in this companion.
- For
compute ∫
−ππf(x)2 dx using orthogonality.
- A waveform equals −2 on (−π, 0) and 6 on (0,π). Decompose it into a mean plus an odd
square wave and infer its Fourier coefficients.
- Let
For f(x) = 5 sin 3x, compute the normalized-basis coordinate and reconstruct the
projection.
- Explain in words why adding a constant to any periodic function can change a0 but cannot
change any an or bn for n ≥ 1.
6 What these exercises establish
The problems above reinforce four structural ideas.
- A sine coefficient is a projection onto one sine basis function.
- The constant Fourier term is the mean value of the function over one period.
- Parity can eliminate entire coefficient families before any integration is performed.
- Orthogonality separates coefficient extraction into independent one-dimensional
projection problems.
The coefficient set on [−π,π] is now complete. The next article changes the interval itself and asks
how the basis frequencies and normalization constants must change.
Figure 8. FS05E1 completes practice with the standard interval [−π,π]. FS06 rescales the same
projection geometry to a general interval [−L,L], where the harmonics become cos(nπx∕L) and
sin(nπx∕L).
References
[1] PhysicsLibrary, FS05: Derivation of the Fourier Sine and Constant Coefficients.
[2] PhysicsLibrary, FS04: Derivation of the Fourier Cosine Coefficients.
[3] PhysicsLibrary, FS03: Orthogonality of Sines and Cosines.
[4] PhysicsLibrary, FS02: Inner Products of Functions.