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

Click For Summary

Homework Help Overview

The discussion revolves around expressing the sine function, specifically sin(nπ/2), in a simplified form using the expression (-1)^{f(n)}. Participants explore how to represent the behavior of the sine function for different values of n, particularly focusing on odd and even integers.

Discussion Character

  • Exploratory, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss various ways to express sin(nπ/2) in terms of (-1)^{f(n)} and question the feasibility of such representations. Some suggest using complex expansions, while others consider the implications of the sine function's behavior for even and odd n.

Discussion Status

The conversation includes multiple interpretations of how to simplify the expression. Some participants have proposed specific forms for f(n) that could achieve the desired alternation between values, while others have pointed out the need to focus only on odd integers in the summation.

Contextual Notes

There is an emphasis on the requirement that f(n) should not yield even values, as this would lead to terms where sin(nπ/2) equals zero. The discussion also reflects on the constraints of the original problem and the need for clarity in the expression being sought.

zenterix
Messages
774
Reaction score
84
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
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##.
 
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   Reactions: PeroK
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:
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:
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   Reactions: PeroK
\sin (n\pi/2) vanishes for even n. Thus you need only consider <br /> \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}.
 
  • Like
Likes   Reactions: FactChecker and zenterix
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   Reactions: zenterix
pasmith said:
\sin (n\pi/2) vanishes for even n. Thus you need only consider <br /> \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}.
This is indeed the solution I was looking for. It's actually simple I just missed it.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 22 ·
Replies
22
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K