Solving the coefficients of fourier series

In summary, the given function f(x) = |cos x| if -\pi \leq x \leq\ \pi has a corresponding Fourier series of 2/\pi - 4/\pi\sum\frac{-1^{k}}{(2k)^{2}-1}cos(2kx), where k = 1 and goes to infinity. To solve for the Fourier series, the properties of even functions are considered and it is found that b_{k} = 0 and a_{0} = 2/\pi. Using the properties of even functions again, a_{k} is found to be (2/\pi)*(sin((k+1)*\pi/2)/(k+1
  • #1
jianxu
94
0

Homework Statement


f(x) = |cos x| if -[tex]\pi[/tex] [tex]\leq[/tex] x [tex]\leq\[/tex] [tex]\pi[/tex]

The Fourier series answer we should end up with is the following:

2/[tex]\pi[/tex] - 4/[tex]\pi[/tex][tex]\sum[/tex][tex]\frac{-1^{k}}{(2k)^{2}-1}[/tex]cos(2kx)

where for the summation, k = 1 and goes to infinity.

What I need to do is to actually go an solve for the Fourier series and show that we get the same series when we derive it given f(x)

Homework Equations



f(x) = [tex]a_{0}[/tex] + [tex]\sum[/tex][tex]a_{k}[/tex]coskx + [tex]b_{k}[/tex]sinkx where k =1 and goes to infinity

[tex]a_{0}[/tex] = 1/2[tex]\pi[/tex][tex]\int[/tex]f(x)dx

[tex]a_{k}[/tex] = 1/[tex]\pi[/tex][tex]\int[/tex]f(x)coskxdx

[tex]b_{k}[/tex] = 1/[tex]\pi[/tex][tex]\int[/tex]f(x)sinkxdx

where we integrate all the above integrals from -[tex]\pi[/tex] to [tex]\pi[/tex]

Lastly, the properties of even functions are also considered.

The Attempt at a Solution



So, to start out, since [tex]b_{k}[/tex] = 1/[tex]\pi[/tex][tex]\int[/tex]f(x)sinkxdx, cosx is even and the sinkx is odd,
[tex]b_{k}[/tex] = 0

for
[tex]a_{0}[/tex] = 1/2[tex]\pi[/tex][tex]\int[/tex]f(x)dx

due to the properties of an even function I have:
= 1/[tex]\pi[/tex][tex]\int[/tex]f(x)dx integrated from 0 to [tex]\pi[/tex]

= 1/[tex]\pi[/tex]([tex]\int[/tex]cosxdx + [tex]\int[/tex]-cosxdx)
where the first integral is from 0 to [tex]\pi[/tex]/2} and the second integral is from [tex]\pi[/tex]/2 to [tex]\pi[/tex],

solving this gives me

[tex]a_{0}[/tex] = 1/[tex]\pi[/tex](1 - (-1)) = 2/[tex]\pi[/tex]

For [tex]a_{k}[/tex]:

using even function properties again I have,
[tex]a_{k}[/tex] = 2/[tex]\pi[/tex][tex]\int[/tex]f(x)coskxdx
= 2/[tex]\pi[/tex][tex]\int[/tex]cosx*coskx dx
where integral goes from 0 to [tex]\pi[/tex].

Maybe I'm just rusty with integration, but I just want to make sure I'm heading into the right direction and how do I integrate that? ( meaning [tex]\int[/tex]cosx*coskx dx)

Thanks
 
Physics news on Phys.org
  • #2
Last edited by a moderator:
  • #4
sorry for double post but this is what I got after integrating,

[tex]a_{k}[/tex]=(8/[tex]\pi[/tex])*(sin((1/2)*(k+1)*[tex]\pi[/tex])/(k+1)+sin((1/2)*(k-1)*[tex]\pi[/tex])/(k-1))

does that look like I'm headed in the right direction? Thanks
 
  • #5
Hi jianxu! :smile:

(what happened to that π i gave you? :confused:)
jianxu said:
sorry for double post but this is what I got after integrating,

[tex]a_{k}[/tex]=(8/[tex]\pi[/tex])*(sin((1/2)*(k+1)*[tex]\pi[/tex])/(k+1)+sin((1/2)*(k-1)*[tex]\pi[/tex])/(k-1))

does that look like I'm headed in the right direction? Thanks

It's a little difficult to check when you haven't shown your working, but that looks roughly right, except I don't see where the (1/2) comes from.
 
  • #6
woops, here's my work:P

so after the trig identity, I have for [tex]a_{k}[/tex]:

[tex]a_{k}[/tex] = 1/[tex]\pi[/tex]*([tex]\int[/tex]cos(kx+x)dx+[tex]\int[/tex]cos(kx-x)dx) where we integrate from 0 to [tex]\pi[/tex]

now for each integral, I split it in two where we integrate
[tex]\int[/tex](cos(k[tex]\pm[/tex]1)x)dx) where this integral is evaluated from 0 to [tex]\pi[/tex]/2

then the next integral would be [tex]\int[/tex](-cos(k[tex]\pm[/tex]1)x)dx) from [tex]\pi[/tex]/2 to [tex]\pi[/tex].

I split it due to the function being |cosx|

so after integrating the four terms I get,
=(1/[tex]\pi[/tex])*(sin(k[tex]\pm[/tex]1)x/(k[tex]\pm[/tex]1) (evaluated from 0 to [tex]\pi[/tex]/2) + -sin(k[tex]\pm[/tex]1)x/(k[tex]\pm[/tex]1)) (evaluated from [tex]\pi[/tex]/2 to [tex]\pi[/tex])

after evaluating I get,
=(1/[tex]\pi[/tex])*(sin((k+1)*[tex]\pi[/tex]/2)/(k+1)+sin((k+1)*[tex]\pi[/tex]/2)/(k+1) + sin((k-1)*[tex]\pi[/tex]/2)/(k-1)+sin((k-1)*[tex]\pi[/tex]/2)/(k-1))

I simplified it because there are doubles and so:

[tex]a_{k}[/tex] = (2/[tex]\pi[/tex])*(sin((k+1)*[tex]\pi[/tex]/2)/(k+1)+ sin((k-1)*[tex]\pi[/tex]/2)/(k-1))

(I found a mistake I had made while writing my work down here :P...was (8/[tex]\pi[/tex]) before, but it's actually (2/[tex]\pi[/tex]))

so that's my work for [tex]a_{k}[/tex]

please let me know if that looks good? :P thanks so much!
 
  • #7
Yikes...what an eyesore!:yuck:

You need to work on your LaTeX a little. For starters, it's much easier to read if you write entire expressions in between a single set of tex tags. Also, you can use itex & /itex instead of tex & tex when you want an expression to occur on the same line as some written text and not look out of place. Click on the edited quote below to see the code used to make your last post readable:


jianxu said:
woops, here's my work:P

so after the trig identity, I have for [itex]a_{k}[/itex]:

[tex]a_{k} = \frac{1}{\pi} \left( \int_{0}^{\pi} \cos (kx+x) dx + \int_0^{\pi} \cos(kx-x) dx \right)[/tex]


now for each integral, I split it in two where we integrate

[tex]\int_{0}^{\pi /2} \cos (kx\pm x) dx[/tex]

then the next integral would be

[tex]\int_{\pi /2}^{\pi} -\cos (kx\pm x) dx[/tex]


I split it due to the function being |cosx|

Splitting up the integral into two intervals to deal with the absolute value is the right idea, but to correctly apply the idea you need to split it up before you use the trig identity:

[tex]a_k= \frac{1}{\pi} \int_{-\pi}^{\pi} |\cos{x}|\cos{kx} dx= \frac{2}{\pi} \int_{0}^{\pi} |\cos{x}|\cos{kx} dx =\frac{2}{\pi} \left( \int_0^{\pi/2} \cos{x}\cos{kx} dx - \int_{\pi/2}^{\pi} \cos{x}\cos{kx} dx \right)[/tex]

However, you seem to be doing it correctly in your head, because your separated integrals are correct.

so after integrating the four terms I get,

[tex]a_k= \frac{1}{\pi} \left( \left[ \frac{\sin ((k \pm 1)x)}{k \pm 1} \right]_0^{\pi/2} - \left[ \frac{\sin ((k \pm 1)x)}{k \pm 1} \right]_{\pi/2}^{\pi} \right) [/tex]

after evaluating I get,

[tex]a_k =\frac{1}{\pi} \left( \frac{\sin \left( \frac{(k+1)\pi}{2} \right)}{k+1} + \frac{\sin \left( \frac{(k+1)\pi}{2}\right)}{k+1} + \frac{\sin \left(\frac{(k-1)\pi}{2}\right)}{k-1}+\frac{\sin \left( \frac{(k-1)\pi}{2}\right)}{k-1} \right)[/tex]

I simplified it because there are doubles and so:

[tex]a_{k}=\frac{2}{\pi} \left( \frac{\sin \left( \frac{(k+1)\pi}{2} \right)}{k+1} +\frac{\sin \left( \frac{(k-1)\pi}{2}\right)}{k-1} \right)[/tex]

(I found a mistake I had made while writing my work down here :P...was [itex]\frac{8}{\pi}[/itex] before, but it's actually [itex]\frac{2}{\pi}[/itex])

so that's my work for [itex]a_{k}[/itex]

please let me know if that looks good? :P thanks so much!

This looks correct to me!:smile:

You can however simplify it a little more by putting each term over the common denominator [itex](k+1)(k-1)[/itex] and using the trig identity [itex]\sin (a \pm b) =\sin(a)\cos(b) \pm \cos(a)\sin(b)[/itex]

You should get something like

[tex]a_k=\frac{-4\cos\left( \frac{k\pi}{2}\right)}{(k^2-1)\pi}[/tex]

which is only non-zero for even values of [itex]k[/itex].
 
Last edited:
  • #8
Thanks! yea the quotient tag was giving me errors before for some reason...said like invalid image or something so I took all the quotient stuff out. Sorry for the poor post:(

Thanks again, tiny-tim and gabbagabbahey! :)
 

1. What is a Fourier series?

A Fourier series is a mathematical representation of a periodic function as a sum of sinusoidal functions. It is used to approximate complex functions by breaking them down into simpler components.

2. How do you find the coefficients of a Fourier series?

The coefficients of a Fourier series can be found by using the Fourier series formula, which involves integrating the product of the function and the basis functions (sin and cos) over one period of the function. This process is known as Fourier analysis.

3. What is the purpose of finding the coefficients of a Fourier series?

The coefficients of a Fourier series allow us to represent a complex function in terms of simpler components, which can make it easier to analyze and understand the behavior of the function. They also allow us to approximate a function with a finite number of terms, which is useful in many applications.

4. Can the coefficients of a Fourier series be negative?

Yes, the coefficients of a Fourier series can be both positive and negative. The sign of the coefficient indicates the amplitude and phase of the corresponding basis function in the series.

5. Do all functions have a Fourier series representation?

No, not all functions have a Fourier series representation. The function must be periodic and satisfy certain conditions in order to have a valid Fourier series. Additionally, some functions may have a Fourier series but it may not converge to the original function, making it an improper representation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
212
  • Calculus and Beyond Homework Help
Replies
3
Views
279
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
413
  • Calculus and Beyond Homework Help
Replies
1
Views
340
  • Calculus and Beyond Homework Help
Replies
5
Views
352
  • Calculus and Beyond Homework Help
Replies
1
Views
534
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
372
  • Calculus and Beyond Homework Help
Replies
16
Views
558
Back
Top