Application Center - Maplesoft

# The sine graph

You can switch back to the summary page by clicking here.

0401.mws

Module 4 : Trigonometry

401 : Sine Graphs

S E T U P

In this project we will use the following command package. Type and execute this line before begining the project below. If you re-enter the worksheet for this project, be sure to re-excute this statement before jumping to any point in the worksheet.

> restart; with(plots):

```Warning, the name changecoords has been redefined
```

___________________________________________________________________________________

A. Components of Sine

___________________________________________________________________________________

We're going to consider functions of the form y = a sin(bs+c) + d. Each of the parameters has a different affect on the graph. We will consider each individually.

AMPLITUDE

The parameter a, affects the amplitude of the graph. y = a sin(x) has the same period, and passes through the origin just a sin(x) does. However, the different values of a cause the graph to stretch or shrink vertically.

The gold graph is the standard y = sin(x). The blue is the result of increasing the amplitude from 1 to 2, and the red graph is the result of decreasing the amplitude from 1 down 0.

> display( plot( sin(x), x = 0..2*Pi, color = gold), animate((1+t)*sin(x),
x = 0..2*Pi, t = 0..1, color = blue), animate( (1-t)*sin(x), x=0..2*Pi, t = 0..(.95), color = red));

PERIOD

The parameter b affects the period. The period of sin(x) is 2pi. The period of sin(bx) is 2pi/b. Here is what it looks like as b changes from 1 to 2, and the period changes from 2pi to pi.

The gold graph is the reference graph of y = sin(x). As the period shortens the frequency increases. The resulting graph has two periods in the space where it had only one period.

> display( plot( sin(x), x = 0..2*Pi, color = gold), animate(sin(t*x),
x = 0..2*Pi, t = 1..2, color = blue));

VERICAL SHIFT

The parameter d offers the verical position of the graph. y = sin(x) + d will be exactly d units above y = sin(x).

The gold graph is the reference again. The blue graph shows how the graph changes when d goes from 0 to 3,and the red graph shows what happens when d goes from 0 down to -3.

> display( plot( sin(x), x = 0..2*Pi, color = gold), animate((t + sin(x)),
x = 0..2*Pi, t = 0..3, color = blue), animate( (-t + sin(x)), x=0..2*Pi, t = 0..3, color = red));

HORIZONTAL SHIFT

The parameter c effects the horizontal position of the graph. y = sin(x - c) will be moved c units to the right of y = sin(x).

The gold graph is the reference again. The blue graph shows how the graph changes when d goes from 0 to 3, and the red graph shows what happens when d.

> display( plot( sin(x), x = 0..2*Pi, color = gold), animate(sin(x + t),
x = -Pi/2..2*Pi, t = 0..Pi/2, color = blue) );

Its slightly more complicated when there is a change of period and a horizontal translation at the same time.

Clearly the period of the new graph is 2pi/3, however the horizontal shift is not pi/2!

> plot( { sin(x),sin(3*x - Pi/2)}, x = 0..2*Pi, color = [red,blue]);

One way to understand what the new horizontal shift is to solve the argument of the sine function.

This number is the actual horizontal shift!

> solve( 3*x - Pi/2 =0,x);

___________________________________________________________________________________

B. Combining the Components of Sine

___________________________________________________________________________________

We saw above how changes in the various parameters can individually effect a sine graph. What happens when several or all of these changes all occur at once? In this section we will create such graphs and compare them to the original unaltered y = sin(x) graph.

This creates the graph of y = sin(x). One fundamental period is shaded in yellow.

> Phi := x -> x; f:= x -> sin(Phi(x));

> theta[1] := solve( Phi(x) = 0,x);
theta[2] := solve( Phi(x) = 2*Pi, x);
tmid := (theta[1] + theta[2])/2:
m := evalf(minimize(f(x))) :
M := evalf(maximize(f(x))):
mid := (m + M) / 2:
display( plot( f(x), x = -3*Pi..3*Pi, color = blue, thickness = 2),
plot( sin(x), x = 0..2*Pi, color = black, thickness = 1),polygonplot({[[theta[1],m],[theta[1],M],[theta[2],M],[theta[2],m]],[[theta[1],mid],[theta[2],mid]],[[tmid,m],[tmid,M]] }, color = coral ));

Lets look at another variation. Copy and paste the block of commands above, and change the angle and sine as indicated below.

Note that the black sine graph is the original unaltered function. And the yellow box indicates the fundamental period of the new graph.

> Phi := x-> x/2 + Pi;
f := x -> sin(Phi(x));

___________________________________________________________________________________

___________________________________________________________________________________

Some fascinating graphs can be created by adding different sine funtions together. Although such graphs can be quite difficult to create by hand, the power of the computer can enable the quick creation of such graphs.

Lets consider the family of functions of the from sin(nx)/n where n=1,2,3,...

> plot({sin(k*x)/k \$ k =1..10},x = 0..2*Pi);

If we add up the first three of these functions, we get the graph of sin(x) + sin(2x)/2 + sin(3x)/3

> f := (x,n) -> sin(n*x)/n;

> plot({sum(f(x,k), k =1..3) },x = 0..2*Pi );

We can add up the first 10 of these or the first 50 of these.

> plot({ sum( f(x,k), k = 1..8)}, x = 0..2*Pi);

> plot({ sum( f(x,k), k = 1..50)}, x = 0..2*Pi);

We can also add up onlly add numbers members, such as sin(x) + sin(3x)/3 + sin(5x)/5 + ...

> plot({ sum( f(x,2*k+1), k = 1..3)}, x = 0..2*Pi);

> plot({ sum( f(x,2*k+1), k = 1..100)}, x = 0..2*Pi);

We can alternate the signs of the functions, such as sin(x) - sin(2x)/2 + sin(3x)/3 - sin(4x)/4 + ...

> f := (x,n) -> sin(n*x)*(-1)^(n);

> plot({ sum( f(x,k), k = 1..3)}, x = 0..2*Pi);

> plot({ sum( f(x,k), k = 1..10)}, x = 0..2*Pi);

>