Find the Fourier series for the function f (x) = |Cosx| in (-π,π)
Answers
Given f(x) = |sinx|
f(x) = |sinx| = sinx
f(-x) = |sin(-x)| = sinx
Hence f(x) = f(-x)
∴∴ |sinx| is even function
The Fourier series of an even function contains only cosine terms and is known as Fourier Series and is given by
f(x)=a02+∑n=1∞ancosnxf(x)=a02+∑n=1∞ancosnx
a0=1π∫−ππf(x)dx=2π∫0πf(x)cosnxdxa0=1π∫−ππf(x)dx=2π∫0πf(x)cosnxdx
∴∴ Let us first find
a0=2π∫0πsinxdxa0=2π∫0πsinxdx
∴a0=2π∫0πsinxdx∴a0=2π∫0πsinxdx
∴a0=2π[−cosx]π0=2π=4π∴a0=2π[−cosx]0π=2π=4π
∴a0=4π∴a0=4π
Now
an=2π∫0πf(x)cosnxdxan=2π∫0πf(x)cosnxdx
∴an=2π∫0πsinxcosnxdx∴an=2π∫0πsinxcosnxdx
∴an=2π∫0πsin(1+n)x+sin(1−n)xdx∴an=2π∫0πsin(1+n)x+sin(1−n)xdx
∵sinAsinB=12[sin(A+B)+sin(A−B)]∵sinAsinB=12[sin(A+B)+sin(A−B)]
∴an=1π∫0πsin(1+n)x+sin(1−n)xdx∴an=1π∫0πsin(1+n)x+sin(1−n)xdx
∴an=1π[−cos(1+n)x1+n−cos(1−n)x1−n]π0∴an=1π[−cos(1+n)x1+n−cos(1−n)x1−n]0π
∴an=1π[−cos(1+n)π1+n−cos(1−n)π1−n+11−n+11+n]∴an=1π[−cos(1+n)π1+n−cos(1−n)π1−n+11−n+11+n]
∴an=1π[−cos(π+nπ)1+n−cos(π−nπ)1−n+21−n2]∴an=1π[−cos(π+nπ)1+n−cos(π−nπ)1−n+21−n2]
∴an=1π[−(−cosnπ)1+n−(−cosnπ)1−n+21−n2]∴an=1π[−(−cosnπ)1+n−(−cosnπ)1−n+21−n2]
∴an=1π[2cosnπ1−n2+21−n2]∴an=1π[2cosnπ1−n2+21−n2]
an=2π(1−n2)(cosnπ+1)an=2π(1−n2)(cosnπ+1)
an=2π(1−n2)(2)an=2π(1−n2)(2)
If n is even
an=4π(1−n2)an=4π(1−n2)
an=0an=0
If n is odd
∴f(x)=a02+∑n=1∞ancosnx∴f(x)=a02+∑n=1∞ancosnx
∴f(x)=12∗4π+∑n=1∞ancos2nx∴f(x)=12∗4π+∑n=1∞ancos2nx
(∵an∵an exist only if n is even i.e. put n = 2n)
∴f(x)=2π+∑n=1∞4π(1−(2n)2)cos2nx∴f(x)=2π+∑n=1∞4π(1−(2n)2)cos2nx
(i.e. put n = 2n)
∴f(x)=2π4π∑n=1∞cos2nx(1−4n2)∴f(x)=2π4π∑n=1∞cos2nx(1−4n2)
By re-arranging,
f(x)=2π−4π∑n=1∞cos2nx(4n2−1)