Skip to content

Harmonic form: writing a cos x + b sin x as R cos(x minus alpha)

By MathLab · Reviewed

Harmonic form combines a sine term and a cosine term of the same angle into one shifted trigonometric function. For real constants aa and bb, not both zero,

acos⁡x+bsin⁡x=Rcos⁡(x−α),a\cos x+b\sin x=R\cos(x-\alpha),

where

R=a2+b2,Rcos⁡α=a,Rsin⁡α=b.\boxed{R=\sqrt{a^2+b^2}}, \qquad \boxed{R\cos\alpha=a}, \qquad \boxed{R\sin\alpha=b}.

The number R>0R>0 is the amplitude and α\alpha is the phase shift. This form makes ranges, maximum and minimum values, equations and periodic models much easier to analyse.

You should be able to:

Expand the proposed form:

Rcos⁡(x−α)=R(cos⁡xcos⁡α+sin⁡xsin⁡α)=(Rcos⁡α)cos⁡x+(Rsin⁡α)sin⁡x.\begin{aligned} R\cos(x-\alpha) &=R(\cos x\cos\alpha+\sin x\sin\alpha)\\ &=(R\cos\alpha)\cos x+(R\sin\alpha)\sin x. \end{aligned}

For this to equal acos⁡x+bsin⁡xa\cos x+b\sin x for every xx, corresponding coefficients must match:

Rcos⁡α=a,Rsin⁡α=b.R\cos\alpha=a, \qquad R\sin\alpha=b.

Squaring and adding gives

R2(cos⁡2α+sin⁡2α)=a2+b2,R^2(\cos^2\alpha+\sin^2\alpha)=a^2+b^2,

so R2=a2+b2R^2=a^2+b^2. By convention RR is positive, hence R=a2+b2R=\sqrt{a^2+b^2}.

The coefficient pair (a,b)(a,b) can be regarded as a vector of length RR making angle α\alpha with the positive horizontal axis. This explains both the Pythagorean formula for RR and why the signs of aa and bb determine the quadrant of α\alpha.

Use this reliable procedure:

  1. Write Rcos⁡(x−α)R\cos(x-\alpha) and expand it.
  2. Match Rcos⁡α=aR\cos\alpha=a and Rsin⁡α=bR\sin\alpha=b.
  3. Calculate R=a2+b2R=\sqrt{a^2+b^2}.
  4. Find α\alpha in the quadrant fixed by the signs of aa and bb.
  5. Check by expanding your answer.

Write 3cos⁡x+33sin⁡x3\cos x+3\sqrt3\sin x in the form Rcos⁡(x−α)R\cos(x-\alpha), where R>0R>0 and 0≤α<2π0\leq\alpha<2\pi.

Coefficient matching gives

Rcos⁡α=3,Rsin⁡α=33.R\cos\alpha=3, \qquad R\sin\alpha=3\sqrt3.

Therefore

R=32+(33)2=36=6.R=\sqrt{3^2+(3\sqrt3)^2}=\sqrt{36}=6.

Both coefficients are positive, so α\alpha is in the first quadrant. Also

cos⁡α=36=12,sin⁡α=336=32,\cos\alpha=\frac36=\frac12, \qquad \sin\alpha=\frac{3\sqrt3}{6}=\frac{\sqrt3}{2},

giving α=π/3\alpha=\pi/3. Hence

3cos⁡x+33sin⁡x=6cos⁡(x−π3).\boxed{3\cos x+3\sqrt3\sin x=6\cos\left(x-\frac\pi3\right).}

Worked example 2: a phase angle in another quadrant

Section titled “Worked example 2: a phase angle in another quadrant”

Write −5cos⁡x+12sin⁡x-5\cos x+12\sin x as Rcos⁡(x−α)R\cos(x-\alpha), with 0≤α<2π0\leq\alpha<2\pi. Give α\alpha to three decimal places.

First,

R=(−5)2+122=13.R=\sqrt{(-5)^2+12^2}=13.

Since Rcos⁡α=−5R\cos\alpha=-5 and Rsin⁡α=12R\sin\alpha=12, cosine is negative while sine is positive. Thus α\alpha lies in the second quadrant. The reference angle is

tan⁡−1(125)≈1.176.\tan^{-1}\left(\frac{12}{5}\right)\approx1.176.

Therefore

α=π−1.176…=1.966…,\alpha=\pi-1.176\ldots=1.966\ldots,

and

−5cos⁡x+12sin⁡x=13cos⁡(x−1.966)\boxed{-5\cos x+12\sin x=13\cos(x-1.966)}

to three decimal places. The common incorrect answer α=−1.176\alpha=-1.176 has both sine and cosine negative after coefficient matching, so it cannot work.

Write 4cos⁡x−4sin⁡x4\cos x-4\sin x in the form Rcos⁡(x−α)R\cos(x-\alpha), where R>0R>0 and 0≤α<2π0\leq\alpha<2\pi.

Answer

Here R=42+(−4)2=42R=\sqrt{4^2+(-4)^2}=4\sqrt2. Cosine is positive and sine is negative, so α\alpha is in the fourth quadrant. Hence α=7π/4\alpha=7\pi/4 and

4cos⁡x−4sin⁡x=42cos⁡(x−7π4).\boxed{4\cos x-4\sin x=4\sqrt2\cos\left(x-\frac{7\pi}{4}\right).}

Equivalently, allowing a negative phase angle,

42cos⁡(x+π4)4\sqrt2\cos\left(x+\frac\pi4\right)

is the same expression.

The same expression may instead be written as

acos⁡x+bsin⁡x=Rsin⁡(x+β).a\cos x+b\sin x=R\sin(x+\beta).

Expanding gives

Rsin⁡(x+β)=(Rsin⁡β)cos⁡x+(Rcos⁡β)sin⁡x,R\sin(x+\beta)=(R\sin\beta)\cos x+(R\cos\beta)\sin x,

so

Rsin⁡β=a,Rcos⁡β=b.\boxed{R\sin\beta=a}, \qquad \boxed{R\cos\beta=b}.

Notice that these coefficients occur in the opposite order from cosine harmonic form.

Write 5cos⁡x−53sin⁡x5\cos x-5\sqrt3\sin x as Rsin⁡(x+β)R\sin(x+\beta), where R>0R>0 and −π<β≤π-\pi<\beta\leq\pi.

We need

Rsin⁡β=5,Rcos⁡β=−53.R\sin\beta=5, \qquad R\cos\beta=-5\sqrt3.

Thus R=10R=10. Since sine is positive and cosine is negative, β\beta is in the second quadrant. The exact values

sin⁡β=12,cos⁡β=−32\sin\beta=\frac12, \qquad \cos\beta=-\frac{\sqrt3}{2}

give β=5π/6\beta=5\pi/6. Therefore

5cos⁡x−53sin⁡x=10sin⁡(x+5π6).\boxed{5\cos x-5\sqrt3\sin x=10\sin\left(x+\frac{5\pi}{6}\right).}

Since −1≤cos⁡(x−α)≤1-1\leq\cos(x-\alpha)\leq1,

−R≤acos⁡x+bsin⁡x≤R.\boxed{-R\leq a\cos x+b\sin x\leq R.}

Both endpoints are attained when xx is unrestricted. If a constant cc is added, then

c−R≤c+acos⁡x+bsin⁡x≤c+R.\boxed{c-R\leq c+a\cos x+b\sin x\leq c+R.}

Worked example 4: maximum, minimum and where they occur

Section titled “Worked example 4: maximum, minimum and where they occur”

Find the maximum and minimum values of

f(x)=7+8cos⁡x+6sin⁡x,f(x)=7+8\cos x+6\sin x,

and find the smallest non-negative xx at which each occurs.

Here

R=82+62=10,tan⁡α=68=34.R=\sqrt{8^2+6^2}=10, \qquad \tan\alpha=\frac68=\frac34.

Both coefficients are positive, so α=tan⁡−1(3/4)\alpha=\tan^{-1}(3/4). Thus

f(x)=7+10cos⁡(x−α).f(x)=7+10\cos(x-\alpha).

The maximum occurs when cos⁡(x−α)=1\cos(x-\alpha)=1:

x−α=2kπ.x-\alpha=2k\pi.

Its value is 7+10=177+10=17, first attained at

x=α=tan⁡−1(34).x=\alpha=\tan^{-1}\left(\frac34\right).

The minimum occurs when cos⁡(x−α)=−1\cos(x-\alpha)=-1:

x−α=(2k+1)π.x-\alpha=(2k+1)\pi.

Its value is 7−10=−37-10=-3, first attained at

x=π+tan⁡−1(34).x=\pi+\tan^{-1}\left(\frac34\right).

Therefore

max⁡f=17,min⁡f=−3.\boxed{\max f=17,\qquad \min f=-3.}

Find the range of 2−3cos⁡x+4sin⁡x2-3\cos x+4\sin x for unrestricted real xx.

Answer

The amplitude is

R=(−3)2+42=5.R=\sqrt{(-3)^2+4^2}=5.

Therefore

−5≤−3cos⁡x+4sin⁡x≤5,-5\leq-3\cos x+4\sin x\leq5,

and adding 22 gives

−3≤2−3cos⁡x+4sin⁡x≤7.\boxed{-3\leq2-3\cos x+4\sin x\leq7.}

Once two terms have been combined, solve the resulting single trigonometric equation. Keep the phase angle unrounded until the final answer.

Worked example 5: all solutions in an interval

Section titled “Worked example 5: all solutions in an interval”

Solve

3cos⁡x+4sin⁡x=2,0≤x<2π.3\cos x+4\sin x=2, \qquad 0\leq x<2\pi.

Write the left side as 5cos⁡(x−α)5\cos(x-\alpha), where

cos⁡α=35,sin⁡α=45,α=tan⁡−1(43).\cos\alpha=\frac35, \qquad \sin\alpha=\frac45, \qquad \alpha=\tan^{-1}\left(\frac43\right).

The equation becomes

cos⁡(x−α)=25.\cos(x-\alpha)=\frac25.

Let y=x−αy=x-\alpha. The general cosine solutions are

y=±cos⁡−1(25)+2kπ.y=\pm\cos^{-1}\left(\frac25\right)+2k\pi.

Therefore

x=α±cos⁡−1(25)+2kπ.x=\alpha\pm\cos^{-1}\left(\frac25\right)+2k\pi.

Numerically, α≈0.9273\alpha\approx0.9273 and cos⁡−1(2/5)≈1.1593\cos^{-1}(2/5)\approx1.1593. Selecting values in 0≤x<2π0\leq x<2\pi gives

x≈0.9273+1.1593=2.0866x\approx0.9273+1.1593=2.0866

and, using k=1k=1 for the negative branch,

x≈0.9273−1.1593+2π=6.0512.x\approx0.9273-1.1593+2\pi=6.0512.

Hence

x=2.087 or x=6.051\boxed{x=2.087\text{ or }x=6.051}

to three decimal places.

Worked example 6: proving an equation has no solution

Section titled “Worked example 6: proving an equation has no solution”

Determine whether

5cos⁡x−12sin⁡x=145\cos x-12\sin x=14

has any real solutions.

The amplitude of the left side is

R=52+(−12)2=13.R=\sqrt{5^2+(-12)^2}=13.

Therefore its range is [−13,13][-13,13]. Since 1414 lies outside this range, the equation has

no real solutions.\boxed{\text{no real solutions}.}

This range check should come before any inverse trigonometric calculation.

Solve

cos⁡x+sin⁡x=1,0≤x<2π.\cos x+\sin x=1, \qquad 0\leq x<2\pi.
Answer

Since

cos⁡x+sin⁡x=2cos⁡(x−π4),\cos x+\sin x=\sqrt2\cos\left(x-\frac\pi4\right),

we solve

cos⁡(x−π4)=12.\cos\left(x-\frac\pi4\right)=\frac1{\sqrt2}.

Thus

x−π4=±π4+2kπ,x-\frac\pi4=\pm\frac\pi4+2k\pi,

which gives

x=0 or x=π2.\boxed{x=0\text{ or }x=\frac\pi2.}

An expression such as

M+Acos⁡(ωt)+Bsin⁡(ωt)M+A\cos(\omega t)+B\sin(\omega t)

has midline MM, amplitude A2+B2\sqrt{A^2+B^2} and period 2π/∣ω∣2\pi/|\omega|. Harmonic form also identifies the time shift. The two trigonometric terms must have the same angle before they can be combined directly.

A model for the temperature, in degrees Celsius, tt hours after midnight is

T(t)=15−4cos⁡(πt12)+3sin⁡(πt12).T(t)=15-4\cos\left(\frac{\pi t}{12}\right)+3\sin\left(\frac{\pi t}{12}\right).

Let x=πt/12x=\pi t/12. The oscillating part has amplitude

R=(−4)2+32=5.R=\sqrt{(-4)^2+3^2}=5.

Hence the model predicts a minimum of 15−5=10∘C15-5=10^\circ\text{C} and a maximum of 15+5=20∘C15+5=20^\circ\text{C}.

For cosine form, cos⁡α=−4/5\cos\alpha=-4/5 and sin⁡α=3/5\sin\alpha=3/5, so α\alpha is in the second quadrant:

α=π−tan⁡−1(34).\alpha=\pi-\tan^{-1}\left(\frac34\right).

Thus

T(t)=15+5cos⁡(πt12−α).T(t)=15+5\cos\left(\frac{\pi t}{12}-\alpha\right).

The first maximum after midnight occurs when the cosine argument is zero:

πt12=α.\frac{\pi t}{12}=\alpha.

Therefore

t=12π(π−tan⁡−1(34))≈9.54.t=\frac{12}{\pi}\left(\pi-\tan^{-1}\left(\frac34\right)\right)\approx9.54.

The predicted maximum occurs about 9.549.54 hours after midnight, approximately 09:32.

  • Using R=a+bR=a+b. The amplitude is a2+b2\sqrt{a^2+b^2} because the coefficients are perpendicular components.
  • Writing R2=a2−b2R^2=a^2-b^2. Squaring and adding the matched equations always produces a sum.
  • Forgetting the sign in the compound angle. cos⁡(x−α)\cos(x-\alpha) produces a positive sine coefficient, while cos⁡(x+α)\cos(x+\alpha) produces a negative one.
  • Accepting the calculator’s first arctangent value. Use the signs of both matched coefficients to select the quadrant.
  • Rounding α\alpha too early. Store the full calculator value and round only final numerical answers.
  • Combining different frequencies. In general, acos⁡x+bsin⁡2xa\cos x+b\sin 2x cannot be written as one sinusoid because the angles are different.
  • Assuming RR is the maximum after a vertical shift. The range of c+Rcos⁡(x−α)c+R\cos(x-\alpha) is [c−R,c+R][c-R,c+R].
  1. Write −8cos⁡x−6sin⁡x-8\cos x-6\sin x as Rcos⁡(x−α)R\cos(x-\alpha), where 0≤α<2π0\leq\alpha<2\pi.
  2. Find the exact maximum and minimum values of 4+5cos⁡x+12sin⁡x4+5\cos x+12\sin x.
  3. Solve 2cos⁡x−2sin⁡x=12\cos x-2\sin x=1 for 0≤x<2π0\leq x<2\pi, giving answers to three decimal places.
  4. Explain why 3cos⁡x+4sin⁡x=63\cos x+4\sin x=6 has no real solution.
Answers
  1. R=10R=10. Both matched coefficients are negative, so α\alpha is in the third quadrant:

    α=π+tan⁡−1(34).\alpha=\pi+\tan^{-1}\left(\frac34\right).

    Therefore

    −8cos⁡x−6sin⁡x=10cos⁡(x−π−tan⁡−1(34)).\boxed{-8\cos x-6\sin x=10\cos\left(x-\pi-\tan^{-1}\left(\frac34\right)\right).}
  2. The amplitude is 52+122=13\sqrt{5^2+12^2}=13, so

    max⁡=4+13=17,min⁡=4−13=−9.\boxed{\max=4+13=17,\qquad \min=4-13=-9.}
  3. Use

    2cos⁡x−2sin⁡x=22cos⁡(x+π4).2\cos x-2\sin x=2\sqrt2\cos\left(x+\frac\pi4\right).

    Then

    cos⁡(x+π4)=122.\cos\left(x+\frac\pi4\right)=\frac1{2\sqrt2}.

    Selecting the solutions in the stated interval gives

    x=0.424 or x=4.288.\boxed{x=0.424\text{ or }x=4.288.}
  4. The amplitude is 32+42=5\sqrt{3^2+4^2}=5, so the left side can only lie between −5-5 and 55. Since 6>56>5, there is no real solution.