Packages & commands needed for this Notebook

Needs["Graphics`Graphics`"];
Needs["Graphics`Colors`"];
SetOptions[Plot, 
        Ticks -> {{-2 π, ((-3 π)/2), -π, ((-π)/2), 0, (π/2), π, ((3  π)/2), 2  π}, 
            Automatic}];

Graphing Sinusoids

by

Marna Kitzmiller

Dec 2000

Introduction  
If you have used Mathematica before, you may skip this introduction.
This tutorial was written using a program called Mathematica.  Look over directly to the right of this paragraph.  You should see two brackets.  The outside one has a little harpoon-like hook at the bottom.  That hook means that this cell can be opened to see more information.   With the mouse, move the cursor until it is directly over that little hook, and double click.  When you do it correctly, this cell will open and you will see the rest of this message.

Congratulations!  If you can see this message, you have been successful in opening the cell.  

This tutorial is divided into seven sections which can be opened, just like this one.  Those sections are:
		Reflections
		Vertical Shift
		Amplitude
		Horizontal Shift
		Period Change
		Put It All Together
		Test Yourself

Remember, to open each section you must double-click on the hooked bracket to the right of the section's name, just like you did to open this introduction.  
You will also find that there are two types of cells within each lesson.  The first type is like the one you are reading right now, an instruction or explanation.  The second type of cell is called an input cell,  recognized in these lessons by the gray background.  The input cells in the lessons have been written to produce the graphs that will be used in these lessons.   They contain the computer language necessary to produce the graphs.  You may be interested in what is printed there, but you do not need to understand the computer language in the gray cells.   To produce and view each graph, click anywhere within the gray area, then hit  [Enter] on the numeric keypad section of your keyboard, or you can hit [Shift]+[Enter], meaning hold down the [Shift] key, and press [Enter].  Try both methods and determine which you prefer.
Here is a sample input cell for you to practice on.  Follow the directions from the previous paragraph to run the cell.  When you run the first cell in this Mathematica lesson, you will see a prompt asking "Do you want to automatically evaluate all the initialization cells in the notebook?"  Answer "Yes."  Now, click anywhere within the gray area below and run it, according to the directions found in the previous paragraph.  It will probably take a while for the first input cell to run.  Don't worry, the rest will be much faster.

sinplot=Plot[Sin[x],{x, -2 π, 2  π},PlotLabel->FontForm["y= Sin[x]", {"Tahoma", 14}],PlotStyle->{Blue,Thickness[0.015]}];

If you followed the directions correctly, you should now see a graph between this line that you are reading and the gray box above.  
If you followed the directions above and you still don't see a graph, 
ASK FOR HELP!!!

Work through the lessons of this tutorial step-by-step.  Be sure to try different numbers when prompted.  Note how the graphs are changed when you use different numbers.

Reflections

Sine Curve

Run the following cell, and look at the resulting graph.

sinplot=Plot[Sin[x],{x, -2 π, 2  π},PlotLabel->FontForm["y= Sin x", {"Tahoma", 14}],PlotStyle->{Blue,Thickness[0.015]}];

This graph is called a sine curve.  Let's look at one cycle of this plot more carefully.

baseplot=Plot[0 ,{x, -2 π, 2 π},PlotLabel->FontForm["y= Sin x", {"Tahoma", 14}],DisplayFunction -> Identity];
firstplot=Plot[Sin[x],{x, 0, (π/2)},PlotStyle -> {Red, Thickness[0.012]},DisplayFunction -> Identity];
secondplot=Plot[Sin[x],{x, (π/2), π},PlotStyle->{Blue,Thickness[0.012]},DisplayFunction -> Identity];
thirdplot=Plot[Sin[x],{x, π, 2 π},PlotStyle->{Green,Thickness[0.012]},DisplayFunction -> Identity];

Show[{baseplot, firstplot, secondplot, thirdplot}, 
        DisplayFunction -> $DisplayFunction];

Notice that the sine equals 0 when the angle, X, is 0, and increases to 1 (shown in red) as the angle, X,  increases to 90°, or (π/(2 . ))  Then the sine decreases to 0 (shown in blue) as the angle, X, goes from 90° to 180°, or ((π  )/2)to π .  The value of the sine goes from 0 to -1 and back to 0 (green) as the angle, X, increases from 180° to 360°, or π  to 2π.

Consider the following graphs :

firstplot=Plot[Sin[x],{x, -2 π, 2  π},PlotLabel->FontForm["y= Sin x", {"Tahoma", 14}],PlotStyle->{Blue,Thickness[0.015]}];
secondplot=Plot[-Sin[x],{x, -2 π, 2  π},PlotLabel->FontForm["y= -Sin x", {"Tahoma", 14}],PlotStyle->{Red,Thickness[0.015]}];

How are these two graphs alike?  How are these two graphs different?   Do you see that in the first plot the sine curve increases as the angle, X, goes from 0 to (π/2)?  Now look at the second plot.  What is happening to this graph as the angle X goes from 0 to (π/2)?  Now compare other parts of the two graphs.  The two graphs look like mirror images of each other.

What you are seeing is called a reflection over the x-axis.  It may also be called a negation.  Notice that every point on the red curve is the same distance from the X-axis as the corresponding point on the blue curve, but in the opposite direction.  This may be easier to see if we put the two graphs together.  The original sine curve is in blue, the new curve, -sin[X], is in red.

Plot[{Sin[x],-Sin[x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  -Sin x", {"Tahoma", 14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Cosine Curve

Now let's look at the cosine.  A graph of the cosine curve looks exactly like the graph of the sine curve, except the graph of the cosine curve has been shifted horizontally so that it has a Y value of +1 when X=0.

firstplot=Plot[Cos[x],{x, -2 π, 2  π},PlotLabel->FontForm["y= Cos x", {"Tahoma", 14}],PlotStyle->{Blue,Thickness[0.015]}];

Consider the following graphs :

firstplot=Plot[Cos[x],{x, -2 π, 2  π},PlotLabel->FontForm["y= Cos x", {"Tahoma", 14}],PlotStyle->{Blue,Thickness[0.015]}];
secondplot=Plot[-Cos[x],{x, -2 π, 2  π},PlotLabel->FontForm["y= -Cos x", {"Tahoma", 14}],PlotStyle->{Red,Thickness[0.015]}];

How are these two graphs alike?  How are these two graphs different?  Notice what is happening to the graph of the function at  X=0.  Do you see that in the first plot the graph is at a maximum?  Now look at the second plot.  What does the graph of the second function look like at X=0?

What you are seeing here is again called a reflection over the x-axis.   Notice that every point on the red curve is the same distance from the X-axis as the corresponding point on the blue curve, but in the opposite direction.  Like before, it is easier to see this property if we put the two graphs together.

Plot[{Cos[x],-Cos[x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Cos x  and  -Cos x", {"Tahoma", 14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Vertical Shift

In this section we will look at the vertical shift of the sine and cosine waves.  Vertical shift is the term that refers to moving the graph up or down with respect to the parent function.  In high school math books, the vertical shift is traditionally represented by the letter k.  Look at the following graph.  How are the red and blue curves alike?  How are they different?

k = 2;
Plot[{Sin[x], Sin[x]+k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin x + 2", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

You should have noticed that every point on the red curve is exactly two units above the corresponding point on the blue curve.  The centerline is no longer the X-axis.  Now the centerline is the line Y=2.  This may be easier to see if the line, Y=2, is added to the graph.

k = 2;
Plot[{Sin[x], Sin[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin x + 2", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Now let's look at an example where the vertical shift is negative.

k = -3;
Plot[{Sin[x], Sin[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin x - 3", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Run this cell, but this time try a new value for k  by replacing the square with your chosen value.

k = ■;
Plot[{Sin[x], Sin[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin x + k", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Try some more numbers.  Are the results what you expected?

Let's look at a vertical shift on a cosine curve.

k = 1;
Plot[{Cos[x], Cos[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Cos x  and  Cos x + 1", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Try some more numbers.  Are the results what you expected?

Consider these equations.

			y =  sin(x) + k
			y =  cos(x) + k
		
From what you have observed, explain how the value of  k  in these equations affects the graph.

Amplitude

In this section we will be looking at the amplitude of sine and cosine graphs.  Amplitude is the maximum distance above and below the centerline of the graph.

Consider the following graphs :

a = 2;
Plot[{Sin[x],a Sin[x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x and 2 Sin x", {"Tahoma", 14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

How are these two graphs alike?  How are these two graphs different?  Notice what is happening to the graph at X=0.  Do you see that both plots are crossing the centerline, going from negative to positive?  The graph of Sin[X] is in blue.  What is its amplitude (maximum distance from the centerline)?  The graph of 2 Sin[X] is in red.  What is its amplitude?

Now let's try  a=3  instead of 2.  Are the results what you expected?

a = 3;
Plot[{Sin[x],a Sin[x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  3 Sin x", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Run this cell, but this time try a new value for a  by replacing the square with your chosen value.  You might even want to try a negative number.

a = ■;
Plot[{Sin[x],a Sin[x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  a Sin x", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Try some more numbers.  Are the results what you expected?

In the following cell, you will see that this also applies to the cosine function.

a = 5;
Plot[{Cos[x],a Cos[x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Cos x  and  5 Cos x", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Consider these equations.

			y =  a sin(x) 
			y =  a cos(x) 
					
From what you have observed, explain how the value of  a  in these equations affects the graph.

Horizontal Shift

In this section, we will be looking at horizontal shifts, also called phase shifts, of sine and cosine waves. Horizontal shift is the term that refers to moving the graph left or right with respect to the parent function.   Run the following cell.

h = (π/4);
Plot[ Sin[x],{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plot of Sin x", {"Tahoma", 14}],PlotStyle->{Blue,Thickness[0.015]}];
Plot[ Sin[x - h],{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plot of  Sin (x-(π/4))"", {"Tahoma", 14}]\),PlotStyle->{Red,Thickness[0.015]}];

If you look closely at these graphs, you should see that they have the same shape, but the lower graph is shifted slightly to the right.  That may be easier to see if the two graphs are put together, as in the next cell.  The original sine wave is in blue; the shifted sine wave is in red.

h = (π/4);
Plot[{Sin[x], Sin[x-h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x and  Sin (x-(π/4))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Let's look at some more examples.

h = (π/3);
Plot[{Sin[x], Sin[x-h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x and  Sin (x-(π/3))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

h = (π/2);
Plot[{Sin[x], Sin[x-h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x and  Sin (x-(π/2))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

What happened to the position of the new graph (blue), as the value of  h  increased?

In previous sections you learned that the value of sin(X) is zero when  X  is zero.  In the graph above, notice that sin(x) is now equal to zero when  X  is (π/2), or when  X=h.  In other words, the sine wave has been shifted \(TraditionalForm
      \`π\/2\ units\ to\ the\ right . \ \ The\ graph\ acts\ as\ if\ 
        π\/2\) has been subtracted from every X.  That is the result of the expression  Sin(X-(π/2)).   In general, the sine wave has been shifted  h  units to the right, or you could say that the horizontal shift is h units. 

Now let's look at a situation where  h  is a negative number.

h=-(π/3);
Plot[{Sin[x], Sin[x-h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x and  Sin (x-(-(π/3)))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

In the graph above the blue curve is that of  sin[X-(-(π/3))],  which is the same as sin(X+(π/3)). As you can see, when the value of  h  is negative, the graph is shifted to the left, or in a negative direction.

Run this cell with a different value for  h  by replacing the square.

h = ■;
Plot[{Sin[x], Sin[x-h]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x and  Sin (x-h)", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Try some more numbers.  Are the results what you expected?

Now let's look at some phase shifts on a cosine waves.

h = (π/2);
Plot[{Cos[x], Cos[x - h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Cos x and  Cos (x-(π/2))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Just as with the sine wave, you can see that the new curve, cos(X-(π/2)), looks the same as the original curve, cos(X), except that it has been shifted (π/2) units to the right.  To see it more clearly, notice that cos(X), the blue curve, is at a maximum value at X=0.  The corresponding maximum value for cos(X-(π/2)), the red curve, is at X=(π/(2 . ))

Let's look at some more phase shifts, or horizontal shifts.  Each time, take note of where the curve shows a maximum value.

h = (π/3);
Plot[{Cos[x], Cos[x-h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Cos x and  Cos (x-(π/3))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

h = -(π/4);
Plot[{Cos[x], Cos[x-h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Cos x and  Cos (x+(π/4))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

h=-(π/2);
Plot[{Cos[x], Cos[x - h]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Cos x and  Cos (x+(π/2))"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Try some more numbers.   As you can see in these graphs, a phase change in a cosine wave is the same as a phase change in a sine wave.

Consider these equations.

			y =  sin(x-h) 
			y =  cos(x-h)
		
From what you have observed, explain how the value of  h  in these equations affects the graph.

Period Change

In this last lesson, we will look at period changes.  Sine and cosine functions are called periodic functions because the values of  Y  repeat each time  x  changes 360°, or 2π  radians.  We say that 360°, or 2π  radians, is the period of the sinusoid.  If the argument of sine or cosine is a single variable, such as X or θ, the change in the argument is the same as the change in the variable, and the period of the function is still 360°, or 2π  radians.  If, however, the variable is multiplied by a nonzero number, there is a period change.  Let's look at a few example to observe some period changes.

b = 2;
Plot[{Sin[x],Sin[b x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin 2x", {"Tahoma", 14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

As you can see in the graph above, there has been a period change.  When the variable was multiplied by 2, the value of the argument changed twice as fast as the change in the variable.  Look closely at the two curves.  The blue curve goes through 2 complete cycles, while the red curve goes through 4 complete cycles, or twice as many.  Looking at it a different way, the period has changed to (1/2) of the original length.

Let's see what happens when the variable is multiplied by 3.

b = 3;
Plot[{Sin[x],Sin[b x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin 3x", {"Tahoma", 14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Now, when the variable is multiplied by 3, there are 3 times as many cycle.  Each period is (1/3) of its original length .

b=(1/2);
Plot[{Sin[x],Sin[b x]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x  and  Sin (1/2)x"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

As you can see, there are now half as many complete cycles, and the period is now twice as long.

Run this cell with a different value for  b  by replacing the square.

b = ■;
Plot[{Sin[x],Sin[b x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin b x", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Try some more numbers.  Are the results what you expected?

Now let's look at some period changes in cosine waves.

b = 2;
Plot[{Cos[x],Cos[b x]},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Cos x  and  Cos 2x", {"Tahoma", 14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

b=(1/4);
Plot[{Cos[x],Cos[b x]},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Cos x  and  Cos (1/4)x"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]}}];

Try some more numbers.  As you can see, the results are the same with cosine waves.

Consider these equations.

			y =  sin(b x) 
			y =  cos(b x)
		
From what you have observed, explain how the value of  b  in these equations affects the graph.

Put It All Together

Now, let's put everything together.
Here is the graph of the parent function.

Plot[Sin[x], {x, -2 π, 2  π}, 
        PlotLabel -> FontForm["Plot of Sin x ", {"Tahoma", 14}], 
        PlotStyle -> {Blue, Thickness[0.005]}];

Let's shift the graph up 3 units.

k = 3;
Plot[{Sin[x],Sin[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  Sin x + 3", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Now let's give it a change in amplitude.

a = 2;
k = 3;
Plot[{Sin[x],a Sin[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Sin x  and  2 Sin x + 3", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

And shift it (π/2) units to the right .

a = 2;
h=(π/2);
k = 3;

Plot[{Sin[x],a Sin[x-h]+k,k},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x  and  2 Sin (x-(π/2)) + 3"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

And finally, let's give it a period change.

a = 2;
b = 2;
h=(π/2);
k = 3;
Plot[{Sin[x],a Sin[b(x - h)]+k,k},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x  and  2 Sin 2(x-(π/2)) + 3"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Now, let's do the same thing with the cosine function.
Here is the graph of the parent function.

Plot[Cos[x], {x, -2 π, 2  π}, 
        PlotLabel -> FontForm["Plot of Cos x ", {"Tahoma", 14}], 
        PlotStyle -> {Blue, Thickness[0.005]}];

Let's shift the graph down 2 units.

k = -2;
Plot[{Cos[x],Cos[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Cos x  and  Cos x - 2", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Now let's give it a change in amplitude.

a = 4;
k = -2;
Plot[{Cos[x],a Cos[x]+k,k},{x, -2 π, 2  π},PlotLabel -> 
            FontForm["Plots of Cos x  and  4 Cos x - 2", {"Tahoma", 
                14}],PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

And shift it (π/2) units to the left .

a = 4;
h=-(π/2);
k = -2;

Plot[{Cos[x],a Cos[x-h]+k,k},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Cos x  and  4 Cos (x+(π/2)) - 2"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

And finally, let's change the period.

a = 4;
b = 2;
h=-(π/2);
k = -2;
Plot[{Sin[x],a Sin[b(x - h)]+k,k},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Cos x  and  4 Cos 2(x+(π/2)) - 2"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Now, you try making a new graph by putting in your own values for a, k, h, and b, by replacing the squares.

a = ■;
k = ■;
h = ■;
b = ■;
Plot[{Sin[x],a Sin[b(x-h)]+k,k},{x, -2 π, 2  π},\(PlotLabel -> 
            FontForm[\*""Plots of Sin x  and  2 Sin 2(x-(π/2)) + 3"", {"Tahoma", 14}]\),PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Is the graph what you expected?
Play with this cell until you are comfortable with the results.

Test Yourself

Here are some graphs for you to work with.  Find the values for a, k, h, and b and use them to write an equation for each of the following sinusoids.  You can check your answers by replacing the numbers given for a,k,h,and b with the values you chose, then running the cell to check the resulting graph.  Keep adjusting the numbers until your results are the same as the given graph.

Graph #1:  
Y = a Sin b(X - h) + k
Write the equation for this sinusoid in terms of the sine function.

a = 1;
b = 1;
h = 0;
k = 0;
Plot[{Sin[x],a Sin[b (x - h)]+k,k},{x, -2 π, 2  π},PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];

Graph #2:  
Y = a Cos b(X - h) + k
Write the equation for this sinusoid in terms of the cosine function.

a = 1;
b = 1;
h = 0;
k = 0;
Plot[{Cos[x],a Cos[b(x-h)]+k,k},{x, -2 π, 2  π},PlotStyle->{{Blue,Thickness[0.005]},{Red,Thickness[0.015]},{Green,Thickness[0.005]}}];