Name:      Kathleen Smith

Title:                              SURF'S UP!
                A Look at the Sine and Cosine Waves

Description:
               This notebook is a look at the Sine and Cosine waves and the parameters that determine the shape of the graphs.

SURF'S UP!

A LOOK AT THE SINE AND COSINE WAVES

Introduction

Most of you by now will know that the Sine and Cosine functions will graph as waves when shown on an xy plane.  The waves look very much alike.  How can we tell if the graph is a Sine or Cosine wave? How could we make two different waves overlap?  By going through this lesson you will learn some techniques to help you match a wave with it's graph.

Let's Get Started

Let's look first at the basic Sine wave.  
    (The x axis will be measured in radians.)

Plot[Sin [x], {x,-3,3}]

Notice that the wave is negative from -3 to the origin, zero at the origin and positve from the origin to 3.  This agrees with the values that we saw in the unit circle, since from -3 to zero would be most of the third and all of the fourth quardrant and from zero to three would be all of the first and most of the second quadrant.
     Now let's look at the Cosine wave.

coswave=Plot[Cos [x], {x, -3,3}]

This wave starts out negative, goes positive and back negative again, but this, too, agrees with our unit circle.  See if you can determine where the four quardants begin and end.

labels1 = Graphics[Text["4th",{-1,.25}]]
labels2 = Graphics[Text["3rd",{-2.5,-.5}]]
labels3 = Graphics[Text["1st",{.5,.5}]]
labels4 = Graphics[Text["2nd",{2.5,-.25}]]
Show[coswave,labels1,labels2,labels3,labels4]

Now let's plot the two waves together,(the Sine will look darker than the Cosine.)

Plot [{Sin[x], Cos[x]}, {x,-3,3},PlotStyle->{Thickness[.01],Thickness[.004]}]

So, how would I know which was Sine and which Cosine if one were not thicker than the other?   
     Also,these are just the basic waves.  What if I wanted to make changes to one of them so that it would be higher than the other, more rapid than the other,or lie exactly on top of the other?  Do you remember how to do that?  Maybe we should start with a brief review.  There is one in the next section.......

Review

If you recall, the standard forms for the Sine and Cosine waves are:
                     ƒ(x) = aSin(bx–+c)+d and ƒ(x)=aCos(bx–+c)+d
  But what do each of the parameters, a,b,c and d do to the wave?

a

a affects the amplitude, (or how high above and below the horizontal axis  the wave will rise and fall.).  The effect of a is direct, that is, if a=1 then you get the standard height (which is one unit above and one unit below the horizontal.), if |a|>1 you get a wave that is higher and lower than the standard  by a factor of a.  If |a|<1 then you get a wave that is only a fraction of the standard height by a factor of a.
     And there is a very good reason for why I put a in the absolute value symbol, do you remember why?

That's right, because if a>0 you get a wave that moves in the standard direction (counterclockwise with the origin at due East or 0‚ on the unit circle). If a<0 you still get a counterclockwise wave, but it starts at due West or 180‚.    Got that?  
		Well, let's look at some examples.

Examples

Clear[x,a]
swave = Plot[{Sin[x],2Sin[x],-3Sin[x]},
             {x,-3,3},
              PlotStyle->{{Thickness[.004],GrayLevel[0]},
                          {Thickness[.006],GrayLevel[.9]},
                          {Thickness[.008],GrayLevel[0]}}];

Which wave do you think is Sin(x)?
     Which -3Sin(x)?
     Which 2Sin(x)?

labels1 = Graphics[Text["Sin(x)",{1.5,.5}]]
labels2 = Graphics[Text["2Sin(x)",{2.5,1.75}]]
labels3 = Graphics[Text["-3Sin(x)",{1,-1}]]
Show[swave,labels1,labels2,labels3]

b

b affects the period, (or speed) of the function.  After you plug in a value for x, it will multiplied by the value b before the Sine or Cosine is computed.  b has an inverse effect on the period, that is, if b>1 then the period is shortened and if b<1 the period is lengthened. (We will not deal with negative values of b in this lesson.)
      Let's look at some examples.

Clear[f,g,x]
bwave=Plot[{Cos[x],Cos[2x],Cos[.25x]},{x,-7,7}, PlotStyle->{{Thickness[.004],GrayLevel[0]},
                          {Thickness[.006],GrayLevel[.9]},
                          {Thickness[.008],GrayLevel[0]}}]

Which graph do you think is Cos(x)?
     Which Cos(2x)?
     Which Cos (.25X)?

labels1 = Graphics[Text["Cos(x)",{3.,-1.1}]]
labels2 = Graphics[Text["Cos(2x)",{5.75,-.5}]]
labels3 = Graphics[Text["Cos(.25x)",{1,1.1}]]
Show[bwave,labels1,labels2,labels3]

c

c causes the wave to shift either to the left or right.  The effect is inverse, that is, if c is positve the wave moves that many units to the left of the standard position on the x-axis, and if c is negative it moves that many units to the right.
  Look at the folowing examples.

cwave=Plot[{Sin[x],Sin[x+(Pi/2)],Sin[x-(Pi/4)]},{x,-3,3},PlotStyle->{{Thickness[.004],GrayLevel[0]},{Thickness[.006],GrayLevel[.9]},
{Thickness[.008],GrayLevel[0]}}]

Which do you think is Sin(x)?
    Which Sin(x+(`/2))?
    Which Sin(x-(`/4))?

labels1 = Graphics[Text["Sin(x)",{-.75,-.25}]]
labels2 = Graphics[Text["Sin(x-(Pi/4)",{1,-.75}]]
labels3 = Graphics[Text["Sin(x+(Pi/2)",{1,1.1}]]
Show[cwave,labels1,labels2,labels3]

d

d moves the horizontal axis of the wave up or down.  The horizontal for the standard wave is the x-axis and adding a d to the function shifts it.  The effect is direct.  If d is positive the horizontal moves up that many units, and if it is negative it moves down.  Look at the following examples.

dwave=Plot[{Cos[x],Cos[x]+2,Cos[x]-1},{x,-3,3},PlotStyle->{{Thickness[.004],GrayLevel[0]},{Thickness[.006],GrayLevel[.9]},
{Thickness[.008],GrayLevel[0]}}]

Which do you think is Cos(x)?
   Which Cos(x)+2?
   Which Cos(x)-1?

labels1 = Graphics[Text["Cos(x)",{1,1}]]
labels2 = Graphics[Text["Cos(x)+2",{1,2.75}]]
labels3 = Graphics[Text["Cos(x)-1",{.5,-.75}]]
Show[dwave,labels1,labels2,labels3]

Practice

Well, now you should have at least an idea of how to make a wave do what you want.  Let's look at a few examples and see if you can find a match.  When you have decided which function you think matches the given graph, enter your choice on the line that says Choice=

ex1:=Plot[3Sin[2x]-1,{x,-4,4}, DisplayFunction->Identity]
ex2:=Plot[Cos[x+Pi],{x,-4,4}, DisplayFunction->Identity]
ex3:=Plot[Sin[x]-1,{x,-4,4}, DisplayFunction->Identity]
ex4:=Plot[2Cos[2x],{x,-4,4}, DisplayFunction->Identity]
ex5:=Plot[-Sin[x]+2,{x,-4,4}, DisplayFunction->Identity]
ex6:=Plot[Sin[.5x]-1,{x,-4,4}, DisplayFunction->Identity]

a) 2Sin(x-`)
b) 3Cos(x-1)
c) 3Sin(2x)-1
d) 2Cos(3x)

Choice=

a:=Plot[2 Sin[x-Pi],{x,-4,4}, DisplayFunction->Identity]
b:=Plot[3 Cos[x-1],{x,-4,4}, DisplayFunction->Identity]
c:=Plot[3 Sin[2x]-1,{x,-4,4}, DisplayFunction->Identity]
d:=Plot[2 Cos[3x],{x,-4,4}, DisplayFunction->Identity]
Show[Choice,ex1, DisplayFunction->$DisplayFunction]

How did you do? If you need to try again just delete your choice and enter another try.

Here is one more to try together.

a)  Sin(x)-1
 b) -Cos(x)
 c)  Sin(x+`)
 d)  Cos(x+`)

Choice=
a:=Plot[Sin[x]-1,{x,-4,4}, DisplayFunction->Identity]
b:=Plot[-Cos[x],{x,-4,4}, DisplayFunction->Identity]
c:=Plot[Sin[x+Pi],{x,-4,4},DisplayFunction->Identity]
d:=Plot[Cos[x+Pi],{x,-4,4},DisplayFunction->Identity]
Show[Choice,ex2, DisplayFunction->$DisplayFunction]

Well, how did you do?  Actually this one should have been easy even if you guessed since two of the four choices work!  Can you find both?

Surf's Up!

Where are four waves for you to try to do on your own.  Have fun!

GRAPH 1

a) Sin(x)-1
b) Cos(x)+1
c) -Sin(x)
d) -Cos(-x)-1

Choice=  

a:=Plot[Sin[x]-1,{x,-4,4}, DisplayFunction->Identity]
b:=Plot[Cos[x]+1,{x,-4,4}, DisplayFunction->Identity]
c:=Plot[-Sin[x],{x,-4,4}, DisplayFunction->Identity]
d:=Plot[-Cos[-x]-1,{x,-4,4},DisplayFunction->Identity]
Show[Choice,ex3,DisplayFunction->$DisplayFunction,PlotRange->{{-4,4},{-4,4}}];

GRAPH 2

a) Sin(x)-2
b) Cos(x)+2
c) 2Sin(x)
d) 2Cos(2x)

Choice=  

a:=Plot[Sin[x]-2,{x,-4,4}, DisplayFunction->Identity]
b:=Plot[Cos[x]+2,{x,-4,4}, DisplayFunction->Identity]
c:=Plot[2Sin[x],{x,-4,4}, DisplayFunction->Identity]
d:=Plot[2Cos[2x],{x,-4,4},DisplayFunction->Identity]

Show[Choice,ex4,DisplayFunction->$DisplayFunction,PlotRange->{{-4,4},{-4,4}}];

GRAPH 3

a) -Sin(x)+2
b) Cos(x)+2
c) 2Sin(x)
d) -2Cos(x)

Choice=  

a:=Plot[-Sin[x]+2,{x,-4,4},DisplayFunction->Identity]
b:=Plot[Cos[x]+2,{x,-4,4},DisplayFunction->Identity]
c:=Plot[2Sin[x],{x,-4,4},DisplayFunction->Identity]
d:=Plot[-2Cos[x],{x,-4,4},DisplayFunction->Identity]

Show[Choice,ex5,DisplayFunction->$DisplayFunction,PlotRange->{{-4,4},{-4,4}}];

GRAPH 4

a) Sin(x)-.5
b) Cos(2x)-1
c) Sin(.5x)-1
d) Cos(.5x)-1

Choice= 

a:=Plot[Sin[x]-.5,{x,-4,4},DisplayFunction->Identity]
b:=Plot[Cos[2x]-1,{x,-4,4},DisplayFunction->Identity]
c:=Plot[Sin[.5x]-1,{x,-4,4},DisplayFunction->Identity]d:=Plot[Cos[.5x]-1,{x,-4,4},DisplayFunction->Identity]

Show[Choice,ex6,DisplayFunction->$DisplayFunction,PlotRange->{{-4,4},{-4,4}}];

Sunset

Well, that's all for this lesson.  I hope you enjoyed it. It's easy to see why the graphs of Sine and Cosine can be so confusing at times.  If you take each parameter, a,b,c and 
d, one at a time, however, it can all be worked out, often in many acceptable forms!!