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

In summary, the expression sin(n*pi/2) can be represented as (-1)^f(n) by defining f(n) based on the value of n modulo 4. Specifically, f(n) can be defined as follows: f(n) = 0 when n mod 4 = 0, f(n) = 1 when n mod 4 = 1, f(n) = 2 when n mod 4 = 2, and f(n) = 3 when n mod 4 = 3. This results in the values of sin(n*pi/2) being 0, 1, 0, and -1 respectively, aligning with the pattern generated by (-1)^f(n).
  • #1
zenterix
703
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
  • #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.
 

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

What is the general form of sin(n*pi/2)?

The general form of sin(n*pi/2) is a periodic function that takes on values from the set {0, 1, 0, -1} depending on the integer value of n. Specifically, sin(n*pi/2) = 0 when n is even, sin(n*pi/2) = 1 when n = 1 mod 4, and sin(n*pi/2) = -1 when n = 3 mod 4.

How can I express sin(n*pi/2) using (-1)^f(n)?

To express sin(n*pi/2) using (-1)^f(n), you need to identify a function f(n) that correctly maps the values of n to the corresponding powers of (-1). One possible function is f(n) = (n-1)/2 when n is odd and f(n) = (n/2) + 1 when n is even.

Why is it useful to write sin(n*pi/2) as (-1)^f(n)?

Writing sin(n*pi/2) as (-1)^f(n) can simplify certain mathematical manipulations and proofs, especially in discrete mathematics and signal processing. It provides a compact and elegant way to represent the periodicity and sign changes of the sine function at specific intervals.

What are the steps to derive the function f(n) for sin(n*pi/2)?

To derive the function f(n) for sin(n*pi/2), you can analyze the behavior of sin(n*pi/2) for different values of n:1. For n = 4k, sin(n*pi/2) = 0.2. For n = 4k + 1, sin(n*pi/2) = 1.3. For n = 4k + 2, sin(n*pi/2) = 0.4. For n = 4k + 3, sin(n*pi/2) = -1.By identifying these patterns, you can construct a piecewise function f(n) that maps n to the appropriate power of (-1).

Are there any alternative ways to express sin(n*pi/2) using exponents?

Yes, there are alternative ways to express sin(n*pi/2) using exponents. One common method is to use Euler's formula, which relates trigonometric functions to complex exponentials. However, for the specific case of expressing sin(n*pi/2) as (-1)^f(n), the piecewise function approach is more straightforward and directly captures the periodic nature of the sine function at these intervals.

Similar threads

Replies
16
Views
1K
Replies
1
Views
1K
Replies
1
Views
1K
Replies
6
Views
991
Replies
7
Views
3K
Back
Top