Graphs of sine and cosine: amplitude, period and phase shift
Ten problems on the graphs of sine and cosine: amplitude, period, midline and range read off a formula, the phase shift of sin(2x − π/3) with B factored out, the five key points of one period, cosine as a shifted sine, an equation built from a maximum and the next minimum, a daylight model and the days above 14 hours, hertz against radians per second for a mains voltage, the period of sin 2x + cos 3x, why the order of a stretch and a shift matters, and the wavelengths of a transformer's positional encoding with the rotation that moves it k positions, with worked solutions and the mistakes of reading the phase shift before factoring out B, taking the period as 2πB, taking the maximum as the amplitude, dropping the midline's sign and evaluating in degrees.
Before you start
Every sine wave is the graph of sinx stretched, shifted and flipped, and four numbers say exactly how: the amplitude, the period, the phase shift and the midline. Reading them off a formula, and writing the formula from a graph or a description, is the skill behind models of daylight, tides, alternating current and sound, and behind the sinusoidal positional encodings of a transformer. These ten problems read the four numbers off formulas, sketch one period from five key points, turn a cosine into a sine, build an equation from a maximum and a minimum, use a daylight model, convert between hertz and radians per second, find the period of a sum, and end with the positional encoding and the rotation hidden in it. The five mistakes at the end are the ones that still give a believable graph: a phase shift read before factoring out ,B, a period of ,2πB, the maximum taken as the amplitude, the midline's sign dropped, and a calculator left in degrees.
The general sinusoid.,y=Asin(B(x−C))+D, and the same with ,cos, with A=0 and .B=0. Angles are in radians throughout.
Amplitude:∣A∣: half the distance from the minimum to the maximum. A negative A flips the graph across the midline.
Period:2π/∣B∣: the length of one full cycle. ∣B∣ is the angular frequency, in radians per unit of ,x, and ,∣B∣/(2π), cycles per unit of ,x, is the frequency.
Phase shift:C: the graph of Asin(Bx)+D moved C units to the right (C<0 moves it left). It is read only after B has been factored out of the argument.
Midline:y=D: the level halfway between the maximum D+∣A∣ and the minimum .D−∣A∣.
One period of ,sinx, from 0 to ,2π, has five key points: midline at ,0, maximum at ,2π, midline at ,π, minimum at ,23π, midline at .2π. For cosx the list is maximum, midline, minimum, midline, maximum.
A function f is periodic with period T>0 if f(x+T)=f(x) for every ;x; "the" period is the smallest such .T.
Problems
·
Find the amplitude, period, midline and range of y=3sin(4x)−1 and of .y=−2cos(x/3)+5.
··
For ,y=2sin(2x−π/3)+1, find the amplitude, period and phase shift, and the first x≥0 where y is largest.
··
List the five key points of one period of ,y=3sin(2x−4π)+2, starting at the phase shift.
··
Show that .cosx=sin(x+2π). Then write y=5cos(3x) in the form Asin(B(x−C)) with ,A>0, and write y=−2sinx as a cosine with a positive amplitude.
··
A sinusoid has a maximum of 7 at ,x=1, and its next minimum is ,−1, at .x=4. Write it as y=Acos(B(x−C))+D with ,A,B>0, and then as a sine.
···
A model of the hours of daylight on day t of the year at a northern latitude is
H(t)=12+3sin(3652π(t−80)).
Give its period, midline and amplitude, and the daylight on day .172. On which days of the year does it give more than 14 hours?
·
A mains voltage is V(t)=170sin(120πt) volts, with t in seconds. Find its angular frequency, frequency, period and amplitude, and its root-mean-square value mean of V2 over one period.
···
Find the period of .f(x)=sin(2x)+cos(3x). Is g(x)=sinx+sin(2x) periodic?
··
Start from .y=sinx. (a) Stretch the graph horizontally by a factor of ,4, then shift it π to the right. (b) Shift it π to the right, then stretch it horizontally by a factor of .4. Write each equation and give its phase shift.
···
A transformer's sinusoidal positional encoding gives position p the features
PE(p,2i)PE(p,2i+1)=sin(ωip),=cos(ωip),
with ,ωi=10000−2i/d, for .i=0,…,d/2−1. With ,d=512, find the period in positions of pair ,i=0,i=128 and .i=255. Then show that for each pair there is a 2×2 matrix ,Rk, depending on k but not on ,p, that sends the pair at position p to the pair at position .p+k.
Answers
:3sin(4x)−1: amplitude ,3, period ,2π, midline ,y=−1, range .[−4,2].:−2cos(x/3)+5: amplitude ,2, period ,6π, midline ,y=5, range [3,7]
Amplitude ,2, period ,π, phase shift 6π to the right; the first maximum for x≥0 is at ,x=125π≈1.309, where y=3
Period 365 days, midline 12 hours, amplitude 3 hours; H(172)≈15.00 hours; more than 14 hours from day 123 to day 220
120π≈377 rad/s, 60 Hz, period 601 s, amplitude 170 V, RMS 170/2≈120.2 V
f has period ;2π;g is not periodic
(a) ,y=sin(41(x−π)), phase shift ;π; (b) ,y=sin(41(x−4π)), phase shift ;4π; both have period 8π
Periods ,2π≈6.28,200π≈628.3 and about 60611 positions; Rk=[cosωik−sinωiksinωikcosωik] sends (sinωip,cosωip) to (sinωi(p+k),cosωi(p+k))
Worked solutions
Problem 1
Find the amplitude, period, midline and range of y=3sin(4x)−1 and of .y=−2cos(x/3)+5.
For :3sin(4x)−1:,A=3,,B=4,D=−1Match it to Asin(B(x−C))+D with .C=0.
Amplitude ,3, period ,2π/4=2π, midline y=−1The definitions.
Range [−1−3,−1+3]=[−4,2]Maximum ,D+∣A∣, minimum .D−∣A∣.
For :−2cos(x/3)+5:,A=−2,,B=31,D=5.x/3=31x.
Amplitude ,∣−2∣=2, period ,2π/31=6π, midline y=5A small B means a long period.
:3sin(4x)−1: amplitude ,3, period ,2π, midline ,y=−1, range .[−4,2].:−2cos(x/3)+5: amplitude ,2, period ,6π, midline ,y=5, range [3,7]The negative A does not shrink anything: it starts the cosine at its minimum, 3 at ,x=0, instead of its maximum.
Problem 2
For ,y=2sin(2x−π/3)+1, find the amplitude, period and phase shift, and the first x≥0 where y is largest.
2x−3π=2(x−6π)Factor B=2 out of the whole argument.
Amplitude ,2, period ,2π/2=π, phase shift 6πNow it matches Asin(B(x−C))+D with .C=6π.
The maximum is where 2(x−6π)=2π+2πksin peaks at 2π plus whole periods.
x=6π+4π+πk=125π+πkDivide by ,2, then add .6π.
Amplitude ,2, period ,π, phase shift 6π to the right; the first maximum for x≥0 is at ,x=125π≈1.309, where y=3k=−1 gives .125π−π<0. Equivalently, the peak of sin(2x) at 4π moved right by .6π.
Problem 3
List the five key points of one period of ,y=3sin(2x−4π)+2, starting at the phase shift.
2x−4π=21(x−2π)Factor out :B=21: phase shift .2π.
Period ,2π/21=4π, so the key points are π apartFive points split one period into four equal quarters.
x=2π,23π,25π,27π,29πStart at the phase shift and add a quarter period each time.
y=2,5,2,−1,2Midline ,2, then ,2+3, midline, ,2−3, midline: the pattern of .sin.
,(2π,2),,(23π,5),,(25π,2),,(27π,−1),(29π,2)At x=2π the argument is ,0, the start of a sine cycle, so the graph crosses the midline going up. Join the points with the smooth sine shape and repeat every .4π.
Problem 4
Show that .cosx=sin(x+2π). Then write y=5cos(3x) in the form Asin(B(x−C)) with ,A>0, and write y=−2sinx as a cosine with a positive amplitude.
sin(x+2π)=sinxcos2π+cosxsin2π=cosxThe sum formula, with cos2π=0 and .sin2π=1.
5cos(3x)=5sin(3x+2π)Step 1 with 3x in place of .x.
3x+2π=3(x+6π)Factor out :B=3:.C=−6π.
cos(x+2π)=cosxcos2π−sinxsin2π=−sinxThe cosine sum formula.
,5cos(3x)=5sin(3(x+6π)), phase shift ;−6π;−2sinx=2cos(x+2π)A cosine is a sine a quarter period earlier: here the period is ,32π, and a quarter of it is .6π. Any sinusoid can be written with either function; only C changes. Combining a sine and a cosine of the same B into one wave is the asinx+bcosx identity of the trig identities page.
Problem 5
A sinusoid has a maximum of 7 at ,x=1, and its next minimum is ,−1, at .x=4. Write it as y=Acos(B(x−C))+D with ,A,B>0, and then as a sine.
,A=27−(−1)=4,D=27+(−1)=3Half the distance from minimum to maximum, and the level halfway between them.
A maximum to the next minimum is half a period: ,4−1=3, so the period is 6A cycle goes maximum, minimum, maximum.
B=2π/6=3πPeriod .=2π/B.
C=1cos peaks where its argument is ,0, so put that peak at .x=1.
As a sine, the peak sits a quarter period, ,46=1.5, after the start of the cycle: C=1−1.5=−21sin peaks a quarter period after its midline crossing.
y=4cos(3π(x−1))+3=4sin(3π(x+21))+3Check: at x=1 the cosine is ,cos0=1, so ;y=7; at x=4 it is ,cosπ=−1, so .y=−1. In the sine form the arguments are 2π and ,23π, with the same values.
Problem 6
A model of the hours of daylight on day t of the year at a northern latitude is
H(t)=12+3sin(3652π(t−80)).
Give its period, midline and amplitude, and the daylight on day .172. On which days of the year does it give more than 14 hours?
Period 2π/3652π=365 days, midline 12 hours, amplitude 3 hoursThe model repeats every year, between 9 and 15 hours.
At :t=172: the argument is 3652π⋅92≈1.5837Close to .2π≈1.5708.
H(172)≈12+3(0.99992)≈15.00Day 172 is about June 21, the longest day: the peak is at .t=80+4365=171.25.
H(t)>14 when ,sinθ>32, with θ=3652π(t−80)Subtract ,12, divide by .3.
arcsin32≈0.7297<θ<π−0.7297≈2.4119On one cycle the sine is above 32 between the two angles where it equals .32.
,t−80=2π365θ, so 122.39<t<220.11Undo the scaling and the shift.
Period 365 days, midline 12 hours, amplitude 3 hours; H(172)≈15.00 hours; more than 14 hours from day 123 to day 220That is 98 whole days, from a stretch of about 97.7 days: H(122)≈13.98 and ,H(123)≈14.02,H(220)≈14.004 and .H(221)≈13.97.
Problem 7
A mains voltage is V(t)=170sin(120πt) volts, with t in seconds. Find its angular frequency, frequency, period and amplitude, and its root-mean-square value mean of V2 over one period.
Angular frequency B=120π≈376.99 radians per secondThe coefficient of .t.
Frequency B/(2π)=60 cycles per second, 60 HzOne cycle is 2π radians.
Period 1/60≈0.01667 sPeriod ,=2π/B, the reciprocal of the frequency.
Mean of sin2 over a period is 21,sin2u=21(1−cos2u), and cos2u averages to 0 over whole cycles.
120π≈377 rad/s, 60 Hz, period 601 s, amplitude 170 V, RMS 170/2≈120.2 VThe "120 volts" on a North American outlet is this RMS value; the peak is .170. Hertz count cycles, radians per second count angle, and they differ by .2π.
Problem 8
Find the period of .f(x)=sin(2x)+cos(3x). Is g(x)=sinx+sin(2x) periodic?
sin(2x) has period π and cos(3x) has period 32π2π/B for each.
If T is a period of ,f, it is one of f′′=−4sin(2x)−9cos(3x) tooDifferentiate f(x+T)=f(x) twice.
So T is a period of 9f+f′′=5sin(2x) and of 4f+f′′=−5cos(3x)Each combination cancels one term, so each term repeats on its own.
T=πj=32πk for positive integers ,j,,k, so ;3j=2k; the smallest is ,j=2,,k=3,T=2πA sinusoid repeats only after whole periods: 2π is the least common multiple of π and ,32π, and .f(x+2π)=f(x).
For :g: a period would need ,T=2πj=22πk, so 2=k/jThe same argument, with ,g′′=−sinx−2sin(2x), makes T a period of each term; but 2 is irrational, so no such ,j,k exist.
f has period ;2π;g is not periodicA sum of sinusoids is periodic exactly when the ratio of their frequencies is rational, and its period is the least common multiple of theirs. g comes close to repeating, but never exactly.
Problem 9
Start from .y=sinx. (a) Stretch the graph horizontally by a factor of ,4, then shift it π to the right. (b) Shift it π to the right, then stretch it horizontally by a factor of .4. Write each equation and give its phase shift.
A horizontal stretch by 4 replaces x with ;4x; a shift right by π replaces x with x−πEach moves the point that used to be at .x.
(a) Stretch: .sin4x. Then shift: sin4x−πThe shift replaces x in the current equation.
(b) Shift: .sin(x−π). Then stretch: sin(4x−π)=sin(41(x−4π))The stretch also stretches the shift that was already applied.
(a) ,y=sin(41(x−π)), phase shift ;π; (b) ,y=sin(41(x−4π)), phase shift ;4π; both have period 8πThe order matters for the shift but not the period. In Asin(B(x−C))+D the C is the shift applied last, after the stretch, which is why it is read with B factored out.
Problem 10
A transformer's sinusoidal positional encoding gives position p the features
PE(p,2i)PE(p,2i+1)=sin(ωip),=cos(ωip),
with ,ωi=10000−2i/d, for .i=0,…,d/2−1. With ,d=512, find the period in positions of pair ,i=0,i=128 and .i=255. Then show that for each pair there is a 2×2 matrix ,Rk, depending on k but not on ,p, that sends the pair at position p to the pair at position .p+k.
Pair i has period 2π/ωi=2π⋅100002i/dPeriod =2π/B with .B=ωi.
:i=0:;2π≈6.28;:i=128:2π⋅100001/2=200π≈628.32i/d=0 and .256/512=21.
:i=255:2π⋅10000510/512≈2π⋅9646.6≈60611The periods grow geometrically from 2π to almost .20000π.
With a=ωip and :b=ωik:sin(a+b)=cosbsina+sinbcosaThe sine sum formula.
cos(a+b)=−sinbsina+cosbcosaThe cosine sum formula.
Periods ,2π≈6.28,200π≈628.3 and about 60611 positions; Rk=[cosωik−sinωiksinωikcosωik] sends (sinωip,cosωip) to (sinωi(p+k),cosωi(p+k))Steps 4 and 5 are the two rows of Rk applied to ,(sina,cosa), and only b=ωik appears in .Rk. It is a rotation, so an offset of k positions is the same linear map wherever it happens. Fast pairs separate nearby positions; slow pairs tell far-apart positions apart.
Where this goes wrong
1. Reading the phase shift before factoring out B
The argument 2x−π/3 shows a π/3 in plain sight, and it is tempting to read it as the shift.
,y=2sin(2x−3π)+1, amplitude ,2, period πRight so far: Problem 2.
“sin(x−C) is shifted by ,C, so this is shifted by .3π.”The habit that causes the mistake: the rule holds only when the coefficient of x is .1.
Phase shift ,3π, first maximum at 3π+4π=127πAt x=127π the argument is ,67π−3π=65π, so ,y=2⋅21+1=2, not the maximum .3. Factoring gives :2(x−6π): the shift is 6π and the peak is at .125π.
2. Taking the period as 2πB
Larger B means more of something, and the period is the quantity it is easy to attach that to.
,y=3sin(4x)−1,B=4Right so far: Problem 1.
“The period of sinx is ,2π, and B scales it.”The slip: B scales the speed of the cycle, so it divides the period.
Period 2π⋅4=8πThe graph completes a cycle when 4x grows by ,2π, that is when x grows by .2π. The wrong period is 16 times too long, and a sketch with it shows one bump where there should be sixteen.
3. Taking the maximum as the amplitude
The amplitude is the "height" of a wave, and the maximum is the height that shows on a graph.
Maximum 7 at ,x=1, next minimum −1 at x=4Right so far: Problem 5.
“The amplitude is how high the wave goes: .7.”The habit that causes the mistake: the amplitude is measured from the midline, not from .y=0.
,A=7,D=3This curve reaches 3+7=10 and ,3−7=−4, neither of which the data shows. The amplitude is .27−(−1)=4. Taking the maximum works only when the midline is .y=0.
4. Dropping the midline's sign
The vertical shift is written last, and its sign is read the way the phase shift's is.
,y=3sin(4x)−1, amplitude 3Right so far: Problem 1.
“A vertical shift written −1 moves the graph by ,1, the same way x−C moves it by .C.”The analogy that causes the mistake: inside the argument a minus sign means a move in the positive direction, but outside it means what it says.
Midline ,y=1, range [−2,4]At ,x=8π, where ,sin(4x)=1, the function is ,3−1=2, not .4. The midline is y=−1 and the range .[−4,2].
5. Evaluating in degrees
Calculators keep the last mode they were in, and a daylight model is a natural place to think in degrees.
H(172)=12+3sin(1.5837)Right so far: Problem 6, step 2. The 2π in the formula means the argument is in radians.
“Type sin(1.5837) into the calculator.”The slip: the calculator is in degree mode.
H(172)≈12+3(0.0276)≈12.08 hoursThat is 1.5837 degrees, not radians. In radians sin(1.5837)≈0.99992 and .H(172)≈15.00. A result near the midline on the longest day of the year is the warning sign.