Possible Error in Calculating Fourier Series for sin2x?

In summary: So the "mistake" is in your expectation that the series should exactly reproduce the original function - that will only happen for a function that is a series of cosines or a series of sines, not one that is a mixture of the two.
  • #1
sarideli18
9
0

Homework Statement



Fx= sin2x for -pi<x<0 and 0 for 0<x<pi. Compute the coefficients of the Fourier series.

Homework Equations





The Attempt at a Solution



I found Ao=0 even though I came up with a Fourier cosine series. There must be something wrong. And is that possible that I come up with a Fourier cosine series which converges to sin2x?? Before I began doing the problem, I thought An will be equal to zero and Bn will be zero for n≠2 which is intuitively correct. So, anyone has any idea?
 
Physics news on Phys.org
  • #2
sarideli18 said:
Fx= sin2x for -pi<x<0 and 0 for 0<x<pi. Compute the coefficients of the Fourier series.
First thing to note is that this function is neither even nor odd. Therefore the Fourier series will contain both cosines and sines. You will not end up with a cosine series or a sine series.
I found Ao=0 even though I came up with a Fourier cosine series. There must be something wrong.
If you show your calculation for [itex]a_0[/itex], you will get feedback regarding what is wrong, if anything.
And is that possible that I come up with a Fourier cosine series which converges to sin2x??
Two things to note: first, your function is not simply sin(2x). It is only defined that way for [itex]-\pi < x < 0[/itex], not for [itex]0 < x < \pi[/itex]. Second, you will only end up with a cosine series if your function is even, which is not the case here.
Before I began doing the problem, I thought An will be equal to zero and Bn will be zero for n≠2 which is intuitively correct. So, anyone has any idea?
Your instinct is correct for the function sin(2x). However, once again, be careful: your function is NOT simply sin(2x).
 
  • #3
Well, for Ao;

Ao=1/2pi ∫sin2x dx (from -pi to 0)

When I do the integral, I get cos2x and cos0-cos2pi=0.

For Bn;

Bn=1/pi ∫sin2x sinnx dx (from -pi to 0)

When I do the integral, again I get 0. So, the only coefficient i have is An. So, the Fourier series of fx becomes fx~ƩAn cosnx which seems incorrect. I checked my algebra maybe 10 times but there is no mistake.
 
  • #4
sarideli18 said:
Well, for Ao;

Ao=1/2pi ∫sin2x dx (from -pi to 0)

When I do the integral, I get cos2x and cos0-cos2pi=0.
OK, that looks right.

For Bn;

Bn=1/pi ∫sin2x sinnx dx (from -pi to 0)

When I do the integral, again I get 0.
That is not true for every [itex]n[/itex]. For example, if [itex]n = 2[/itex] then the integrand is [itex]\sin^2(2x)[/itex], which certainly does not integrate to zero.
 
  • #5
jbunniii said:
OK, that looks right.


That is not true for every [itex]n[/itex]. For example, if [itex]n = 2[/itex] then the integrand is [itex]\sin^2(2x)[/itex], which certainly does not integrate to zero.

I did the integral for n=2 and I got Bn=1/2. I should have realized that since I had an n-2 in the denominator. Obviously what I found for n≠2 would not work for n=2. Thank you for that. However, for n=2, An=0 and since A0=0, I just have 1/2*sin2x which does not converge to sin2x. Is that because f(x)=sin2x for -pi<x<0 rather than -pi<x<pi or is the result incorrect?
 
  • #6
Show us your calculations for ##a_n##. You shouldn't be getting them all zero. Putting n=2 aside, the other a values come out every other one 0 and non-zero.
 
  • #7
LCKurtz said:
Show us your calculations for ##a_n##. You shouldn't be getting them all zero. Putting n=2 aside, the other a values come out every other one 0 and non-zero.

Well, yes you are right. An=4/π(n+2)(n-2) for n is odd and An=0 for n is even. However, upon plugging A0=0 A2=0, B2=1/2, and n=2 I have;

F(x) ~ A0 + ƩAncosnx + ƩBnsinnx

F(x) = 1/2 sin2x. But F(x) must be sin2x for -pi<x<0. I checked my algebra for An but could not find any mistake at all.
 
  • #8
sarideli18 said:
Well, yes you are right. An=4/π(n+2)(n-2) for n is odd and An=0 for n is even. However, upon plugging A0=0 A2=0, B2=1/2, and n=2 I have;

F(x) ~ A0 + ƩAncosnx + ƩBnsinnx

F(x) = 1/2 sin2x. But F(x) must be sin2x for -pi<x<0. I checked my algebra for An but could not find any mistake at all.

How do you know you have a mistake? Have you plotted the graph of your series with, say, 10 non-zero terms to see if it is beginning to look like F(x)?
 
  • #9
A slightly belated observation - A0 is the average value of F(x). Since the left-hand half of your function is a complete cycle of a sine wave and the right hand half is flat zero, the average value has to be zero - as your maths is also showing you.
 

1. What is a Fourier series of sin2x?

A Fourier series of sin2x is a mathematical representation of a periodic function, in this case the sine function with a period of 2π. It can be thought of as a sum of sine and cosine functions with different frequencies and amplitudes.

2. How is a Fourier series of sin2x calculated?

To calculate a Fourier series of sin2x, the function is first decomposed into its basic harmonic components using the Fourier series formula. This involves finding the coefficients for each sine and cosine term. These coefficients are then used to construct the final series.

3. Why is the Fourier series of sin2x important?

The Fourier series of sin2x is important because it allows us to approximate any periodic function using a combination of simpler trigonometric functions. This is useful in many fields of science and engineering, such as signal processing, image analysis, and quantum mechanics.

4. Can a Fourier series of sin2x be used for non-periodic functions?

No, a Fourier series of sin2x can only be used for periodic functions. If a function is non-periodic, its Fourier series will have infinitely many terms and will not converge to the original function.

5. How accurate is a Fourier series of sin2x?

The accuracy of a Fourier series of sin2x depends on the number of terms used in the series. The more terms that are included, the closer the approximation will be to the original function. However, for some functions, an infinite number of terms may be required for a perfect representation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
279
  • Calculus and Beyond Homework Help
Replies
3
Views
362
  • Calculus and Beyond Homework Help
Replies
1
Views
243
  • Calculus and Beyond Homework Help
Replies
5
Views
352
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
16
Views
559
  • Calculus and Beyond Homework Help
Replies
6
Views
912
  • Calculus and Beyond Homework Help
Replies
1
Views
534
  • Calculus and Beyond Homework Help
Replies
1
Views
340
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
Back
Top