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

Click For Summary
SUMMARY

The discussion focuses on expressing the sine function, specifically sin(nπ/2), using the notation (-1)^{f(n)}. The key findings include that sin(nπ/2) equals 1 for n=1, 5, 9, ..., -1 for n=3, 7, 11, ..., and 0 for all other n. The proposed function f(n) = 1 + (2n + 1 mod 4) mod 3 effectively alternates the values of (-1)^{f(n)} between 1 and -1 for odd n. The final expression simplifies to summing over odd integers, leading to the conclusion that the series converges to a specific form involving (-1)^k.

PREREQUISITES
  • Understanding of trigonometric functions, specifically sine.
  • Familiarity with series and summation notation.
  • Knowledge of modular arithmetic and its applications in sequences.
  • Basic concepts of complex numbers and their exponential forms.
NEXT STEPS
  • Explore the properties of sine functions and their periodicity.
  • Learn about series convergence and divergence, particularly in trigonometric series.
  • Study modular arithmetic in-depth, especially its role in sequence generation.
  • Investigate complex analysis, focusing on Euler's formula and its applications in trigonometric identities.
USEFUL FOR

Mathematicians, students studying calculus or complex analysis, and anyone interested in series and trigonometric function transformations.

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