Sine Function Exploration
by Paul Wittmer, Jr
November,  1997

Final Project for  Math 351 Module #3 Using      	          Mathematica in Mathematics Instruction  
a Math Teacher Link Graduate Credit Course Module Program
The Division of Extramural Programs
University of Illinois at Urbana-Champaign

Introduction
"Sine Function Exploration"
using graphics and sound capabilities  for an introduction to functions dealing with  sin( )

Sine Function Exploration can be used to provide advanced students  a course component or it can provide a first exposure to trigonometry.

Sound and waves

Plots variations that accompany the play command produce simulataneous  visual and graphic output.  Tones  are used in many output sections of this notebook.  Here a sample tone is set up.  Try it but be patient your machine may take several moments to produce the audio.  Observe the plots that accompany the tone.

\(tone = Sin[2  π \((440  x)\)]\ ; 
Play[tone, {x, 0, π}]\)

Note that the tone was 440 hertz (cycles per second) and it is played over a time interval that corresponds to the interval   0 to π.  The number of cycles plotted in such a short span makes it difficult to show students that this is really  a sine wave.  A reduced  play interval plot helps the visual but limits the audio.  Below you can see three cycles however you will not hear much because the tone is not sustained long enough for the human ear to preceive it as a tone.

\(\(\ tone = Sin[2  π \((440  x)\)]\ ; 

    Play[tone, {x, 0, 3\/440}]\)\)

Sound is a series of pressure variations traveling through the air  when preceived by the human ear.   Sounds are most often a series of repeated pressure variation sets produced at regular intervals of time.  This notebook begins by allowing students to see hear and manipulate  periodic  "sine"  functions using the mathematica  "play"  command.

Contents            hyper linked to each section

review of trigonometry :     Cos (x)  Sin (x)amplitude :       a Sin (x)sin(x) multiplied by x or (x^a):      (x^a) Sin (x)sine function changes with (1/(x^a)):      Sin ((1/(x^a)))frequency :      Sin (b x )phase shift,  
      period and geometric 
        translations :   
          Sin (x  +  p)   and   c  +  Sin (x)Sine on 
        Sine :          
          Sin (cx)  +  Sin (dx)     Sin (ax) multiplied by Sin (bx)

review of trigonometry:    Cos(x)  Sin (x)

Notes for advanced students :
A trigonometric function is a relation that has an inverse which also  is a relation.  Sine is one of many trigonometric functions.   Sine   has the inverse relation called    arc sine.    Arc sine is also written   (sin^(-1))(  )  and sine is written sin (  ).
The  sine function  applied to an angle called x  in Sin(x) will yield the y value related to that angle.
The inverse sine function   applied to a y value  -1≤y≤1   (sin^(-1))(y)    will yield the angle related to that y value.

Y values typically range from  -1 to  +1 .   One, unity,  "# 1"  the basic unit is easy to deal with.   Now review your understanding of sine based on a unit radius sphere and triangles formed by two radii.  Then introduce graphs of the sine function looking like waves from the initial spherical triangle relations.

ParametricPlot[{Cos[θ], Sin[θ]}, {θ, 
        -π, π}, AspectRatio -> Automatic, 
      PlotLabel -> "The Unit Circle"]

X, Y  coordinates of any point on the circle can be restated as    ( Cos[θ], Sin[θ] )      
Please note that Mathematica uses radian measure for the angle  θ .

{ Cos[(1/2) π], Sin[(1/2) π]}

X=0 and Y=1  when the angle is (1/2)π   Try several constant values to see  the ( X, Y ) coordinate relation.
Key in a value inside the [  ] part of the xyCoord[  ] function below.

xyCoord[a_] := {Cos[a*π], Sin[a*π]}

xyCoord[-1/2 ]

Spherical trigonometry based on the unit sphere can give us X, Y, Z coordinates.

\(\(\ \ 
    ParametricPlot3D[

      \ \ \ \ \ \ \ \ {Cos[θ]\ Cos[ϕ], \ 
        Sin[θ]\ Cos[ϕ], \ Sin[ϕ]}, 

      \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {θ, \ 0, \ 2  π}, 
      \ {ϕ, \(-π\)\/2\ , π\/2}]\)\)

Above is the unit sphere.    Any point on the sphere can be indicated by an ( X, Y, Z ) coordinat each coordinate is related to ( Cos[θ], Sin[θ], Sin[ϕ] ).   Try several constant values to see  the ( X, Y, Z ) coordinate relation.
Key in two values inside the [  ,  ] part of the xyzCoord[  ,  ] function below.

xyzCoord[a_, b_] := {Cos[a*π], Sin[a*π], Sin[b*π]}

xyzCoord[  .25  , - .25  ]

p1 = {0, 0, 1}p2 = {1, 0, 0}p3 = {0, 1, 0}p4 = {0, -1, 0}p5 = {-1, 0, 0}p6 = {0, 0, -1}

Show[
      Graphics3D[{Polygon[{p1, p3, p2}], Polygon[{p1, p4, p2}], 
          Polygon[{p1, p5, p3}], Polygon[{p1, p5, p4}], 
          Polygon[{p6, p3, p2}], Polygon[{p6, p4, p2}], 
          Polygon[{p6, p5, p3}], Polygon[{p6, p5, p4}]}]]

Above the points that generate an octahedron, one of the platonic solids, are given in  X,Y,Z  coordinates.  Use  { Cos[  ],Sin[  ],Sin[  ] } to restate the same points and make your own plot below.	   Hint    ArcCos[  ]    and  ArcSin[  ]  will return the inverse value.

ArcCos[-1 ]

p1 = {Cos[ (π/2) ], Sin[ 0 ], Sin[ (π/2)]}           p2 = {Cos[ 0 ], Sin[ 0 ], Sin[0]}           p3 = {Cos[ (π/2) ], Sin[(π/2)], Sin[0 ]}           p4 = {Cos[(π/2) ], Sin[-((π/2))], Sin[ 0 ]}           p5 = {Cos[π], Sin[ 0 ], Sin[ 0 ]}           p6 = {Cos[ (π/2) ], Sin[ 0 ], Sin[-((π/2))]}

Show[
      Graphics3D[{Polygon[{p1, p3, p2}], Polygon[{p1, p4, p2}], 
          Polygon[{p1, p5, p3}], Polygon[{p1, p5, p4}], 
          Polygon[{p6, p3, p2}], Polygon[{p6, p4, p2}], 
          Polygon[{p6, p5, p3}], Polygon[{p6, p5, p4}]}]]

Where are the waves ?          Plots of  Sin(x)
The motion of a tuning fork as it vibrates can be shown as a sine wave.

Plot[Sin[x], {x, 0, 6  π}]

Volume is shown by mathematica as a filled aera between the ± sine curves.        + Sin(x)    and   - Sin(x)

Plot[{Sin[x]*Sin[2764  x], -Sin[x]*Sin[2764  x]}, {x, 0, 
        6  π}]

Play[Sin[x]*Sin[2764  x], {x, 0, 6  π}]

Please note that the play command plots show the ±Sin(x) curves filled with the tone produced by Sin[2764x].  
You can hear the sine function as changes in volume.

amplitude:      a Sin (x)

Amplitude:   the Y value change in a sine wave.

Key in different values for the constant within the brackets for the function A[  ] and observe the effect.  This is called amplitude.

Clear[A, c] A[c_] := 
      Plot[c*Sin[x], {x, -π, π}, AspectRatio -> Automatic]

A[6]

Great now you have seen what happens when sin(x) is multiplied by a constant.
What happens if the sin (x)  function is multiplied by x or (x^c)   ?
Try some more constant values in the following cells.

Const[c_] := 
      Plot[c*Sin[x], {x, -π, π}, AspectRatio -> Automatic]

Key in a number within the [  ]  below.  Then run the cell.

Const[ 22 ]

The following cells turn down the volume to a constant.  Watch and hear the amplitude.

Plot[(1 - (x - Abs[x])), {x, -3 π, 3  π}]

Play[{(1 - (x - Abs[x]))*Sin[2000  x]}, {x, -3 π, 
        3  π}]

sin(x) multiplied by x or (x^a):      (x^a) Sin (x)

p1 = Plot[x, {x, -π, π}, PlotStyle -> RGBColor[1, 0, 0]]

p2 = Plot[-x, {x, -π, π}, PlotStyle -> RGBColor[0, 0, 1]]

s1 = Show[p1, p2]

Plot[x*Sin[x], {x, -20 π, 20  π}]

Play[{x*Sin[2000  x]}, {x, -π, π}]

Now describe what multiplying  "sine"  by   X  does.

p3 = 
      Plot[(x^2), {x, -π, π}, PlotRange -> {-10, 10}, 
        PlotStyle -> RGBColor[1, 0, 0]]

p4 = 
      Plot[-(x^2), {x, -π, π}, PlotRange -> {-10, 10}, 
        PlotStyle -> RGBColor[0, 0, 1]]

s2 = Show[p3, p4]

Plot[(x^2)*Sin[x], {x, -30 π, 30  π}]

Play[(x^2)*Sin[2000  x], {x, -π, π}]

Change the exponent to see and hear how the function is modified.  Find out what happens.  Key in a number in the [    ]  section of the function f[   ].

f[a_] := Play[(x^a)*Sin[2000  x], {x, -π, π}]

f[6]

Now describe what multiplying  "sine"  by   X raised to a power  does.
Compair this to "sine" multiplied by a constant.

Great now you have seen what happens when sin(x) in multiplied by x to a powe.
Review what happens if the sin (x)  function is multiplied by a constant ?
Try some constant values in the following cells.

Const[c_] := 
      Plot[c*Sin[x], {x, -π, π}, AspectRatio -> Automatic]

Key in a number within the [  ]  below.  Then run the cell.

Const[ 22 ]

sine function changes with (1/(x^a)):      Sin ((1/(x^a)))

p5 = 
      Plot[(1/x), {x, -π, π}, PlotRange -> {-2, 2}, 
        PlotStyle -> RGBColor[1, 0, 0]]

p6 =  
      Plot[(1/(-x)), {x, -π, π}, PlotRange -> {-2, 2}, 
        PlotStyle -> RGBColor[0, 0, 1]]

s3 = Show[p5, p6]

Play[{(1/x)*Sin[2000  x]}, {x, -π, π}]

p7 = 
      Plot[(1/(x^2)), {x, -π, π}, PlotRange -> {-3, 3}, 
        PlotStyle -> RGBColor[1, 0, 0]]

p8 = 
      Plot[(1/(-(x^2))), {x, -π, π}, PlotRange -> {-3, 3}, 
        PlotStyle -> RGBColor[0, 0, 1]]

s4 = Show[p7, p8]

Play[(1/(x^2))*Sin[2000  x], {x, -π, π}]

Change the exponent to see and hear how the function is modified.  Find out what happens.  Key in a number inside the  [   ]  section of the function g[  ].

g[a_] := Play[(1/(x^a))*Sin[2000  x], {x, -π, π}]

g[4]

Now describe what multiplying  "sine"  by   (1/(x^n))   does.
Compair this to "sine" multiplied by  (x^n)  and by a  constant.

frequency:     Sin (b x )

p9 = 
      Plot[Sin[x], {x, 0, π}, PlotRange -> {-1, 1}, 
        PlotStyle -> RGBColor[1, 0, 0]]

p10 = 
      Plot[-Sin[x], {x, 0, π}, PlotRange -> {-1, 1}, 
        PlotStyle -> RGBColor[0, 0, 1]]

s5 = Show[p9, p10]

Play[{Sin[x]*Sin[2000  x]}, {x, 0, π}]

p11 = 
      Plot[Sin[2  x], {x, 0, π}, PlotRange -> {-1, 1}, 
        PlotStyle -> RGBColor[1, 0, 0]]

p12 = 
      Plot[-Sin[2  x], {x, 0, π}, PlotRange -> {-1, 1}, 
        PlotStyle -> RGBColor[0, 0, 1]]

s6 = Show[p11, p12]

Play[{Sin[2  x]*Sin[2000  x]}, {x, 0, π}]

Change the constant  "b"  to see and hear how the function is modified.  Find out what happens.  Key in a number in the [    ]  section of the function h(  ).   Listen to the frequency.

h[a_] := Play[{Sin[a*x]*Sin[2000  x]}, {x, 0, π}]

h[23]

Describe the effect caused by multiplication by a constant within the (  ) of a sine function.

p13 = 
      Plot[{Sin[(2^x)], -Sin[(2^x)]}, {x, 0, 7}, 
        PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 0, 1]}]

Play[{Sin[(2^x)]*Sin[2000  x]}, {x, 0, 7}]

Take a look at what the sound plot reveals about numbers.  When the same variation is played for a longer duration a similar pattern emerges.   You can hear it better than a traditional sound curve plot reveals it.   Will there be more of these similar patterns if the range is incrased even more ?

Plot[{Sin[(2^x)], -Sin[(2^x)]}, {x, 0, 20}, 
      PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 0, 1]}]

Play[{Sin[(2^x)]*Sin[2000  x]}, {x, 0, 20}]

Try substituting in different values for the numbers indicated in red.

Play[{Sin[(2^x)]*Sin[2000  x]},{x,0,20}]

phase shift, period and geometric translations:
Sin (x + p)     and     c + Sin (x)

This is an example of adding a constant inside  of the ( )  sucn as  sin(x+3 ).

t1 = 
      Plot[Sin[x], {x, -π, π}, 
        PlotStyle -> {RGBColor[1, 0, 0], Thickness[ .02]}, 
        DisplayFunction -> Identity]  t2 = 
      Plot[Sin[x + (2  π)/3], {x, -π, π}, 
        PlotStyle -> {RGBColor[0, 0, 1], Thickness[ .02]}, 
        DisplayFunction -> Identity]t3 = 
      Plot[Sin[x + (4  π)/3 ], {x, -π, π}, 
        PlotStyle -> {RGBColor[0, 1, 0], Thickness[ .02]}, 
        DisplayFunction -> Identity] Show[GraphicsArray[{t1, t2, t3}], DisplayFunction -> $DisplayFunction]
      Show[t1, t2, t3, DisplayFunction -> $DisplayFunction]

Note the x values where each crosses the axis.    The red wave is sin(x + 0).  The green wave is sin (x + p).  The red wave is sin (x + 2p).    p = (2/3)π

How much of a phase shift "p" would be required to make one sine wave overlay  another ? 
The smallest interval is called the period.   Use the P[  ] function with various values to test your answer.

P[p_] := 
      Plot[{Sin[x], Sin[p + x]}, {x, -2 π, 2  π}, 
        PlotStyle -> {RGBColor[0, 0, 1], RGBColor[1, 0, 0]}]

P[6]

This is interesting.  (x + p) inside the  ( ) of  sine did not translate the function.  It produced a phase shift.  When combined we have a form that resembles three phase electrical power.      
Let's see what happens when the constant is added outside of the ( )  such as sin(x) + 3.

t1 = 
      Plot[Sin[x], {x, -3 π, 3  π}, 
        PlotStyle -> {RGBColor[1, 0, 0], Thickness[ .02]}, 
        DisplayFunction -> Identity]  t2 = 
      Plot[Sin[x] + ((2  π)/3), {x, -3 π, 3  π}, 
        PlotStyle -> {RGBColor[0, 0, 1], Thickness[ .02]}, 
        DisplayFunction -> Identity]t3 = 
      Plot[Sin[x ] + ((4  π)/3), {x, -3 π, 3  π}, 
        PlotStyle -> {RGBColor[0, 1, 0], Thickness[ .02]}, 
        DisplayFunction -> Identity] Show[GraphicsArray[{t1, t2, t3}], DisplayFunction -> $DisplayFunction]
      Show[t1, t2, t3, DisplayFunction -> $DisplayFunction]

Yes now this looks like a real  translation along the Y axis.   Blue is +1.  Green is + 2.     But what was going on with the X axis translation attempt ?
Write out reasons supporting or refuting the statement that a phase shift is really a translation for a sine function.

Sin (cx) + Sin (dx)
Carrier Waves
A Sine Wave Riding on Another  Sine Wave

Plot[{Sin[x] + Sin[12  x]}, {x, -3 π, 3  π}]

The first sine wave carries the second.

Plot[{Sin[x] + Sin[2000  x]}, {x, -3 π, 3  π}]

Many radio wave communications  use the first sine wave for amplitude and the second for frequency.

Play[(Sin[x] + Sin[2000  x]), {x, -3 π, 3  π}]

Key in some real numbers for c and d below.  Choose at least one number in the audible frequency range to produce sound.

Play[Sin[c*x]+Sin[d*x],{x, -3 π, π}]

Carrier waves can be seen in many natural forms.   Large sand dunes covered with a multitude of smaller sand ripples present natural displays of a large waves carrying smaller waves.   This relationship can also be seen in snow drifts and ocean waves.   Carrier waves used extensively in electromagnetic communications are not in the visible range so special timing devices and scopes are used to capture representative samples of these waves for us to see.

Try to change the amplitude and frequency to make a sand, ocean or snow wave carrying many smaller waves.   Key in some real numbers for  a and f  below.

Plot[{a*Sin[x]+Sin[ f *X]},{x, -3 π, 3  π}]

Sin(ax) multiplied by Sin(bx)

Below is a series of plots.  Describe the difference between each plot.

p2 = 
      Plot[Sin[x]*Sin[2  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p3 = 
      Plot[Sin[x]*Sin[3  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p4 = 
      Plot[Sin[x]*Sin[4  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p5 = 
      Plot[Sin[x]*Sin[5  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p6 = 
      Plot[Sin[x]*Sin[6  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p7 = 
      Plot[Sin[x]*Sin[7  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p8 = 
      Plot[Sin[x]*Sin[8  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p9 = 
      Plot[Sin[x]*Sin[9  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]p10 = 
      Plot[Sin[x]*Sin[10  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity] p11 = 
      Plot[Sin[x]*Sin[11  x], {x, -2 π, 2  π}, 
        DisplayFunction -> Identity]Show[
      GraphicsArray[{p2, p3, p4, p5, p6}, 
        DisplayFunction -> $DisplayFunction]]Show[
      GraphicsArray[{p7, p8, p9, p10, p11}, 
        DisplayFunction -> $DisplayFunction]]

The addition of sine waves combined with  multiplication  can produce some interesting results.

Plot[
      (Sin[x] + Sin[2000  x])*Sin[2000  x], {x, -3 π, 3  π}]

Play[
      (Sin[x] + Sin[2000  x])*Sin[2000  x], {x, -3 π, 3  π}]

Plot[
      (Sin[2002  x] + Sin[2000  x])*Sin[2000  x], {x, -π, π}]

Play[
      (Sin[2002  x] + Sin[2000  x])*Sin[2000  x], {x, -π, π}]

Create some sounds using your own variations of the sine function.