Solving the coefficients of fourier series

Click For Summary

Homework Help Overview

The discussion revolves around finding the Fourier series for the function f(x) = |cos x| over the interval from -π to π. The original poster aims to derive the Fourier series coefficients and verify that they match a given series expression.

Discussion Character

  • Exploratory, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • The original poster attempts to calculate the Fourier coefficients a₀ and aₖ, noting that bₖ equals zero due to the properties of even and odd functions. They express uncertainty about the integration process for aₖ and seek confirmation on their approach.
  • Some participants suggest using trigonometric identities to simplify the integration of cos(x)cos(kx), while others provide feedback on the clarity of the original poster's work and suggest improvements in notation.
  • There are discussions about splitting the integral to handle the absolute value of cos(x) and ensuring the correct application of trigonometric identities.

Discussion Status

The conversation is ongoing, with participants providing guidance on integration techniques and notation. The original poster has made progress in their calculations and is actively seeking validation of their results. There is no explicit consensus yet, but some participants indicate that the original poster is on the right track.

Contextual Notes

Participants are working within the constraints of homework rules, focusing on deriving the Fourier series without providing complete solutions. There is an emphasis on understanding the properties of even functions and the correct application of integration techniques.

jianxu
Messages
91
Reaction score
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
Last edited by a moderator:
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
 
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.
 
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!
 
Yikes...what an eyesore!

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:
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! :)
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K