Step 2: Calculate a0.
Continuing from the previous step:
a0=(02+2⋅0)−((−1)2+2(−1))
a0=0−(1−2)
a0=0−(−1)
a0=1
Step 3: Calculate an.
an=∫−11f(x)cos(nπx)dx
Since f(x)=0 for 0<x<1:
an=∫−10(2x+2)cos(nπx)dx
We use integration by parts, ∫udv=uv−∫vdu.
Let u=2x+2 and dv=cos(nπx)dx.
Then du=2dx and v=nπ1sin(nπx).
an=[(2x+2)nπ1sin(nπx)]−10−∫−10nπ1sin(nπx)⋅2dx
Evaluate the first term:
At x=0: (2(0)+2)nπ1sin(0)=2⋅nπ1⋅0=0.
At x=−1: (2(−1)+2)nπ1sin(−nπ)=0⋅nπ1⋅0=0.
So the first term is 0−0=0.
an=−nπ2∫−10sin(nπx)dx
an=−nπ2[−nπ1cos(nπx)]−10
an=(nπ)22[cos(nπx)]−10
an=(nπ)22(cos(nπ⋅0)−cos(nπ(−1)))
an=(nπ)22(cos(0)−cos(nπ))
Since cos(0)=1 and cos(nπ)=(−1)n:
an=(nπ)22(1−(−1)n)
Step 4: Calculate bn.
bn=∫−11f(x)sin(nπx)dx
Since f(x)=0 for 0<x<1:
bn=∫−10(2x+2)sin(nπx)dx
We use integration by parts, ∫udv=uv−∫vdu.
Let u=2x+2 and dv=sin(nπx)dx.
Then du=2dx and v=−nπ1cos(nπx).
bn=[(2x+2)(−nπ1cos(nπx))]−10−∫−10(−nπ1cos(nπx))⋅2dx
Evaluate the first term:
At x=0: (2(0)+2)(−nπ1cos(0))=2(−nπ1⋅1)=−nπ2.
At x=−1: (2(−1)+2)(−nπ1cos(−nπ))=0⋅(−nπ1cos(nπ))=0.
So the first term is −nπ2−0=−nπ2.
bn=−nπ2+nπ2∫−10cos(nπx)dx
bn=−nπ2+nπ2[nπ1sin(nπx)]−10
bn=−nπ2+(nπ)22(sin(0)−sin(−nπ))
Since sin(0)=0 and sin(−nπ)=0:
bn=−nπ2+(nπ)22(0−0)
bn=−nπ2
Step 5: Write the Fourier series.
Substitute the coefficients a0=1, an=(nπ)22(1−(−1)n), and bn=−nπ2 into the Fourier series formula:
f(x)=2a0+∑n=1∞(ancos(nπx)+bnsin(nπx))
f(x)=21+∑n=1∞(n2π22(1−(−1)n)cos(nπx)−nπ2sin(nπx))
The Fourier series for f(x) is:
f(x) = \frac{1{2} + \sum_{n=1}^{\infty} \left( \frac{2(1 - (-1)^n)}{n^2\pi^2} \cos(n\pi x) - \frac{2}{n\pi} \sin(n\pi x) \right)}
That's 2 down. 3 left today — send the next one.