How to write sin(n*pi/2) as an expression (-1)^f(n)?

  • #1
zenterix
480
70
Homework Statement
While calculating the Fourier series of a function I reached the following expression (for one class of Fourier coefficients):
Relevant Equations
$$\frac{1}{n\pi}\sin{\left ( \frac{n\pi}{2} \right )}$$
I could summarize this as

##\frac{1}{n\pi}## for ##n=1, 5, 9, \ldots##

##\frac{-1}{n\pi}## for ##n=3, 7, 11, \ldots##

and ##0## for all other ##n##.

How would I go about writing this in a single expression, with ##(-1)^{f(n)}## where ##f(n)## summarizes both cases above?
 
Physics news on Phys.org
  • #2
zenterix said:
How would I go about writing this in a single expression, with ##(-1)^{f(n)}## where ##f(n)## summarizes both cases above?
You wouldn’t. ##(-1)^z \neq 0## for any ##z##.
 
  • #3
What you could use is the complex expansion of the sine to write
$$
\sin(n\pi/2) = \frac{e^{in\pi/2} - e^{-in\pi/2}}{2i}
= \frac{i^n - (-i)^n}{2i} = \frac 12 (i^{n-1} + (-i)^{n-1})
$$
 
  • Like
Likes PeroK
  • #4
Orodruin said:
You wouldn’t. ##(-1)^z \neq 0## for any ##z##.
Perhaps I phrased the question in a way that wasn't clear.

What I ultimately want to do is rewrite

$$\sum\limits_{n=1}^\infty \left (\frac{1}{n\pi} \sin{\left ( \frac{n\pi}{2} \right )}\right ) \cos{nx}$$

in a simpler way.

I was wondering if I could replace the ##\sin{\left ( \frac{n\pi}{2} \right )}## with a simpler expression.

The complex expansion does work, though I still wonder if there is not a simpler way.

I don't need to have ##(-1)^{f(n)}=0## for any ##n##. As long as ##f(n)## doesn't take on the values ##0,2,4,6,\ldots## then the summation would just skip the terms where ##\sin{\left ( \frac{n\pi}{2} \right )}=0##.

The problem is how to make ##(-1)^{f(n)}## alternate between ##1## and ##-1## as ##f(n)## traverses all odd numbers.
 
Last edited:
  • #5
zenterix said:
The problem is how to make ##(-1)^{f(n)}## alternate between ##1## and ##-1## as ##f(n)## traverses all odd numbers.
Normally, you use the sequence ##2n+1## or ##2n - 1## in the summand.
 
Last edited:
  • #6
For example, can we write ##f(n)=1+(2n+1\ \text{mod}\ 4)\ \text{mod}\ 3##?

Then

$$(-1)^{1+(2n+1\ \text{mod}\ 4) \text{mod}\ 3}$$

For ##n=0,1,2,\ldots##, we have

##2n+1=1,3,5,7,9,\ldots##

##2n+1\ \text{mod}\ 4= 1,3,1,3,1,3,\ldots##

##(2n+1\ \text{mod}\ 4)\ \text{mod}\ 3=1,0,1,0,1,0,\ldots##.

##1+(2n+1\ \text{mod}\ 4)\ \text{mod}\ 3=2,1,2,1,2,1,\ldots##.

I guess this isn't really simplifying anything, but it seems to work.
 
  • Sad
Likes PeroK
  • #7
[itex]\sin (n\pi/2)[/itex] vanishes for even [itex]n[/itex]. Thus you need only consider [tex]
\sum_{k=0}^\infty \frac{1}{(2k+1)\pi}\sin\left( \frac{(2k + 1)\pi}2 \right) = \sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)\pi}.[/tex]
 
  • Like
Likes FactChecker and zenterix
  • #8
If you sum only over odd numbers, note that this is equivalent to summing over ##k \in\mathbb N## with ##n = 2k + 1##. Consider how your expression depends on ##k##.
 
  • Like
Likes zenterix
  • #9
pasmith said:
[itex]\sin (n\pi/2)[/itex] vanishes for even [itex]n[/itex]. Thus you need only consider [tex]
\sum_{k=0}^\infty \frac{1}{(2k+1)\pi}\sin\left( \frac{(2k + 1)\pi}2 \right) = \sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)\pi}.[/tex]
This is indeed the solution I was looking for. It's actually simple I just missed it.
 

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
224
  • Calculus and Beyond Homework Help
Replies
16
Views
568
  • Calculus and Beyond Homework Help
Replies
1
Views
540
  • Calculus and Beyond Homework Help
Replies
1
Views
265
  • Calculus and Beyond Homework Help
Replies
6
Views
395
  • Calculus and Beyond Homework Help
Replies
3
Views
555
  • Calculus and Beyond Homework Help
Replies
3
Views
292
  • Calculus and Beyond Homework Help
Replies
1
Views
94
  • Calculus and Beyond Homework Help
Replies
7
Views
2K
  • Calculus and Beyond Homework Help
2
Replies
36
Views
3K
Back
Top