4.7.6Partial Differential Equations

Half-range sine and cosine series

1,910 words9 min readdifficulty · medium1 backlinks

WHY do we even need this?

WHY two choices? Because the PDE's boundary conditions decide which one is useful:

  • Dirichlet BC (u=0u=0 at the ends) \to needs functions that vanish at x=0,Lx=0,L \to sine.
  • Neumann BC (zero derivative / insulated ends) \to needs zero slope at ends \to cosine.

HOW to derive the formulas from scratch

Start from the full Fourier series of a function with period 2L2L on (L,L)(-L, L):

f(x)=a02+n=1[ancosnπxL+bnsinnπxL]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]

with

an=1LLLf(x)cosnπxLdx,bn=1LLLf(x)sinnπxLdx.a_n = \frac1L\int_{-L}^{L} f(x)\cos\frac{n\pi x}{L}\,dx,\qquad b_n = \frac1L\int_{-L}^{L} f(x)\sin\frac{n\pi x}{L}\,dx.

Case 1 — Odd extension (sine series)

For an odd ff: f(x)sinnπxLf(x)\sin\frac{n\pi x}{L} is (odd)(odd) = even, so

bn=1LLLfsinnπxLdx=2L0Lf(x)sinnπxLdx.b_n = \frac1L\int_{-L}^{L} f\sin\frac{n\pi x}{L}\,dx = \frac{2}{L}\int_{0}^{L} f(x)\sin\frac{n\pi x}{L}\,dx.

Case 2 — Even extension (cosine series)

For an even ff: f(x)sin()f(x)\sin(\cdot) is (even)(odd)=odd bn=0\Rightarrow b_n=0. And f(x)cos()f(x)\cos(\cdot) is (even)(even)=even, so we double the half-integral:

an=2L0Lf(x)cosnπxLdx,a0=2L0Lf(x)dx.a_n = \frac{2}{L}\int_0^L f(x)\cos\frac{n\pi x}{L}\,dx,\qquad a_0 = \frac{2}{L}\int_0^L f(x)\,dx.
Figure — Half-range sine and cosine series

Worked Examples


Common Mistakes (Steel-manned)


Active Recall

Recall Quick self-test (hide and answer)
  1. Which extension gives only sine terms, and why?
  2. What's the formula for bnb_n in a half-range sine series of period... wait, what's the period?
  3. Why does an=0a_n=0 for an odd function?
  4. Which BC type pairs with cosine series?

Answers: 1. Odd extension; cos\cos is even so fcosf\cos is odd, integral =0=0. 2. bn=2L0LfsinnπxLdxb_n=\frac2L\int_0^L f\sin\frac{n\pi x}{L}dx; extended period is 2L2L. 3. fcosf\cos becomes odd, integrates to 00 over [L,L][-L,L]. 4. Neumann (insulated/zero-slope) ends.

Recall Feynman: explain to a 12-year-old

Imagine you have a song recorded only for the first half of a tape. To play it on a machine that needs a full loop, you record the second half yourself. You can copy the first half backwards and flipped upside-down (odd → makes it perfectly "wave-like," only smooth wiggly sine sounds), or just mirror it (even → only cosine sounds, and it can have a steady background hum = the average). Both give you a full song; you pick whichever matches the rules of your machine.


Connections


Half-range expansion represents a function defined on which interval?
Only on [0,L][0,L] (half of a full period 2L2L).
Odd extension of ff produces which type of series?
Pure sine series (all an=0a_n=0).
Even extension of ff produces which type of series?
Pure cosine series (all bn=0b_n=0), including the a0/2a_0/2 term.
Why do cosine terms vanish for an odd function?
f(x)cosnπxLf(x)\cos\frac{n\pi x}{L} is (odd)(even)=odd; integral over symmetric [L,L][-L,L] is 00.
Half-range sine coefficient formula
bn=2L0Lf(x)sinnπxLdxb_n=\dfrac{2}{L}\displaystyle\int_0^L f(x)\sin\dfrac{n\pi x}{L}\,dx.
Half-range cosine coefficient formula
an=2L0Lf(x)cosnπxLdxa_n=\dfrac{2}{L}\displaystyle\int_0^L f(x)\cos\dfrac{n\pi x}{L}\,dx, with a0=2L0Lfdxa_0=\dfrac2L\int_0^L f\,dx.
What does a0/2a_0/2 physically represent?
The average (mean) value of ff over [0,L][0,L].
Which boundary condition pairs with a sine series?
Dirichlet (function = 0 at the ends).
Which boundary condition pairs with a cosine series?
Neumann (zero derivative / insulated ends).
At a jump discontinuity of the periodic extension, the series converges to...?
The midpoint (average) of the left and right limits (Dirichlet's theorem).
Sine series of xx on [0,π][0,\pi]
x=2n=1(1)n+1nsinnxx=2\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n}\sin nx.
Cosine series of xx on [0,π][0,\pi]
x=π24πk=0cos((2k+1)x)(2k+1)2x=\frac\pi2 - \frac4\pi\sum_{k=0}^\infty \frac{\cos((2k+1)x)}{(2k+1)^2}.

Concept Map

only defines f on

needs periodic on -L,L

extend as odd

extend as even

cosine integrals vanish

sine integrals vanish

coeffs

coeffs

selects

selects

a0 over 2 equals

PDE on finite rod 0 to L

f known on half range

Full Fourier series period 2L

Odd extension

Even extension

Half-range sine series

Half-range cosine series

bn from 0 to L integral

an and a0 from 0 to L

Dirichlet BC u=0 at ends

Neumann BC insulated ends

Average value of f

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, jab hum PDE solve karte hain ek finite rod par, say 00 se LL tak, tab function sirf is chhote interval par defined hota hai. Lekin Fourier series ko chahiye periodic function jo (L,L)(-L, L) par defined ho. To hum ek jugaad lagate hain: jo half hume nahi pata (L-L se 00 tak), usko hum khud banate hain. Do tarike: ya to function ko odd bana do (mirror + flip), ya even bana do (sirf mirror). Yahi "half-range" ka matlab hai — sirf aadha period pata hai.

Ab magic yeh hai: agar extension odd banaya, to saare cosine terms apne aap zero ho jaate hain, kyunki cosine even hai aur odd × even = odd, aur odd function ka integral symmetric interval par hamesha zero. Bachte hain sirf sine terms — aur sine x=0x=0 aur x=Lx=L par zero hota hai, jo fixed-wall (Dirichlet) boundary conditions ke liye perfect hai. Ulta, agar even extension liya, to sirf cosine terms bachte hain, plus ek a0/2a_0/2 wala constant jo function ki average value hai. Yeh insulated ends (Neumann BC) ke liye fit baithta hai.

Formula yaad rakhna easy hai: dono mein factor 2L\frac{2}{L} aata hai aur integral sirf 0L\int_0^L tak, kyunki hum half range hi jaante hain. Sine ke liye bn=2L0LfsinnπxLdxb_n=\frac{2}{L}\int_0^L f\sin\frac{n\pi x}{L}dx, cosine ke liye an=2L0LfcosnπxLdxa_n=\frac{2}{L}\int_0^L f\cos\frac{n\pi x}{L}dx. Ek important baat: endpoints par agar periodic extension mein jump hai, to series exact value nahi, balki midpoint (average) deti hai — yeh Dirichlet theorem hai, exam mein bahut puchte hain. Mnemonic: Odd→Sine, Even→Cosine.

Go deeper — visual, from zero

Test yourself — Partial Differential Equations

Connections