How do I represent this sine function?

Just a clever way to write a complicated function. It's a funny thing how some people think that writing a function in terms of exponentials is "simpler" than writing it in terms of sines and cosines. I think it's just a matter of familiarity.
  • #1
eprparadox
138
2
I was struggling to represent the following for integer values of n:

[tex]
\sin \left( \dfrac {n\pi } {2}\right)
[/tex]

I know for even n, we get zero

But for odd n, it alternates beween 1 and -1 for every other odd. Is there a compact way to represent that? I feel like I'm being dumb and missing something obvious.

Thanks!
 
Mathematics news on Phys.org
  • #2
eprparadox said:
I was struggling to represent the following for integer values of n:

[tex]
\sin \left( \dfrac {n\pi } {2}\right)
[/tex]

But for odd n, it alternates beween 1 and -1 for every other odd. Is there a compact way to represent that? I feel like I'm being dumb and missing something obvious.

Thanks!
1 when n = 1 + 2x
-1 when n = 3 + 2x

where x is zero or a positive even integer
 
  • #3
What you have is a piecewise function (the variable being n in this case).

[tex]k\in \mathbb{Z} \\ f(n) = \sin{\frac{\pi n}{2}} = \left\{
\begin{array}{lr}
0 & : n=2k\\
1 & : n=4k+1\\
-1 & : n=4k+3
\end{array}
\right.[/tex]
 
  • #4
I guess you are looking for something similar to ##\cos(n\pi) = (-1)^n## for ##\sin(\frac{n\pi} 2)##. You may be able to find such an expression, but I don't think you will find anything "simpler" than ##\sin(\frac{n\pi} 2)## itself, unless you consider piecewise defined functions simpler. I don't.
 
  • #5
Thank you so much for the responses everyone!
 
  • #6
I gave it a little more thought and came up with
[tex]\sin\left(\frac{n\pi}{2}\right)=\frac{1}{2}\left(-1\right)^{\frac{n-1}{2}}\left(1-(-1)^n\right)[/tex]
 
  • #7
How about
$$\sin\left(\frac{n\pi}{2}\right) = \frac{1}{2i}\left(i^n - (-i)^n\right) = \frac{1}{2}\left(i^{n-1} + (-i)^{n-1}\right)$$

[edit]: I guess that's equivalent to Mentallic's answer. Here's how I obtained it:

$$\begin{aligned}
\sin\left(\frac{n\pi}{2}\right) &= \text{Im}\left(e^{in\pi/2}\right) \\
&= \frac{1}{2i} \left(e^{in\pi/2} - \overline{e^{in\pi/2}}\right) \\
&= \frac{1}{2i} \left(i^n - \overline{i^n}\right) \\
&= \frac{1}{2i} \left(i^n - (-i)^n\right) \\
\end{aligned}$$
 
Last edited:
  • #8
Yup. As I thought. Nothing "simpler" than ##\sin\frac{n\pi} 2## itself.
 

Related to How do I represent this sine function?

1. How do I plot a sine function?

To plot a sine function, you will need to first choose a range of values for the x-axis. Then, use the equation y = sin(x) to calculate the corresponding y-values. Plot these points on a graph and connect them to create a smooth curve.

2. How do I determine the amplitude of a sine function?

The amplitude of a sine function is the distance from the center line to the top or bottom of the curve. It can be calculated by taking half of the distance between the maximum and minimum values of the function.

3. How do I find the period of a sine function?

The period of a sine function is the length of one complete cycle of the curve. It can be calculated by dividing 2π (the length of a full circle) by the coefficient of x in the equation y = sin(x).

4. How do I represent a phase shift in a sine function?

A phase shift in a sine function is represented by adding or subtracting a value inside the sin function. For example, y = sin(x + π/2) would have a phase shift of π/2 to the left, while y = sin(x - π/4) would have a phase shift of π/4 to the right.

5. How do I use a sine function to model real-world data?

To use a sine function to model real-world data, you will need to first identify the variables that will represent the x and y axes. Then, adjust the amplitude, period, and phase shift of the function to fit the data points as closely as possible. This will help you make predictions and analyze patterns in the data.

Similar threads

Replies
7
Views
2K
Replies
4
Views
512
Replies
2
Views
707
  • General Math
Replies
8
Views
5K
  • General Math
Replies
6
Views
1K
  • General Math
Replies
3
Views
900
Replies
5
Views
870
Replies
2
Views
3K
Back
Top