Intuition The big picture (WHY)
Any "reasonable" periodic function on [ − L , L ] [-L, L] [ − L , L ] can be built by stacking sines and cosines of harmonically related frequencies. Think of sounds: a complex tone is just many pure tones added. The Fourier coefficients tell you how much of each pure tone is present. The magic that makes finding them easy is orthogonality — sines and cosines of different frequencies don't "overlap" when integrated, so each one can be isolated cleanly.
Definition Full Fourier series
For a function f ( x ) f(x) f ( x ) on [ − L , L ] [-L, L] [ − L , L ] (period 2 L 2L 2 L ), the full Fourier series is
f ( x ) = a 0 2 + ∑ n = 1 ∞ [ a n cos n π x L + b n sin n π x L ] . f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\left[ a_n \cos\!\frac{n\pi x}{L} + b_n \sin\!\frac{n\pi x}{L}\right]. f ( x ) = 2 a 0 + ∑ n = 1 ∞ [ a n cos L nπ x + b n sin L nπ x ] .
"Full" means we keep both cosine and sine terms (unlike a pure sine or pure cosine half-range series).
WHAT we want: formulas for a 0 , a n , b n a_0, a_n, b_n a 0 , a n , b n .
WHY these basis functions: cos n π x L \cos\frac{n\pi x}{L} cos L nπ x and sin n π x L \sin\frac{n\pi x}{L} sin L nπ x all have period dividing 2 L 2L 2 L , so any sum of them is 2 L 2L 2 L -periodic — matching f f f .
Everything rests on these integrals over a full period [ − L , L ] [-L, L] [ − L , L ] . Let m , n m, n m , n be positive integers.
HOW to derive one (the cosine–cosine case). Use the product-to-sum identity
cos A cos B = 1 2 [ cos ( A − B ) + cos ( A + B ) ] . \cos A\cos B = \tfrac{1}{2}\big[\cos(A-B)+\cos(A+B)\big]. cos A cos B = 2 1 [ cos ( A − B ) + cos ( A + B ) ] .
So with A = m π x L , B = n π x L A=\frac{m\pi x}{L},\,B=\frac{n\pi x}{L} A = L mπ x , B = L nπ x :
∫ − L L cos m π x L cos n π x L d x = 1 2 ∫ − L L cos ( m − n ) π x L d x + 1 2 ∫ − L L cos ( m + n ) π x L d x . \int_{-L}^{L}\cos\frac{m\pi x}{L}\cos\frac{n\pi x}{L}\,dx = \frac12\int_{-L}^{L}\cos\frac{(m-n)\pi x}{L}\,dx + \frac12\int_{-L}^{L}\cos\frac{(m+n)\pi x}{L}\,dx. ∫ − L L cos L mπ x cos L nπ x d x = 2 1 ∫ − L L cos L ( m − n ) π x d x + 2 1 ∫ − L L cos L ( m + n ) π x d x .
Why this step? Splitting the product into two simple cosines makes each integral trivial.
If m ≠ n m\neq n m = n : both m − n m-n m − n and m + n m+n m + n are nonzero integers k k k , and
∫ − L L cos k π x L d x = L k π sin k π x L ∣ − L L = L k π [ sin k π − sin ( − k π ) ] = 0. \int_{-L}^{L}\cos\frac{k\pi x}{L}\,dx = \frac{L}{k\pi}\sin\frac{k\pi x}{L}\Big|_{-L}^{L} = \frac{L}{k\pi}\big[\sin k\pi - \sin(-k\pi)\big]=0. ∫ − L L cos L k π x d x = k π L sin L k π x − L L = k π L [ sin k π − sin ( − k π ) ] = 0.
So the whole thing is 0 0 0 .
If m = n m=n m = n : the first integrand is cos 0 = 1 \cos 0 = 1 cos 0 = 1 giving 1 2 ⋅ 2 L = L \frac12\cdot 2L = L 2 1 ⋅ 2 L = L , and the second (k = 2 n ≠ 0 k=2n\neq0 k = 2 n = 0 ) gives 0 0 0 . Total = L = L = L . ✔
The sine–sine and sine–cosine cases follow identically using
sin A sin B = 1 2 [ cos ( A − B ) − cos ( A + B ) ] \sin A\sin B=\frac12[\cos(A-B)-\cos(A+B)] sin A sin B = 2 1 [ cos ( A − B ) − cos ( A + B )] and sin A cos B = 1 2 [ sin ( A + B ) + sin ( A − B ) ] \sin A\cos B=\frac12[\sin(A+B)+\sin(A-B)] sin A cos B = 2 1 [ sin ( A + B ) + sin ( A − B )] .
Intuition Why orthogonality is the whole trick
Treat functions like vectors and ∫ − L L f g d x \int_{-L}^L f g\,dx ∫ − L L f g d x like a dot product. Orthogonality says the basis waves are perpendicular . To get a coordinate of a vector you project onto one axis — here you "project" f f f onto one wave by multiplying and integrating, and all other waves contribute 0 0 0 .
Start by assuming the series converges to f f f and that we may integrate term by term:
f ( x ) = a 0 2 + ∑ n = 1 ∞ [ a n cos n π x L + b n sin n π x L ] . f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\left[ a_n \cos\frac{n\pi x}{L} + b_n \sin\frac{n\pi x}{L}\right]. f ( x ) = 2 a 0 + ∑ n = 1 ∞ [ a n cos L nπ x + b n sin L nπ x ] .
Integrate both sides over [ − L , L ] [-L,L] [ − L , L ] :
∫ − L L f d x = a 0 2 ∫ − L L 1 d x ⏟ 2 L + ∑ n a n ∫ − L L cos n π x L d x ⏟ 0 + ∑ n b n ∫ − L L sin n π x L d x ⏟ 0 . \int_{-L}^{L} f\,dx = \frac{a_0}{2}\underbrace{\int_{-L}^{L}1\,dx}_{2L} + \sum_n a_n\underbrace{\int_{-L}^{L}\cos\frac{n\pi x}{L}dx}_{0} + \sum_n b_n\underbrace{\int_{-L}^{L}\sin\frac{n\pi x}{L}dx}_{0}. ∫ − L L f d x = 2 a 0 2 L ∫ − L L 1 d x + ∑ n a n 0 ∫ − L L cos L nπ x d x + ∑ n b n 0 ∫ − L L sin L nπ x d x .
Why this step? Integrating kills every oscillating term (they have zero average over a full period), leaving only the constant.
⇒ ∫ − L L f d x = a 0 L ⟹ a 0 = 1 L ∫ − L L f ( x ) d x . \Rightarrow \int_{-L}^{L} f\,dx = a_0 L \quad\Longrightarrow\quad \boxed{a_0 = \frac1L\int_{-L}^{L} f(x)\,dx.} ⇒ ∫ − L L f d x = a 0 L ⟹ a 0 = L 1 ∫ − L L f ( x ) d x .
a 0 / 2 a_0/2 a 0 /2 " instead of "a 0 a_0 a 0 "?
We wrote the constant as a 0 2 \frac{a_0}{2} 2 a 0 on purpose so that the formula a n = 1 L ∫ f cos n π x L d x a_n=\frac1L\int f\cos\frac{n\pi x}{L}dx a n = L 1 ∫ f cos L nπ x d x works for all n ≥ 0 n\ge 0 n ≥ 0 including n = 0 n=0 n = 0 (since cos 0 = 1 \cos 0=1 cos 0 = 1 ). It's a bookkeeping convenience, not deep physics.
Multiply both sides by cos m π x L \cos\frac{m\pi x}{L} cos L mπ x , then integrate:
∫ − L L f cos m π x L d x = a 0 2 ∫ cos m π x L d x ⏟ 0 + ∑ n a n ∫ cos n π x L cos m π x L d x + ∑ n b n ∫ sin n π x L cos m π x L d x ⏟ 0 . \int_{-L}^{L} f\cos\frac{m\pi x}{L}\,dx = \frac{a_0}{2}\underbrace{\int\cos\frac{m\pi x}{L}dx}_{0} + \sum_n a_n\int\cos\frac{n\pi x}{L}\cos\frac{m\pi x}{L}dx + \sum_n b_n\underbrace{\int\sin\frac{n\pi x}{L}\cos\frac{m\pi x}{L}dx}_{0}. ∫ − L L f cos L mπ x d x = 2 a 0 0 ∫ cos L mπ x d x + ∑ n a n ∫ cos L nπ x cos L mπ x d x + ∑ n b n 0 ∫ sin L nπ x cos L mπ x d x .
Why this step? By orthogonality, in the a n a_n a n sum only the n = m n=m n = m term survives (equals L L L ); all others vanish, and every b n b_n b n term vanishes too.
⇒ ∫ − L L f cos m π x L d x = a m L ⟹ a m = 1 L ∫ − L L f ( x ) cos m π x L d x . \Rightarrow \int_{-L}^{L} f\cos\frac{m\pi x}{L}\,dx = a_m L \quad\Longrightarrow\quad \boxed{a_m = \frac1L\int_{-L}^{L} f(x)\cos\frac{m\pi x}{L}\,dx.} ⇒ ∫ − L L f cos L mπ x d x = a m L ⟹ a m = L 1 ∫ − L L f ( x ) cos L mπ x d x .
Multiply by sin m π x L \sin\frac{m\pi x}{L} sin L mπ x and integrate. Same reasoning: only the n = m n=m n = m sine–sine term survives (= L =L = L ):
b m = 1 L ∫ − L L f ( x ) sin m π x L d x . \boxed{b_m = \frac1L\int_{-L}^{L} f(x)\sin\frac{m\pi x}{L}\,dx.} b m = L 1 ∫ − L L f ( x ) sin L mπ x d x .
Worked example Example 1 — Square wave,
f ( x ) = { − 1 − L < x < 0 + 1 0 < x < L f(x)=\begin{cases}-1 & -L<x<0\\ +1 & 0<x<L\end{cases} f ( x ) = { − 1 + 1 − L < x < 0 0 < x < L
a 0 a_0 a 0 : 1 L ∫ − L L f d x = 1 L [ ( − 1 ) L + ( 1 ) L ] = 0 \frac1L\int_{-L}^{L}f\,dx = \frac1L\big[(-1)L + (1)L\big]=0 L 1 ∫ − L L f d x = L 1 [ ( − 1 ) L + ( 1 ) L ] = 0 . Why? f f f is odd , so its average is zero.
a m a_m a m : f f f is odd and cos \cos cos is even ⇒ f cos f\cos f cos is odd ⇒ integral over symmetric interval = 0 =0 = 0 . So all a m = 0 a_m=0 a m = 0 . Why this step? Symmetry saves all the work.
b m b_m b m : f sin f\sin f sin is even, so
b m = 1 L ∫ − L L f sin m π x L d x = 2 L ∫ 0 L ( 1 ) sin m π x L d x = 2 L ⋅ L m π [ − cos m π x L ] 0 L = 2 m π ( 1 − cos m π ) . b_m = \frac1L\int_{-L}^L f\sin\frac{m\pi x}{L}dx = \frac2L\int_0^L (1)\sin\frac{m\pi x}{L}dx = \frac2L\cdot\frac{L}{m\pi}\Big[-\cos\frac{m\pi x}{L}\Big]_0^L = \frac{2}{m\pi}\big(1-\cos m\pi\big). b m = L 1 ∫ − L L f sin L mπ x d x = 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π ) .
Since cos m π = ( − 1 ) m \cos m\pi=(-1)^m cos mπ = ( − 1 ) m : b m = 2 m π ( 1 − ( − 1 ) m ) = { 4 m π m odd 0 m even b_m=\frac{2}{m\pi}(1-(-1)^m)=\begin{cases}\frac{4}{m\pi}& m\text{ odd}\\0& m\text{ even}\end{cases} b m = mπ 2 ( 1 − ( − 1 ) m ) = { mπ 4 0 m odd m even .
So f ( x ) = 4 π ∑ k = 0 ∞ 1 2 k + 1 sin ( 2 k + 1 ) π x L . f(x)=\dfrac{4}{\pi}\sum_{k=0}^\infty \dfrac{1}{2k+1}\sin\dfrac{(2k+1)\pi x}{L}. f ( x ) = π 4 ∑ k = 0 ∞ 2 k + 1 1 sin L ( 2 k + 1 ) π x .
Worked example Example 2 —
f ( x ) = x f(x)=x f ( x ) = x on [ − π , π ] [-\pi,\pi] [ − π , π ] (so L = π L=\pi L = π )
a 0 = 1 π ∫ − π π x d x = 0 a_0=\frac1\pi\int_{-\pi}^\pi x\,dx = 0 a 0 = π 1 ∫ − π π x d x = 0 (odd). a m = 0 a_m=0 a m = 0 (odd × \times × even).
b m = 1 π ∫ − π π x sin ( m x ) d x = 2 π ∫ 0 π x sin m x d x . b_m=\frac1\pi\int_{-\pi}^\pi x\sin(mx)\,dx = \frac2\pi\int_0^\pi x\sin mx\,dx. b m = π 1 ∫ − π π x sin ( m x ) d x = π 2 ∫ 0 π x sin m x d x . Integrate by parts (u = x , d v = sin m x d x u=x,\ dv=\sin mx\,dx u = x , d v = sin m x d x ):
∫ 0 π x sin m x d x = [ − x cos m x m ] 0 π + 1 m ∫ 0 π cos m x d x = − π cos m π m + 0 = − π ( − 1 ) m m . \int_0^\pi x\sin mx\,dx = \Big[-\frac{x\cos mx}{m}\Big]_0^\pi + \frac1m\int_0^\pi\cos mx\,dx = -\frac{\pi\cos m\pi}{m} + 0 = -\frac{\pi(-1)^m}{m}. ∫ 0 π x sin m x d x = [ − m x c o s m x ] 0 π + m 1 ∫ 0 π cos m x d x = − m π c o s mπ + 0 = − m π ( − 1 ) m .
Why this step? Integration by parts because we have a polynomial times a trig — differentiating x x x simplifies it.
b m = 2 π ⋅ ( − π ( − 1 ) m m ) = − 2 ( − 1 ) m m = 2 ( − 1 ) m + 1 m . b_m=\frac2\pi\cdot\Big(-\frac{\pi(-1)^m}{m}\Big) = -\frac{2(-1)^m}{m} = \frac{2(-1)^{m+1}}{m}. b m = π 2 ⋅ ( − m π ( − 1 ) m ) = − m 2 ( − 1 ) m = m 2 ( − 1 ) m + 1 .
So x = 2 ∑ m = 1 ∞ ( − 1 ) m + 1 m sin ( m x ) x = 2\sum_{m=1}^\infty \frac{(-1)^{m+1}}{m}\sin(mx) x = 2 ∑ m = 1 ∞ m ( − 1 ) m + 1 sin ( m x ) on ( − π , π ) (-\pi,\pi) ( − π , π ) .
Worked example Example 3 — pure cosine
f ( x ) = cos 3 π x L f(x)=\cos\frac{3\pi x}{L} f ( x ) = cos L 3 π x
Forecast-then-verify: by orthogonality, only a 3 a_3 a 3 should be nonzero. Indeed a 3 = 1 L ∫ − L L cos 2 3 π x L d x = 1 L ⋅ L = 1 a_3=\frac1L\int_{-L}^L\cos^2\frac{3\pi x}{L}dx = \frac1L\cdot L = 1 a 3 = L 1 ∫ − L L cos 2 L 3 π x d x = L 1 ⋅ L = 1 , and every other coefficient = 0 =0 = 0 . ✔ The series of a basis function is just itself.
Common mistake "The constant term is
a 0 a_0 a 0 , so a 0 = 1 2 L ∫ f d x a_0=\frac{1}{2L}\int f\,dx a 0 = 2 L 1 ∫ f d x ."
Why it feels right: the average of f f f over a period is 1 2 L ∫ − L L f d x \frac{1}{2L}\int_{-L}^L f\,dx 2 L 1 ∫ − L L f d x , and the constant term equals that average. The fix: the constant term is written as a 0 2 \frac{a_0}{2} 2 a 0 , so the average = a 0 2 ⇒ a 0 = 1 L ∫ − L L f d x =\frac{a_0}{2}\Rightarrow a_0 = \frac1L\int_{-L}^L f\,dx = 2 a 0 ⇒ a 0 = L 1 ∫ − L L f d x . The 1 2 \frac12 2 1 and the 1 L \frac1L L 1 are consistent; just don't double-count.
1 L \frac1L L 1 vs 2 L \frac2L L 2 inconsistently.
Why it feels right: half-range (sine or cosine only) series on [ 0 , L ] [0,L] [ 0 , L ] use 2 L ∫ 0 L \frac2L\int_0^L L 2 ∫ 0 L . The fix: on the full interval [ − L , L ] [-L,L] [ − L , L ] every coefficient uses 1 L ∫ − L L \frac1L\int_{-L}^L L 1 ∫ − L L . You only get an extra factor of 2 when symmetry lets you fold ∫ − L L = 2 ∫ 0 L \int_{-L}^L = 2\int_0^L ∫ − L L = 2 ∫ 0 L — that's a consequence , not the base formula.
Common mistake Forgetting to check symmetry first.
Why it feels right: the formulas always work, so why bother. The fix: if f f f is odd , all a n = 0 a_n=0 a n = 0 ; if even , all b n = 0 b_n=0 b n = 0 . Spotting this first eliminates half the integrals and prevents algebra errors.
Common mistake Assuming term-by-term integration is automatically valid.
Why it feels right: it works in every textbook example. The fix: it's justified for "nice" (e.g. piecewise smooth) f f f via uniform/L 2 L^2 L 2 convergence theory. For exam-level f f f it's fine, but know it's an assumption.
Recall Feynman: explain to a 12-year-old
Imagine a song made by mixing many tuning forks, each humming a steady note. If you're handed the finished song, how do you find out how loud each fork was? You play one matching fork next to the song and "average" — only that fork's note adds up, every other note cancels out because over a full beat they go up as much as down. The Fourier coefficient is exactly "how loud was this fork." Multiplying f f f by cos n π x L \cos\frac{n\pi x}{L} cos L nπ x and integrating is "listening with the n n n -th fork."
Mnemonic Remembering the coefficients
"One-L for all, project to isolate."
Every full-series coefficient has 1 L ∫ − L L \frac1L\int_{-L}^L L 1 ∫ − L L . Then a 0 → 1 a_0\to 1 a 0 → 1 , a n → cos a_n\to\cos a n → cos , b n → sin b_n\to\sin b n → sin — match the term you want, multiply, integrate, orthogonality does the rest.
Mantra: a=cos, b=sin, both over 1 L \frac1L L 1 .
What is the full Fourier series of f f f on [ − L , L ] [-L,L] [ − L , L ] ? f = a 0 2 + ∑ n ≥ 1 [ a n cos n π x L + b n sin n π x L ] f=\frac{a_0}{2}+\sum_{n\ge1}\big[a_n\cos\frac{n\pi x}{L}+b_n\sin\frac{n\pi x}{L}\big] f = 2 a 0 + ∑ n ≥ 1 [ a n cos L nπ x + b n sin L nπ x ] Why is the constant written a 0 / 2 a_0/2 a 0 /2 and not a 0 a_0 a 0 ? So the single formula
a n = 1 L ∫ − L L f cos n π x L d x a_n=\frac1L\int_{-L}^L f\cos\frac{n\pi x}{L}dx a n = L 1 ∫ − L L f cos L nπ x d x also gives
a 0 a_0 a 0 correctly at
n = 0 n=0 n = 0 .
State the formula for a n a_n a n (n ≥ 0 n\ge0 n ≥ 0 ). a n = 1 L ∫ − L L f ( x ) cos n π x L d x a_n=\frac1L\int_{-L}^L f(x)\cos\frac{n\pi x}{L}\,dx a n = L 1 ∫ − L L f ( x ) cos L nπ x d x State the formula for b n b_n b n . b n = 1 L ∫ − L L f ( x ) sin n π x L d x b_n=\frac1L\int_{-L}^L f(x)\sin\frac{n\pi x}{L}\,dx b n = L 1 ∫ − L L f ( x ) sin L nπ x d x What property of the basis functions makes the derivation work? Orthogonality over
[ − L , L ] [-L,L] [ − L , L ] : integrals of different sine/cosine products vanish.
Value of ∫ − L L cos n π x L cos m π x L d x \int_{-L}^L\cos\frac{n\pi x}{L}\cos\frac{m\pi x}{L}dx ∫ − L L cos L nπ x cos L mπ x d x for m = n ≥ 1 m=n\ge1 m = n ≥ 1 ? Value of ∫ − L L sin m π x L cos n π x L d x \int_{-L}^L\sin\frac{m\pi x}{L}\cos\frac{n\pi x}{L}dx ∫ − L L sin L mπ x cos L nπ x d x ? How do you isolate a m a_m a m from the series? Multiply both sides by
cos m π x L \cos\frac{m\pi x}{L} cos L mπ x and integrate over
[ − L , L ] [-L,L] [ − L , L ] ; only the
n = m n=m n = m term survives.
If f f f is odd, which coefficients vanish? All
a n a_n a n (including
a 0 a_0 a 0 ); only
b n b_n b n remain.
If f f f is even, which coefficients vanish? All
b n b_n b n ; only
a 0 , a n a_0,a_n a 0 , a n remain.
Fourier b m b_m b m of the square wave on [ − L , L ] [-L,L] [ − L , L ] ? 4 m π \frac{4}{m\pi} mπ 4 for odd
m m m ,
0 0 0 for even
m m m .
Identity used to derive cos–cos orthogonality? cos A cos B = 1 2 [ cos ( A − B ) + cos ( A + B ) ] \cos A\cos B=\frac12[\cos(A-B)+\cos(A+B)] cos A cos B = 2 1 [ cos ( A − B ) + cos ( A + B )] .
basis waves are perpendicular
isolates each coefficient
isolates each coefficient
isolates each coefficient
Product-to-sum identities
Intuition Hinglish mein samjho
Dekho, full Fourier series ka idea simple hai: koi bhi periodic function f ( x ) f(x) f ( x ) jo [ − L , L ] [-L,L] [ − L , L ] pe defined hai, usko hum sine aur cosine waves ke mixture ki tarah likh sakte hain. Jaise ek complex sound bahut saari pure notes ka sum hota hai, waise hi f f f ek constant plus cos n π x L \cos\frac{n\pi x}{L} cos L nπ x aur sin n π x L \sin\frac{n\pi x}{L} sin L nπ x ka sum hai. Coefficients a 0 , a n , b n a_0, a_n, b_n a 0 , a n , b n batate hain ki har wave kitni "loud" hai.
Ab sabse important cheez hai orthogonality . Matlab agar aap do alag-alag frequency ke waves ko multiply karke [ − L , L ] [-L,L] [ − L , L ] pe integrate karo, to answer zero aata hai; aur agar same wave ko apne saath multiply karke integrate karo to L L L aata hai. Yahi trick poori derivation chalati hai — functions ko vectors ki tarah socho aur integral ko dot product ki tarah. Perpendicular vectors ka dot product zero hota hai, bas wahi ho raha hai.
To coefficient nikalne ka method "project karo" hai: b m b_m b m chahiye? f f f ko sin m π x L \sin\frac{m\pi x}{L} sin L mπ x se multiply karo aur integrate karo. Orthogonality ki wajah se sirf m m m -wala term bachta hai (woh L L L deta hai), baaki sab cancel. Isse turant b m = 1 L ∫ − L L f sin m π x L d x b_m=\frac1L\int_{-L}^L f\sin\frac{m\pi x}{L}dx b m = L 1 ∫ − L L f sin L mπ x d x mil jaata hai. Same logic se a m a_m a m ke liye cos \cos cos se multiply, aur a 0 a_0 a 0 ke liye sirf integrate (kyunki sab oscillating terms ka average zero hota hai).
Exam tip: pehle symmetry check karo. Agar f f f odd hai to saare a n = 0 a_n=0 a n = 0 , sirf b n b_n b n bachenge; agar even hai to ulta. Isse aadha kaam khatam. Aur dhyaan rakho — full interval [ − L , L ] [-L,L] [ − L , L ]