Derivation of the Fourier Sine and Constant Coefficients
FS04 derived the cosine coefficients by treating each cosine harmonic as a direction in function
space. The method was
| choose one basis function, | (1)
|
| multiply the expansion by that basis function, | (2)
|
| integrate over the full orthogonality interval, | (3)
|
| and use orthogonality to remove every unwanted component. | (4) |
This article repeats the same calculation for the sine harmonics and then revisits the constant basis
function carefully. At the end, the entire real Fourier coefficient set on [−π,π] will have been
derived from one projection principle.
The key result for the sine coefficients will be
while the constant coefficient remains
The actual constant term appearing in the standard Fourier series is a0∕2, not a0.
Figure 1. The Fourier sine coefficient is a function-space projection. To find the amount of the
mth sine harmonic inside f, project f onto sin(mx).
1 Start again with a finite trigonometric expansion
As in FS04, begin with a finite sum so no convergence theorem is being assumed implicitly.
Let
Because the sum is finite, we may distribute integrals across the sum without any additional
hypothesis.
Suppose we want the coefficient multiplying
That coefficient is bm.
2 Multiply by the sine harmonic we want
Multiply every term in Equation (7) by sin(mx):
| f(x) sin(mx) | = sin(mx) | (9)
|
| + ∑
n=1Na
n cos(nx) sin(mx) | (10)
|
| + ∑
n=1Nb
n sin(nx) sin(mx). | (11) |
Nothing has disappeared yet. We have only chosen the direction in function space whose coefficient
we want to measure.
Figure 2. Sine-coefficient extraction uses the same two operations as cosine extraction: multiply
by the target sine harmonic, then integrate over the full orthogonality interval.
3 Integrate over the full interval
Integrate Equation (11) from −π to π:
| ∫
−ππf(x) sin(mx) dx | = ∫
−ππ sin(mx) dx | (12)
|
| + ∑
n=1Na
n ∫
−ππ cos(nx) sin(mx) dx | (13)
|
| + ∑
n=1Nb
n ∫
−ππ sin(nx) sin(mx) dx. | (14) |
Now every integral on the right-hand side is one of the orthogonality integrals derived in
FS03.
4 The constant term disappears
For every positive integer m,
Therefore
There is also a simple parity explanation. The constant function is even and sin(mx) is odd. Their
product is odd, so its integral over the symmetric interval [−π,π] is zero.
5 Every cosine term disappears
FS03 established the mixed orthogonality relation
for every pair of positive integers m and n.
Therefore
So the cosine content of f cannot contaminate the measurement of a sine coefficient.
6 The wrong sine harmonics disappear
For n≠m,
Therefore every sine harmonic except the selected one disappears from the final integral.
The only sine term that survives has
Then
and FS03 showed
Thus the entire sine sum reduces to
Figure 3. Multiplication by sin(mx) followed by full-period integration acts as a harmonic filter.
The constant, all cosines, and all sine harmonics with n≠m vanish.
7 Derivation of the sine coefficient
Using Equations (16), (18), (19), and (22), Equation (14) becomes
Divide both sides by π:
This is the Fourier sine coefficient on [−π,π].
8 Why the factor 1∕π appears
The coefficient formula is exactly the projection formula from FS02.
Let
The projection coefficient of f onto ϕm is
On [−π,π],
Therefore
Thus
The factor 1∕π is simply the reciprocal of the squared norm of the unnormalized basis function
sin(mx).
9 Residual orthogonality gives the same result
Suppose we approximate f using only the mth sine harmonic:
Define the residual
For a true projection, the residual must be orthogonal to the direction already extracted:
Therefore
| 0 | = ∫
−ππ sin(mx) dx | (34)
|
| = ∫
−ππf(x) sin(mx) dx − b
m ∫
−ππ sin 2(mx) dx | (35)
|
| = ∫
−ππf(x) sin(mx) dx − πb
m. | (36) |
Solving gives Equation (25) again.
This second derivation is useful because it shows that harmonic extraction and least-error
projection are the same geometry.
10 Revisit the constant basis function
The constant part deserves one more careful derivation because the notation a0∕2 often causes
confusion.
The standard real Fourier form is
To isolate the constant contribution, integrate Equation (37) directly over [−π,π]:
| ∫
−ππS
N(x) dx | = ∫
−ππ1 dx | (38)
|
| + ∑
n=1Na
n ∫
−ππ cos(nx) dx | (39)
|
| + ∑
n=1Nb
n ∫
−ππ sin(nx) dx. | (40) |
Every nonconstant harmonic integrates to zero over the full symmetric period, so
Hence
Therefore
The actual constant term in the series is
But Equation (44) is exactly the average value of f over an interval of length 2π.
Thus
under the standard Fourier convention.
Figure 4. The constant or DC component is the projection of f onto the constant basis function 1.
The projection value is the mean of f across the full interval.
11 The constant term as a projection coefficient
Let
The projection coefficient onto the constant basis function is
Now
Therefore
Comparing with Equation (44),
This explains why the standard Fourier notation contains the factor of 1∕2 in front of a0: a0 itself is
defined with the same 1∕π normalization used for the nonzero cosine coefficients, while the true
projection coordinate along the basis function 1 is a0∕2.
12 The complete real Fourier coefficient set on [−π,π]
FS04 and FS05 together give
and
These coefficients are used in the real Fourier series
The symbol ∼ is deliberate. At this stage it means that the expression on the right is the Fourier
series associated with f. The precise sense in which the series converges to f is a later
topic.
13 Parity shortcuts
The coefficient formulas immediately reveal powerful symmetry rules.
13.1 If f is even
Suppose
Since sin(nx) is odd,
is odd. Therefore
for every n.
An even function has only the constant and cosine parts in its real Fourier series.
13.2 If f is odd
Suppose
The constant-integrand function f(x) is odd, so
Also, cos(nx) is even, so
is odd. Therefore
for every n ≥ 1.
An odd function has only sine terms.
Figure 5. Parity can remove entire families of Fourier coefficients before any integration is
performed. Even functions have no sine coefficients; odd functions have no constant or cosine
coefficients.
14 Worked example 1: isolate a sine coefficient from a known finite sum
Consider
Find b2 directly from the integral formula.
By Equation (25),
Insert the expression for f:
| b2 | = ∫
−ππ 3 + 2 cos x − 4 sin 2x | (64)
|
| + 5 cos 3x + 7 sin 4x sin 2xdx. | (65) |
Distribute the integral:
| πb2 | = 3 ∫
−ππ sin 2xdx | (66)
|
| + 2 ∫
−ππ cos x sin 2xdx | (67)
|
| − 4 ∫
−ππ sin 22xdx | (68)
|
| + 5 ∫
−ππ cos 3x sin 2xdx | (69)
|
| + 7 ∫
−ππ sin 4x sin 2xdx. | (70) |
Orthogonality gives
Therefore
and
The integral has recovered the coefficient that was already visible in the finite sum.
15 Worked example 2: the odd ramp f(x) = x
Let
The function is odd. Therefore, before doing any integration,
and
Only the sine coefficients remain.
Using Equation (25),
Now x is odd and sin(nx) is odd, so their product is even. Hence
Use integration by parts. Let
Then
Therefore
| ∫
0πx sin(nx) dx | = 0π + ∫
0π cos(nx) dx. | (81) |
The second integral is
| ∫
0π cos(nx) dx | = 0π | (82)
|
| = 0. | (83) |
The boundary term is
Hence
Insert this into Equation (78):
| bn | =  ![[ π (− 1)n ]
− --------
n](https://images.physicslibrary.org/cache/objects/1539/make4ht/DerivationOfTheFourierSineAndConstantCoefficients72x.png) | (87)
|
| = − | (88)
|
| = . | (89) |
Thus the Fourier series associated with the odd ramp is
The first few terms are
Figure 6. The odd ramp f(x) = x contains only sine harmonics. Its coefficients alternate in sign
and decrease as 1∕n.
16 Worked example 3: an odd square wave
Define
This function is odd, so
The sine coefficients are
Because both f and sin(nx) are odd, their product is even:
Integrate:
| bn | =  0π | (96)
|
| =  ![[1 − cos(nπ)]](https://images.physicslibrary.org/cache/objects/1539/make4ht/DerivationOfTheFourierSineAndConstantCoefficients84x.png) | (97)
|
| =  . | (98) |
Now separate even and odd n.
If n is even,
so
If n is odd,
so
Therefore
This is the square-wave series previewed in FS01. Here the coefficients have finally been derived
rather than supplied.
Figure 7. The odd square wave contains only odd sine harmonics. Its nonzero coefficients decay as
1∕n.
17 Worked example 4: a DC offset plus an odd ramp
Consider
This function is neither even nor odd, but it is the sum of an even constant and an odd
ramp.
First compute a0:
| a0 | = ∫
−ππ(2 + x) dx | (105)
|
| =  ![[∫ π ∫ π ]
−π 2dx + −π x dx](https://images.physicslibrary.org/cache/objects/1539/make4ht/DerivationOfTheFourierSineAndConstantCoefficients95x.png) | (106)
|
| = (4π + 0) | (107)
|
| = 4. | (108) |
Therefore the actual constant term is
Now compute the cosine coefficients. The constant 2 is orthogonal to every nonzero cosine
harmonic, and x cos(nx) is odd, so
For the sine coefficients,
| bn | = ∫
−ππ(2 + x) sin(nx) dx | (111)
|
| = ∫
−ππ2 sin(nx) dx + ∫
−ππx sin(nx) dx. | (112) |
The first integral is zero, and the second is the ramp result. Hence
Thus
This example cleanly separates the DC content from the odd oscillatory content.
18 Worked example 5: an odd finite-width pulse
Let 0 < α < π and define
The function is odd, so
For the sine coefficients,
Therefore
This example shows that the spectrum depends on pulse width through the factor
The square wave is recovered when α = π and A = 1.
Indeed,
which reproduces Equation (98).
19 Why the cosine and sine formulas look so similar
For n ≥ 1, the cosine and sine basis functions have the same squared norm:
and
Therefore both projection formulas have the same denominator:
and
The constant basis function has a different squared norm:
That is why the true constant projection coefficient is
The standard Fourier notation is therefore completely consistent with projection geometry.
20 What has now been derived
At this point, every coefficient in the real Fourier series on [−π,π] has been derived from
orthogonality:
 | = , | (128)
|
| an | = , | (129)
|
| bn | = . | (130) |
The differences in the familiar formulas come only from the norms of the basis functions and the
conventional definition of a0.
21 A projection ledger
For quick reference on [−π,π]:
| ⟨1, 1⟩ | = 2π, | (131)
|
| ⟨cos(nx), cos(nx)⟩ | = π, | (132)
|
| ⟨sin(nx), sin(nx)⟩ | = π. | (133) |
Therefore
| constant projection | = ∫
−ππf(x) dx, | (134)
|
| nth cosine projection | = ∫
−ππf(x) cos(nx) dx, | (135)
|
| nth sine projection | = ∫
−ππf(x) sin(nx) dx. | (136) |
The standard notation identifies these as
22 Common mistakes
- Using a0 itself as the mean value. Under the convention used here, the mean value is
a0∕2.
- Forgetting that the sine coefficient formula is valid because
- Assuming every sine integral vanishes merely because sine is odd. The product of an odd
function f with sin(nx) may be even and nonzero.
- Forgetting to use parity before performing a long integral.
- Claiming an odd function has no Fourier series because its cosine coefficients vanish. An odd
function is represented by sine terms.
- Assuming a square wave contains every sine harmonic. The symmetric odd square wave
derived here contains only odd sine harmonics.
- Confusing the harmonic number n with the coefficient value bn.
- Treating the symbol ∼ in Equation (54) as a fully proved pointwise equality. Convergence is
treated later.
- Generalizing the 1∕π normalization to arbitrary intervals without rescaling. FS06 derives the
general interval carefully.
23 Self-check questions
- Why do we multiply by sin(mx) when extracting bm?
- Why does the constant term vanish from the bm derivation?
- Why do all cosine terms vanish?
- What distinguishes the n = m sine term from all other sine terms?
- Where does the factor 1∕π come from?
- Why is a0∕2 the mean value rather than a0?
- What coefficients must vanish if f is even?
- What coefficients must vanish if f is odd?
- Why does f(x) = 2+x have a nonzero constant coefficient but the same sine coefficients
as f(x) = x?
- Why does the odd square wave contain only odd sine harmonics?
24 Practice exercises
- Starting from a finite trigonometric sum, reproduce the complete derivation of
Equation (25).
- For
extract b3 using the integral formula rather than inspection.
- Find a0 for
What is the mean value?
- Show directly that if f is even, then bn = 0 for every n.
- Show directly that if f is odd, then a0 = an = 0.
- Derive the first four nonzero sine coefficients of f(x) = x.
- Verify by direct integration that the residual obtained after projecting x onto sin x is
orthogonal to sin x.
- Derive Equation (98) for the odd square wave.
- For the odd pulse in Equation (115), evaluate bn when α = π∕2.
- Explain why the coefficient formulas must change when the interval is changed from [−π,π]
to [−L,L].
25 Summary
Multiplying a finite trigonometric expansion by sin(mx) and integrating over [−π,π] removes the
constant term, every cosine harmonic, and every sine harmonic except the selected one. The
surviving norm is π, so
The constant projection is
or equivalently
Together with FS04,
the complete real Fourier coefficient set on [−π,π] is now established.
Figure 8. FS04 and FS05 complete the coefficient derivation on [−π,π]. FS06 will rescale the same
projection argument to an arbitrary interval [−L,L].
References
[1] R. V. Churchill and J. W. Brown, Fourier Series and Boundary Value Problems,
McGraw-Hill.
[2] E. Kreyszig, Advanced Engineering Mathematics, Wiley.
[3] G. B. Arfken, H. J. Weber, and F. E. Harris, Mathematical Methods for Physicists,
Academic Press.
[4] M. L. Boas, Mathematical Methods in the Physical Sciences, Wiley.