Tom K. answered 06/28/20
Knowledgeable and Friendly Math and Statistics Tutor
Fourier series are used to change a function into a sum of a constant + cos functions + sin functions.
The cos, sin, and constant terms are orthogonal to one another and are normalized so that each integrates to 1 if the true function were only the constant, sin, or cos term.
This is why x = a0 + the sum for n = 1 to infinity of an cos nx + bn cos nx
Use I[a,b] for integration from a to b and E[a,b] for the evaluation from a to b
Then,
a0 = 1/2π I[o, 2π ] f(x) dx
an = 1/π I[o, 2π ] f(x) cos(nx) dx , n > 0
bn = 1/π I[o, 2π ] f(x) sin(nx) dx , n > 0
f(x) = x , 0 <= x <= π
f(x) = π , π < x <= 2π
Then,
a0 = 1/2π (I[o, π ] x dx + I[π, 2π] π dx) =
1/2π(x2/2 E[0, π] + πx E[π, 2π]) =
1/2π(π2/2 + π(2π - π)) =
1/2π(3π2/2) =
3π/4
an = 1/π I[o, π ] x cos(nx) dx + 1/π I[o, π ] π cos(nx) dx =
1/π (x/n sin (nx) + 1/n2 cos (nx)) E[o, π ] + 1/πn sin(nx) E[π, 2π]) =
1/(πn2) (cos n π - 1) =
-2/(πn2) , n odd
bn = 1/π I[o, π ] x sin(nx) dx + 1/π I[o, π ] π sin(nx) dx =
1/π ((-x/n cos nx + 1/n2 sin(nx)) E[0,π ] - π/n cos(nx) E[π, 2π]) =
1/n(-cos n π -cos 2n π + cos n π) =
-1/n, all n
f(x) = 3π/4 + ¨∑-2/(π(2n-1)^2) cos(2n-1)x + ¨∑-1/n sin nx , where n is summed from 1 to infinity