Skip to content

Shifts, stretches and squeezes of sine and cosine

Shifts, stretches and squeezes of sine and cosine

A general sine and cosine

Each number in the function y=Asin⁡(ax+b)+B\displaystyle {y}={A\sin(ax+b)+B} changes the graph of y=sin⁡x\displaystyle {y}={\sin x} in a different way:

  • B\displaystyle B – a vertical shift: B\displaystyle B units up (B<0\displaystyle B<0 – down). The graph swings about the line y=B\displaystyle {y}={B}.
  • A\displaystyle A – a vertical stretch: the height above y=B\displaystyle {y}={B} and below it grows ∣A∣\displaystyle |A| times. The number ∣A∣\displaystyle |A| is the amplitude. When A<0\displaystyle A<0 the graph is also reflected.
  • a\displaystyle a – a horizontal squeeze by ∣a∣\displaystyle |a|: a full turn of ax\displaystyle ax ends already after 2π∣a∣\displaystyle \frac{2\pi}{|a|}. This is the period:
T\displaystyle T =\displaystyle = 2π∣a∣\displaystyle \frac{2\pi}{|a|}
  • b\displaystyle b – a horizontal shift: ax+b=a(x+ba)\displaystyle {ax+b}={a\left(x+\frac{b}{a}\right)}, so the graph moves ba\displaystyle \frac{b}{a} to the left (ba<0\displaystyle \frac{b}{a}<0 – to the right).

The range: B−∣A∣≤y≤B+∣A∣\displaystyle B-|A|\leq y\leq B+|A|. The very same rules hold for y=Acos⁡(ax+b)+B\displaystyle {y}={A\cos(ax+b)+B}.

Example: reading the formula

The example below reads the properties of g(x)=2sin⁡(2x−π2)+1\displaystyle {g(x)}={2\sin\left(2x-\frac{\pi}{2}\right)+1} from the formula. On the board: g\displaystyle g, and dashed – sin⁡x\displaystyle \sin x.

  • B=1\displaystyle {B}={1}: the graph swings about y=1\displaystyle {y}={1}.
  • A=2\displaystyle {A}={2}: the amplitude is 2, so the range is −1≤y≤3\displaystyle -1\leq y\leq3.
  • a=2\displaystyle {a}={2}: the period is 2π2=π\displaystyle {\frac{2\pi}{2}}={\pi}.
  • 2x−π2=2(x−π4)\displaystyle {2x-\frac{\pi}{2}}={2\left(x-\frac{\pi}{4}\right)}: a shift of π4\displaystyle \frac{\pi}{4} to the right.
f(x)=sin⁡x\displaystyle f(x)=\sin x
g(x)=2sin⁡(2x−π2)+1\displaystyle g(x)=2\sin\left(2x-\frac{\pi}{2}\right)+1
Finding the function from its graph

On the board: the graph of a function of the form Asin⁡(ax+b)+B\displaystyle A\sin(ax+b)+B, with a maximum point M\displaystyle M and the minimum point N\displaystyle N after it. The example below finds its formula from these points.

  • B\displaystyle B – the middle of the range: 3+(−1)2=1\displaystyle {\frac{3+(-1)}{2}}={1}.
  • The amplitude – half the height of the range: 3−(−1)2=2\displaystyle {\frac{3-(-1)}{2}}={2}.
  • From the maximum to the minimum is half a period: 3π4−π4=π2\displaystyle {\frac{3\pi}{4}-\frac{\pi}{4}}={\frac{\pi}{2}}, so the period is π\displaystyle \pi and a=2ππ=2\displaystyle {a}={\frac{2\pi}{\pi}}={2}.
f(x)=2sin⁡2x+1\displaystyle f(x)=2\sin2x+1
M=(π4,3)\displaystyle M=(\frac{\pi}{4},3)
N=(3π4,−1)\displaystyle N=(\frac{3\pi}{4},-1)

The shift is left to find. It has more than one answer:

  • as a sine: sin⁡\displaystyle \sin reaches its maximum when its argument is π2\displaystyle \frac{\pi}{2}. At x=π4\displaystyle {x}={\frac{\pi}{4}}: 2⋅π4=π2\displaystyle {2\cdot\frac{\pi}{4}}={\frac{\pi}{2}} – no shift is needed, y=2sin⁡2x+1\displaystyle {y}={2\sin2x+1}.
  • as a cosine: cos⁡\displaystyle \cos reaches its maximum when its argument is 0\displaystyle 0, so the graph is cos⁡2x\displaystyle \cos2x shifted π4\displaystyle \frac{\pi}{4} to the right: y=2cos⁡(2x−π2)+1\displaystyle {y}={2\cos\left(2x-\frac{\pi}{2}\right)+1}.

Both formulas describe the same graph, because cos⁡(2x−π2)=cos⁡(π2−2x)=sin⁡2x\displaystyle {\cos\left(2x-\frac{\pi}{2}\right)}={\cos\left(\frac{\pi}{2}-2x\right)}={\sin2x}.

Exercise 1

The function is f(x)=3sin⁡2x−1\displaystyle {f(x)}={3\sin2x-1}.

a

Mark on the board its maximum and minimum points in the part shown.

f(x)=3sin⁡2x−1\displaystyle f(x)=3\sin2x-1

b

Write the amplitude, the period and the range of f\displaystyle f, and how they show in the points you marked.

Exercise 2

On each board – the graph of one transformation of sin⁡x\displaystyle \sin x or of cos⁡x\displaystyle \cos x.
Write its formula on the board.

a
y= ?\displaystyle y=\,?

b
y= ?\displaystyle y=\,?

c
y= ?\displaystyle y=\,?

d
y= ?\displaystyle y=\,?

Exercise 3

Write two formulas for the graph on the board: one as a transformation of sin⁡x\displaystyle \sin x, and one as a transformation of cos⁡x\displaystyle \cos x.

y= ?\displaystyle y=\,?

Exercise 4

The period of y=sin⁡ax\displaystyle {y}={\sin ax} (a>0\displaystyle a>0) is π3\displaystyle \frac{\pi}{3}.
Solve the equation to find a\displaystyle a.