0

We have our function: $$f(x)=|\cos x|$$ We have to find the Fourier transformation for it:

Solution: First we have to find where it is defined. I think it is defined in $[-\dfrac{\pi}{2}, \dfrac{\pi}{2}]$. If I am wrong, where is it defined and why ?

Second we have to find a0:

$\displaystyle a_0=\dfrac{1}{\dfrac{\pi}{2}}\int_{}^{}\cos x\cos0 \,dx=2$ Right?

than for b0 we have:

$\displaystyle b_0=\dfrac{1}{\dfrac{\pi}{2}}\int_{}^{}\cos x\sin 0\,dx=0$ Right?

after that we have to find an:

$\displaystyle a_n=\dfrac{1}{\dfrac{\pi}{2}}\int_{}^{}\cos x\cos n\,dx$ which turned out to be very ugly as a result => I am making a mistake somewhere

My question is what have I mistaked so far and what do I have to do after

Harton
  • 171
  • Are you trying to compute the Fourier Series of $\left | \cos(x) \right |$ or the Fourier Transform of $\left | \cos(x) \right |$ ? – Vivek Kaushik Jan 14 '17 at 19:06
  • well I need to know both of them so, I think both of them – Harton Jan 14 '17 at 20:22
  • You can just use the sum rule for cosine to perform the general integral for $a_n$ it will turn out to be a straightforward integral to do – Triatticus Jan 14 '17 at 21:22
  • this is the way to solve this problem and I am not allowed to think out of the box, also this problem is from textbook so if I get some ugly things, I have probably made a mistake – Harton Jan 14 '17 at 21:33

1 Answers1

3

where is it defined and why ?

It's defined on the interval $[13, 42]$ because I decided so. This is an arbitrary choice: you pick an interval and restrict the function $\lvert\cos x\rvert$ to it.

But usually in exercises on Fourier series the interval is $[-\pi,\pi]$ so I'd stick with that by default.

Then you should calculate the coefficients. The function is even, so all sine coefficients are zeros. For cosine coefficients, we get
$$ a_n = \frac{1}{\pi} \int_{-\pi}^\pi \lvert\cos x\rvert\cos nx\,dx = \frac{2}{\pi} \int_{0}^\pi \lvert\cos x\rvert\cos nx\,dx $$ which can be evaluated by splitting the integral at $\pi/2$, where $\cos x$ changes sign: $$ a_n = \frac{2}{\pi} \int_{0}^{\pi/2} \cos x\cos nx\,dx - \frac{2}{\pi} \int_{\pi/2}^\pi \cos x\cos nx\,dx \\ = \frac{2}{\pi}\left( \frac{\cos(\pi n/2)}{1-n^2}- \frac{\cos(\pi n/2)}{n^2-1} \right) = \frac{4}{\pi}\frac{\cos(\pi n/2)}{1-n^2} $$ except for $n=1$, when the computation goes differently, producing $$a_1 = \frac{2}{\pi}\left( \frac{\pi}{4} + \frac{\pi}{4}\right) = 1$$

egreg
  • 238,574
  • I just tried this, and actually, $a_1=0$ because $\frac{2}{\pi}\int_0^{\pi/2}\cos^2 x,dx=\frac{2}{\pi}\int_{\pi/2}^\pi\cos^2x,dx$ and you're just subtracting the two. – Ed Krohne Jun 28 '22 at 12:32