So, the real question is:Can (1-cos(npi))=(-1)^(n+1)?

  • Thread starter RUrubee2
  • Start date
Thanks for pointing that out to me.In summary, the process for finding the Fourier series for a given function involves finding the coefficients a_n and b_n using the formulas a_0/2 and (2/n^2pi^2)(cos(npi/2)-1) for a_n and (2/n^2pi^2)(sin(npi/2)+(npi/2)*(-1)^(n+1)) for b_n. These coefficients are then used in the formula f(x)=a_0/2+Ʃ(from n=0 to ∞) (a_n*cos(npix/p) + b_n*sin(npix/p)) to obtain the Fourier series for the given function. It is important to
  • #1
RUrubee2
5
0

Homework Statement



To find the Fourier series for

f(x)=
0, -2<x<0
x, 0≤x<1
1, 1≤x<2

Homework Equations



f(x)=a_0/2+Ʃ(from n=0 to ∞) (a_n*cos(npix/p) + b_n*sin(npix/p))

The Attempt at a Solution



So p=2, interval=[-2,2]

a_0=3/4,

a_n=(2/n^2pi^2)*(cos(npi/2)-1),

Here is my problem:

did the exercise twice and keep getting:

b_n=(2/n^2pi^2)(sin(npi/2)+(npi/2)*(1-cos(npi))

I have the solution:

b_n=(2/n^2pi^2)(sin(npi/2)+(npi/2)*(-1)^(n+1))

I know cos(npi)=(-1)^n

and I've been told sin(npi)=(-1)^(n+1)

My steps:

1) b_n=1/2[∫(from 0 to 1) x*sin(npix/2)dx + ∫(from 1 to 2) sin(npix/2)dx]

2) integration by parts for 1st integral and subsequent integration:

→ b_n=1/2[-(2x/npi)cos(npix/2)|(0 to 1) + (4/n^2pi^2)sin(npix/2)|(0 to 1) - (2/npi)cos(npix/2)|(1 to 2)]

3) I am left with:

b_n=1/2[(2/npi) + (4/n^2pi^2)sin(npi/2) - (2/npi)cos(npi)

after regrouping is where (1-cos(npi)) comes from.

Thus original question is:

Can (1-cosnpi)=(-1)^(n+1)? or am I mistaken somewhere?

Thank you
 
Last edited:
Physics news on Phys.org
  • #2
I don't know where you got "[itex]sin(n\pi)= (-1)^{n+1}= 1- cos(n\pi)[/itex]". None of those equalities is correct.

[itex]sin(n\pi)= 0[/itex] for all n, not a power of -1. [itex]cos(n\pi)= -1[/itex] if n is odd, 1 if n is even so [itex]cos(n\pi)= (-1)^n[/itex] and [itex]1+ cos(n\pi)[/itex] is 2 if n is even, 0 if n is odd.
 
  • #3
As I said, I "know cos(npi)=(-1)^n and I was told sin(npi)=(-1)^(n+1)" so I believe you that it is wrong. I imagine that that someone wanted to say sin(npi/2)=(-1)^(n+1)?

As for the "equalities", I was wondering, not stating, seeing as the equations "looked" similar.

Therefore, if all this is wrong, would it be possible for you to help me figure out where I went wrong?

I think it safe to say I will remove that "P.S." from the question so as not to confuse...
 
Last edited:
  • #4
RUrubee2 said:
I imagine that that someone wanted to say sin(npi/2)=(-1)^(n+1)?

Why would you imagine that? Try it with n = 0 or 2.
 
  • #5
RUrubee2 said:

Homework Statement



To find the Fourier series for

f(x)=
0, -2<x<0
x, 0≤x<1
1, 1≤x<2

Homework Equations



f(x)=a_0/2+Ʃ(from n=0 to ∞) (a_n*cos(npix/p) + b_n*sin(npix/p))

The Attempt at a Solution



So p=2, interval=[-2,2]

a_0=3/4,

a_n=(2/n^2pi^2)*(cos(npi/2)-1),

Your an is correct but I think your a0 should be -5/4.
Here is my problem:

did the exercise twice and keep getting:

b_n=(2/n^2pi^2)(sin(npi/2)+(npi/2)*(1-cos(npi))

I have the solution:

b_n=(2/n^2pi^2)(sin(npi/2)+(npi/2)*(-1)^(n+1))

I know cos(npi)=(-1)^n

and I've been told sin(npi)=(-1)^(n+1)

My steps:

1) b_n=1/2[∫(from 0 to 1) x*sin(npix/2)dx + ∫(from 1 to 2) sin(npix/2)dx]

I didn't check your remaining steps, but what about the integral from -2 to 0?
 
Last edited:
  • #6
The reason I "imagine" that is because I had some sort of logic in my head that said that if
sin(npi/2)=something, when n is an odd number than n+1 was going to give me an odd number...
I see as I try to explain that it doesn't always work. But I had "sin(npi)=(-1)^(n+1) in my class notes which is a mistake and probably didn't help my understanding...

The thing is that in my school book. It keeps telling me things like "=(-1)^(n+1).
And a similar problem to my initial question just popped up again:

Expand f(x)=x, -2<x<2
x = Odd f(x)
Thus
b_n = ∫ (0 to 2) x*sin(npix/2)dx

When I do this, I get (-4/npi)cos(npi)

and it gives me (4/npi)(-1)^(n+1)

as in original post, I was getting: (1-cos(npi)) and the answer was (-1)^(n+1)

So is it when there is a negative in front that I have to do ^(n+1)?

Could someone please respond to the actual question about where (-1)^(N+1) comes from...
 
Last edited:
  • #7
@ LCKurtz
The answer in the book is 3/8 for a_0/2
And the -2 to 0 disappears 'cause the function is 0 on that interval
P.S. Thank you for trying to help me with the real question
 
  • #8
RUrubee2 said:
When I do this, I get (-4/npi)cos(npi)

and it gives me (4/npi)(-1)^(n+1)
This is right.

as in original post, I was getting: (1-cos(npi)) and the answer was (-1)^(n+1)
This is wrong. You're making another error somewhere, which is causing you to mistakenly think that [itex]1-\cos n\pi = (-1)^{n+1}[/itex] must hold. You need to turn this around. The latter equality is obviously wrong, which means you must have made a mistake somewhere, so you should be looking for it.

So is it when there is a negative in front that I have to do ^(n+1)?

Could someone please respond to the actual question about where (-1)^(N+1) comes from...
It seems a bit strange that you're struggling with basic algebra when you're learning about Fourier series. There's nothing mysterious going on here:
[tex]-(-1)^n = (-1)(-1)^n = (-1)^{n+1}[/tex]
 
  • #9
My brain works in VERY mysterious ways, but thank you. That does clear things up.
I am working hard on trying to figure out where my mistake is.
I get confused when sometimes the answer is (-1)^(n+1)
and in other cases like:

b_n=(2/pi)∫(0 to pi)sin(nx)dx

I get (2/npi)(1-cos(npi))and the answer in that case is (2/pi)(1-(-1)^n)/n

instead of (2/pi)(1+(-1)^(n+1))/n
 
Last edited:
  • #10
RUrubee2 said:
@ LCKurtz
The answer in the book is 3/8 for a_0/2
And the -2 to 0 disappears 'cause the function is 0 on that interval
P.S. Thank you for trying to help me with the real question

For some reason I had written the function as -2 on that interval. Guess my eyeball fell on the -2 instead of the 0.
 

Related to So, the real question is:Can (1-cos(npi))=(-1)^(n+1)?

1. Is the given equation always true?

Yes, the given equation is always true for all values of n, as long as n is a positive integer.

2. What does the expression (-1)^(n+1) represent?

The expression (-1)^(n+1) is an alternating sequence that represents the sign of the term in the equation. When n is an odd number, the expression evaluates to -1, and when n is an even number, it evaluates to 1.

3. Why is (-1)^(n+1) used in the equation?

The expression (-1)^(n+1) is used because it helps to make the equation an identity. This means that the equation is true for all values of n, making it a more powerful and useful mathematical statement.

4. Can the equation be simplified?

Yes, the equation can be simplified to 1 when n is an even number, and to 2 when n is an odd number. This is because when n is an even number, cos(npi) is equal to 1, while when n is an odd number, cos(npi) is equal to -1.

5. What are the applications of this equation in science?

This equation has various applications in science, particularly in fields such as physics and engineering. It is used in wave analysis, signal processing, and in solving problems involving periodic motion. It also has applications in quantum mechanics and electrical engineering.

Similar threads

  • Calculus and Beyond Homework Help
Replies
6
Views
608
  • Calculus and Beyond Homework Help
Replies
16
Views
824
  • Calculus and Beyond Homework Help
Replies
2
Views
999
  • Calculus and Beyond Homework Help
Replies
1
Views
431
  • Calculus and Beyond Homework Help
Replies
1
Views
559
  • Calculus and Beyond Homework Help
Replies
1
Views
663
  • Calculus and Beyond Homework Help
Replies
1
Views
564
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
680
Back
Top