Mathematics 173 -- Applied Mathematics 1
November 11, 1999
Fourier Sine and Cosine Series
Consider the function on the interval [0,3]
(This could represent something like an initial temperature distribution in a heat
conduction problem.)
> f := x -> piecewise(x < 3/2, x + 1, x >= 3/2, exp(-x));
In our work on BVP for the heat equation, we would expand functions like this in series
using the appropriate eigenfunctions for the problem at hand. Two particular cases
were the Fourier sine series:
where
and the Fourier cosine series
where
and if
Both of these are examples of general Fourier series.
The Fourier Sine series of f converges to the odd extension of f on [-3,3]
at points of continuity, and to the average of the one-sided limits at jumps:
>
> B := n -> 2*evalf(Int(f(x)*sin(n*Pi*x/3),x=0..3))/3;
> ss := (k,x) -> add(B(n)*sin(n*Pi*x/3),n=1..k);
Warning, `n` in call to `add` is not local
> with(plots):
> FP:=plot(f(x),x=0..3,color=blue,discont=true):
> SP:=plot(ss(20,x),x=-3..3,color=red):
> display({FP,SP});
On the other hand, the Fourier cosine series for f converges to the even extension of f on [-3,3]
at points of continuity, and to the average of the one-sided limits at jumps:
> A0 := evalf(Int(f(x),x=0..3))/3;
> A := n -> 2*evalf(Int(f(x)*cos(n*Pi*x/3),x=0..3))/3;
> sc := (k, x) -> A0 + add(A(n)*cos(n*Pi*x/3),n=1..k);
Warning, `n` in call to `add` is not local
> CP := plot(sc(20,x),x=-3..3):
> display({FP,CP});
On larger intervals, the sine and cosine series converge to the periodic extensions of the odd and even
extensions, respectively.