Intuition How to read the coloured boxes
This vault uses callout boxes to flag the role of each paragraph. [!intuition] = the picture/why, [!definition] = a term being earned, [!formula] = a boxed result, [!example] = a worked problem, [!mistake] = a trap, [!mnemonic] = a memory hook, [!recall]- = a collapsible self-test. If your viewer shows the [!...] text literally, just read it as a heading — the mathematics is unaffected.
Intuition Why a whole page of examples?
The coefficient formulas are just three integrals. But the hard part is never the formula — it's spotting which of the many situations you are in before you integrate: is the function odd, even, neither? Constant? A pure wave already? A jump? A polynomial? Here we build a map of every case and then walk one worked example through each cell, so no scenario can surprise you.
Everything below uses only these three boxed results from the parent note. We restate them once so no symbol is unearned.
Intuition Why "matching terms" reproduces
f (used in every example below)
Each coefficient a m or b m is, by orthogonality , the amount of that one wave already present inside f . When we plug the coefficients back into the sum, we are literally re-stacking exactly those measured amounts of each pure wave. Because the waves are perpendicular (no wave leaks into another), the stack rebuilds f with nothing left over and nothing double-counted. That is why, at the end of each example, once we know every coefficient we may simply write down the series and call it f — the reconstruction is guaranteed by the projection.
Every Fourier problem you can be handed falls into one of these cells. The point of the page is that the seven examples below cover all of them .
Cell
Situation
Symmetry shortcut
What survives
Example
C1
f is odd (e.g. a square wave, or x )
all a n = 0
only b m (sines)
Ex 1
C2
f is even (e.g. ∣ x ∣ )
all b m = 0
a 0 , a m (cosines)
Ex 2
C3
f has no symmetry (e.g. e x , or x shifted)
none — do all three
a 0 , a m , b m
Ex 3
C4
f is a constant (degenerate: zero frequency only)
trivial
only a 0
Ex 4
C5
f is already one basis wave (limiting / pure tone)
orthogonality
a single coefficient
Ex 5
C6
Real-world word problem + exam twist (interval not centred, must relocate)
reduce to C1–C5
depends
Ex 6
C7
f is discontinuous (a jump / square wave) — Gibbs behaviour
symmetry if present
b m (odd jump)
Ex 7
A visual map of the same seven cells — glance here to place any problem before you start:
Mnemonic Read the symmetry FIRST
O dd kills a 's, E ven kills b 's. ("O dd → a xed cosines; E ven → b anished sines.") See Even and odd functions for why: an odd function integrated over a symmetric interval is 0 , and odd × even = odd .
Look at the straight line through the origin and its odd flip:
f ( x ) = x on [ − L , L ] as sines and cosines.
Forecast (guess first!): f ( x ) = x is a straight line through the origin. Flip x → − x and the whole graph flips upside-down — that is the signature of an odd function. So predict: all cosine coefficients vanish , only sines remain. Do you also expect a 0 = 0 ? (The average of a line symmetric about the origin is zero — yes.)
Step 1 — classify symmetry. f ( − x ) = − x = − f ( x ) , so f is odd → Cell C1 .
Why this step? By Even and odd functions , odd functions have a 0 = 0 and a m = 0 automatically. That deletes two of the three integrals before we lift a pen.
Step 2 — compute b m . Because f sin is (odd)(odd)=even, we may fold the interval: ∫ − L L = 2 ∫ 0 L .
b m = L 1 ∫ − L L x sin L mπ x d x = L 2 ∫ 0 L x sin L mπ x d x .
Why this step? Folding halves the work and uses the symmetry we just found. The extra factor 2 is a consequence , not the base L 1 changing.
Step 3 — integrate by parts. We have polynomial × trig; differentiating x makes it constant, so pick u = x , d v = sin L mπ x d x :
∫ 0 L x sin L mπ x d x = [ − mπ Lx cos L mπ x ] 0 L + mπ L ∫ 0 L cos L mπ x d x .
The remaining integral evaluates to mπ L [ sin L mπ x ] 0 L = mπ L ( sin mπ − 0 ) = 0 , since sin mπ = 0 for every integer m — the zero comes from the boundary values , not from an averaging argument. The bracket term at x = L gives − mπ L 2 cos mπ = − mπ L 2 ( − 1 ) m ; at x = 0 it is 0 .
Why this step? Integration by parts is the tool for "power times wiggle" — it trades the x for a constant.
Step 4 — assemble.
b m = L 2 ⋅ ( − mπ L 2 ( − 1 ) m ) = mπ 2 L ( − 1 ) m + 1 .
Why we may now write the series: we have measured how much of every sine wave lives inside f (the b m ), and all cosine amounts are zero. Re-stacking exactly those amounts rebuilds f (see the "matching terms" box above), so
x = π 2 L m = 1 ∑ ∞ m ( − 1 ) m + 1 sin L mπ x on ( − L , L ) .
Verify: Set L = π : b m = m 2 ( − 1 ) m + 1 , matching Example 2 of the parent note. Numerically b 1 = 2 , b 2 = − 1 , b 3 = 3 2 . ✔
The partial sums really do close in on the line (watch the endpoints, discussed later):
The V-shape is its own mirror image across the vertical axis:
f ( x ) = ∣ x ∣ on [ − π , π ] (so L = π ).
Forecast: ∣ x ∣ is a V-shape, mirror-symmetric across the vertical axis. That is even . Predict: all sine coefficients vanish , and since the graph sits entirely above the axis, its average 2 a 0 is positive (not zero this time!).
Step 1 — classify. f ( − x ) = ∣ − x ∣ = ∣ x ∣ = f ( x ) : even → Cell C2 , so all b m = 0 .
Why this step? Even × odd sine = odd, integrates to 0 . Half the labour gone.
Step 2 — a 0 . Fold (f even):
a 0 = π 1 ∫ − π π ∣ x ∣ d x = π 2 ∫ 0 π x d x = π 2 ⋅ 2 π 2 = π .
So the average value is 2 a 0 = 2 π — positive, as forecast. Why this step? The constant term must equal the DC level of the wave.
Step 3 — a m . With L = π the cosine is cos m x ; f cos is even, fold and parts (u = x ):
a m = π 2 ∫ 0 π x cos m x d x = π 2 ( [ m x s i n m x ] 0 π − m 1 ∫ 0 π sin m x d x ) .
The boundary term vanishes (sin mπ = 0 ). The remaining integral: ∫ 0 π sin m x d x = m 1 − c o s mπ = m 1 − ( − 1 ) m . So
a m = π 2 ⋅ ( − m 1 ) ⋅ m 1 − ( − 1 ) m = − π m 2 2 ( 1 − ( − 1 ) m ) .
Why this step? Same parts logic as Ex 1; here differentiating x against cos leaves a sin boundary term that dies.
Step 4 — read off cases. 1 − ( − 1 ) m = 0 for even m , = 2 for odd m :
a m = ⎩ ⎨ ⎧ − π m 2 4 0 m odd m even
Why we may now write the series: we now know the exact amount of every cosine wave (a 0 and each a m ) inside f , and all sine amounts are zero. Re-stacking those measured amounts rebuilds the V-shape:
∣ x ∣ = 2 π − π 4 k = 0 ∑ ∞ ( 2 k + 1 ) 2 1 cos ( ( 2 k + 1 ) x ) .
Verify: Put x = 0 : LHS = 0 , so 2 π = π 4 ∑ ( 2 k + 1 ) 2 1 ⇒ ∑ k ≥ 0 ( 2 k + 1 ) 2 1 = 8 π 2 — a famous identity. ✔ Also a 1 = − π 4 , a 2 = 0 , a 3 = − 9 π 4 . ✔
Definition Reminder: the hyperbolic sine
Before we use it, define sinh x = 2 e x − e − x . It is just a shorthand for that particular combination of exponentials — so e − e − 1 = 2 sinh 1 is a definition unpacked, not a new fact. (Numerically sinh 1 ≈ 1.1752 .)
f ( x ) = e x on [ − 1 , 1 ] (so L = 1 ).
Forecast: e x is neither a mirror image nor a flip of itself, so no shortcut — we must find a 0 , all a m , and all b m . This is the general case that keeps you honest.
Step 1 — classify. e − x = e x and = − e x : neither even nor odd → Cell C3 .
Why this step? Confirming "no symmetry" tells us not to expect any coefficient to vanish for free.
Step 2 — a 0 . With L = 1 : a 0 = ∫ − 1 1 e x d x = e − e − 1 = 2 sinh 1 (using the definition above).
Why this step? Straight integral; sets the average level 2 a 0 = sinh 1 .
Step 3 — a m by integrating by parts twice (not a black box). We want I c = ∫ e x cos ( mπ x ) d x . Apply parts once with u = e x , d v = cos ( mπ x ) d x :
I c = mπ e x s i n ( mπ x ) − mπ 1 ∫ e x sin ( mπ x ) d x .
The leftover integral I s = ∫ e x sin ( mπ x ) d x is the same type , so apply parts again (u = e x , d v = sin ( mπ x ) d x ):
I s = − mπ e x c o s ( mπ x ) + mπ 1 ∫ e x cos ( mπ x ) d x = − mπ e x c o s ( mπ x ) + mπ 1 I c .
Why this step? Each time we integrate the trig and differentiate e x , we come back to the same shape — so the integral feeds on itself , and we can solve for it algebraically instead of forever. Substitute I s into I c :
I c = mπ e x s i n ( mπ x ) − mπ 1 ( − mπ e x c o s ( mπ x ) + mπ 1 I c ) ⇒ I c ( 1 + m 2 π 2 1 ) = m 2 π 2 e x ( c o s mπ x + mπ s i n mπ x ) .
Clearing the bracket gives the closed form
I c = 1 + m 2 π 2 e x ( c o s mπ x + mπ s i n mπ x ) .
Now evaluate on [ − 1 , 1 ] : at x = ± 1 , sin ( ± mπ ) = 0 and cos ( ± mπ ) = ( − 1 ) m , so
a m = [ I c ] − 1 1 = 1 + m 2 π 2 ( − 1 ) m ( e − e − 1 ) = 1 + m 2 π 2 2 ( − 1 ) m s i n h 1 .
Step 4 — b m from the same I s . Solving the pair for I s likewise gives
I s = 1 + m 2 π 2 e x ( s i n mπ x − mπ c o s mπ x ) .
The sin boundary terms vanish, leaving
b m = [ I s ] − 1 1 = 1 + m 2 π 2 − mπ ( − 1 ) m ( e − e − 1 ) = 1 + m 2 π 2 − 2 mπ ( − 1 ) m s i n h 1 .
Why this step? Same self-feeding pair; note b m carries the extra mπ , so the sine amplitudes decay slower here.
Verify: Numerically sinh 1 ≈ 1.1752 . Then a 0 ≈ 2.3504 , a 1 = 1 + π 2 − 2 s i n h 1 ≈ − 0.2160 , b 1 = 1 + π 2 2 π s i n h 1 ≈ 0.6785 . All three families are nonzero, as the no-symmetry cell demands. ✔
Worked example Rebuild the constant
f ( x ) = 5 .
Forecast: A flat line has no wiggles at all . So every genuine harmonic (m ≥ 1 ) should be zero, and only the "zero-frequency" term a 0 can be nonzero. This is the degenerate edge of the matrix.
Step 1 — a 0 . a 0 = L 1 ∫ − L L 5 d x = L 1 ⋅ 5 ⋅ 2 L = 10 .
Why this step? The constant term 2 a 0 = 5 must equal the function itself. ✔
Step 2 — a m , b m for m ≥ 1 . a m = L 5 ∫ − L L cos L mπ x d x = 0 and b m = L 5 ∫ − L L sin L mπ x d x = 0 , because each integral evaluates to a difference of sines/cosines at the endpoints that cancels.
Why this step? This is the orthogonality of each wave with the constant 1 — the DC part is "perpendicular" to every wiggle.
Verify: Series = 2 a 0 = 5 = f ( x ) exactly, with all other terms zero. ✔ Degenerate case confirmed: a constant is its own Fourier series.
Worked example Rebuild a function that is
already a sum of two basis waves.
Forecast: By Orthogonality of functions , the machine should just hand back the coefficients you can read off the formula : b 2 = 1 , a 5 = 3 , everything else 0 . If it did anything else, orthogonality would be broken.
Step 1 — read off the target coefficients. Comparing with ∑ [ a n cos L nπ x + b n sin L nπ x ] , the only nonzero pieces sit at n = 2 (a sine, amplitude 1 ) and n = 5 (a cosine, amplitude 3 ).
Why this step? If the answer is obvious, use it to test the integral machinery rather than trusting it blindly.
Step 2 — confirm b 2 by integrating.
b 2 = L 1 ∫ − L L ( sin L 2 π x + 3 cos L 5 π x ) sin L 2 π x d x .
The cross term ∫ cos L 5 π x sin L 2 π x d x = 0 (sine–cosine orthogonality, always). The self term ∫ sin 2 L 2 π x d x = L . So b 2 = L 1 ⋅ L = 1 . ✔
Why this step? This is orthogonality in action: multiplying by sin L 2 π x isolates the n = 2 sine and silences the rest.
Step 3 — confirm a 5 . Multiply by cos L 5 π x : the sine term dies (orthogonal), the 3 cos 2 L 5 π x gives L 1 ⋅ 3 L = 3 . So a 5 = 3 . ✔
Step 4 — everything else. For any other m , both self-terms are at n = m , so orthogonality gives 0 .
Verify: Nonzero coefficients: b 2 = 1 , a 5 = 3 , all others 0 . The series reproduces f exactly — a basis function is its own series. ✔
A full period is a full period no matter where the window starts — the orange and teal windows below capture identical coefficients:
Worked example A metal rod of length
L starts at temperature u 0 ( x ) = x for 0 < x < L . To solve the heat equation by separation of variables we need this as a sine series on [ 0 , L ] . But suppose the exam instead gives g ( x ) = x on the shifted interval [ a , a + 2 L ] with a = − L and asks for the full series with period 2 L . Show these are compatible.
Forecast: Fourier coefficients depend only on one full period , not where you start integrating. So sliding the window from [ − L , L ] to [ a , a + 2 L ] must give the same a m , b m — provided you extend g periodically. The "off-centre" twist is a trap: it changes nothing.
Step 1 — the shift-invariance principle. For any 2 L -periodic integrand h ,
∫ a a + 2 L h ( x ) d x = ∫ − L L h ( x ) d x .
Why this step? Periodicity means the piece you drop off the right end reappears at the left end — the total over any full period is fixed. So you may always re-centre to [ − L , L ] .
Step 2 — reduce to Cell C1. Once re-centred, g ( x ) = x on [ − L , L ] is exactly Example 1, an odd function → all a m = 0 and b m = mπ 2 L ( − 1 ) m + 1 .
Why this step? The scary shifted interval collapses onto a case we already solved.
Step 3 — the half-range connection, carried all the way through. The rod problem wants a sine-only series on [ 0 , L ] . The half-range sine expansion is defined by a recipe: take u 0 given only on [ 0 , L ] , reflect it as an odd function onto [ − L , L ] , i.e. set u 0 odd ( x ) = u 0 ( x ) for x > 0 and u 0 odd ( − x ) = − u 0 ( x ) , then run the full-series machinery. Because the extension is odd, all a m = 0 , and the surviving sine coefficients are
b m = L 1 ∫ − L L u 0 odd ( x ) sin L mπ x d x .
The integrand u 0 odd sin is (odd)(odd)=even, so we may fold:
b m = L 2 ∫ 0 L u 0 odd ( x ) sin L mπ x d x = L 2 ∫ 0 L u 0 ( x ) sin L mπ x d x ,
and on [ 0 , L ] the extension equals u 0 itself, so the odd reflection has vanished from the final formula. That last expression is the half-range sine formula. Now specialise to u 0 ( x ) = x :
b m = L 2 ∫ 0 L x sin L mπ x d x = mπ 2 L ( − 1 ) m + 1 ,
which is exactly the coefficient from Step 2 (and from Example 1). So the off-centre full series, the re-centred full series, and the half-range sine series all deliver the same b m .
Why this step? It closes the loop: the full-series derivation and the half-range recipe are not two rules but one — an odd function's full series is pure sine, and the L 2 ∫ 0 L is just the folded L 1 ∫ − L L .
Conclusion. The exam twist (shifted interval) and the physics goal (half-range sine on [ 0 , L ] ) both reduce to Cell C1. The temperature profile expands as
u 0 ( x ) = x = π 2 L ∑ m = 1 ∞ m ( − 1 ) m + 1 sin L mπ x on ( 0 , L ) .
Verify: With L = π : b m = m 2 ( − 1 ) m + 1 , so b 1 = 2 , b 2 = − 1 , b 3 = 3 2 — the same numbers as Example 1's check, obtained regardless of the starting endpoint a . ✔
The square wave leaps from − 1 to + 1 ; note where the series lands at the jump, and the stubborn overshoot beside it:
Worked example Rebuild the square wave
f ( x ) = { − 1 + 1 − L < x < 0 0 < x < L and describe what happens at the jump and at the endpoints x = ± L .
Forecast: The graph leaps from − 1 to + 1 at x = 0 — a genuine discontinuity . It is also odd (flip x → − x and the value flips sign), so predict only sines. But a new question appears: what does the series do exactly at the jump and at the ends , and does it overshoot near them?
Step 1 — classify. f ( − x ) = − f ( x ) : odd → Cell C7 with odd symmetry, so all a m = 0 .
Why this step? Odd kills the cosines; a jump does not change that.
Step 2 — compute b m . Since f sin is even, fold:
b m = L 2 ∫ 0 L ( 1 ) sin L mπ x d x = L 2 ⋅ mπ L [ − cos L mπ x ] 0 L = mπ 2 ( 1 − cos mπ ) .
With cos mπ = ( − 1 ) m : b m = mπ 2 ( 1 − ( − 1 ) m ) = { mπ 4 0 m odd m even
Why this step? Same folding + endpoint evaluation as Ex 1; the odd terms carry all the weight. So f ( x ) = π 4 k = 0 ∑ ∞ 2 k + 1 1 sin L ( 2 k + 1 ) π x .
Step 3 — value at the interior jump x = 0 . Every sin 0 = 0 , so the series sums to 0 there. That is exactly the midpoint of the jump, 2 ( − 1 ) + ( + 1 ) = 0 . By Dirichlet's theorem , a Fourier series always converges to the average of the left and right limits at a jump — never to either side.
Why this step? It answers the edge-case question "what is the series at the break?" that smooth examples never raise.
Step 4 — value at the endpoints x = ± L (the other jump). The 2 L -periodic extension of this square wave jumps again at x = ± L , where the right value (+ 1 , just left of L ) meets the wrap-around value (− 1 , just right of L ). At x = L every sin L ( 2 k + 1 ) π L = sin (( 2 k + 1 ) π ) = 0 , so the series equals 0 — again the midpoint of + 1 and − 1 . So the endpoints obey the same Dirichlet midpoint rule as any interior jump.
Why this step? For a "full" series the endpoints ± L are glued together by periodicity; if f ( − L + ) = f ( L − ) they form a hidden discontinuity, and the series lands on their average — a case students routinely forget.
Step 5 — the Gibbs phenomenon. Near each jump the partial sums overshoot by a fixed fraction (about 9% of the jump height) no matter how many terms you add — the ripple narrows but never shrinks. This is the Gibbs phenomenon , the signature of approximating a discontinuity with smooth waves. (In Example 1's figure the same overshoot appears at x = ± L , where the sawtooth line x secretly jumps from + L back to − L .)
Why this step? It warns you not to expect uniform closeness at jumps — only convergence to the midpoint at the jump and to f at points away from it.
Verify: b 1 = π 4 , b 2 = 0 , b 3 = 3 π 4 ; the series value at x = 0 and at x = L is 0 (midpoint of the jump). Also, setting L = 1 , x = 2 1 gives π 4 ∑ k 2 k + 1 ( − 1 ) k = π 4 ⋅ 4 π = 1 , matching f ( 2 1 ) = + 1 . ✔
Intuition What value does the series actually take at a jump or at
x = ± L ?
A full Fourier series treats x = − L and x = + L as the same point (period 2 L wraps them together). So there are two edge cases the smooth examples hide:
At any jump inside ( − L , L ) : by Dirichlet's theorem , the series converges to 2 1 ( f ( x − ) + f ( x + ) ) , the midpoint of the two one-sided limits — see Ex 7, x = 0 .
At the endpoints x = ± L : the series converges to 2 1 ( f ( − L + ) + f ( L − ) ) . If those two values disagree (as for the square wave, and secretly for f ( x ) = x where + L meets − L ), the endpoints are themselves a jump and the series lands on their average , not on either end value.
Where f is continuous : the series equals f ( x ) exactly, but near any jump it always overshoots by ~9% (Gibbs) — an overshoot that never disappears, only narrows.
Recall Case-map self-test
Odd function: which coefficients survive? ::: only the b m (sines); a 0 = a m = 0 .
Even function: which survive? ::: only a 0 and the a m (cosines); b m = 0 .
A constant c : full series? ::: a 0 = 2 c , everything else 0 ; the series is just c .
Does the starting endpoint of a full-period integral matter? ::: No — any interval of length 2 L gives the same coefficients.
At a jump, what value does the series converge to? ::: the midpoint (average of the left and right limits).
At x = ± L , what value? ::: the average of f ( − L + ) and f ( L − ) — a jump if they differ.
What is the Gibbs phenomenon? ::: a fixed ~9% overshoot of the partial sums near a discontinuity that never disappears.
∑ k ≥ 0 ( 2 k + 1 ) 2 1 = ? (from Ex 2 at x = 0 ) ::: 8 π 2 .
Common mistake Treating the off-centre interval as a new problem
Why it feels right: the limits [ a , a + 2 L ] look different, so surely the integral differs. The fix: for a periodic integrand the value over any full period is identical — re-centre to [ − L , L ] and use the symmetry shortcuts. See Ex 6.
Common mistake Expecting the series to equal
f at a jump or at x = ± L
Why it feels right: the series equals f everywhere in smooth examples. The fix: at a discontinuity (including the wrapped endpoints) it converges to the midpoint of the two one-sided limits, and nearby it overshoots (Gibbs). See Ex 7 and Convergence of Fourier series (Dirichlet conditions) .
Related: Convergence of Fourier series (Dirichlet conditions) (does the series actually equal f at jumps?), Complex (exponential) Fourier series (same coefficients repackaged), Parseval's theorem (energy check on the coefficients above).