Skip to content

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

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,

acosx+bsinx=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(cosxcosα+sinxsinα)=(Rcosα)cosx+(Rsinα)sinx.\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 acosx+bsinxa\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(cos2α+sin2α)=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 3cosx+33sinx3\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

3cosx+33sinx=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 5cosx+12sinx-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

tan1(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

5cosx+12sinx=13cos(x1.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 4cosx4sinx4\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

4cosx4sinx=42cos(x7π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

acosx+bsinx=Rsin(x+β).a\cos x+b\sin x=R\sin(x+\beta).

Expanding gives

Rsin(x+β)=(Rsinβ)cosx+(Rcosβ)sinx,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 5cosx53sinx5\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

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

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

Racosx+bsinxR.\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

cRc+acosx+bsinxc+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+8cosx+6sinx,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 α=tan1(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=α=tan1(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 710=37-10=-3, first attained at

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

Therefore

maxf=17,minf=3.\boxed{\max f=17,\qquad \min f=-3.}

Find the range of 23cosx+4sinx2-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

53cosx+4sinx5,-5\leq-3\cos x+4\sin x\leq5,

and adding 22 gives

323cosx+4sinx7.\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

3cosx+4sinx=2,0x<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,α=tan1(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=±cos1(25)+2kπ.y=\pm\cos^{-1}\left(\frac25\right)+2k\pi.

Therefore

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

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

x0.9273+1.1593=2.0866x\approx0.9273+1.1593=2.0866

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

x0.92731.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

5cosx12sinx=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

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

Since

cosx+sinx=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)=154cos(π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 155=10C15-5=10^\circ\text{C} and a maximum of 15+5=20C15+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:

α=πtan1(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π(πtan1(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=a2b2R^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, acosx+bsin2xa\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 [cR,c+R][c-R,c+R].
  1. Write 8cosx6sinx-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+5cosx+12sinx4+5\cos x+12\sin x.
  3. Solve 2cosx2sinx=12\cos x-2\sin x=1 for 0x<2π0\leq x<2\pi, giving answers to three decimal places.
  4. Explain why 3cosx+4sinx=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:

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

    Therefore

    8cosx6sinx=10cos(xπtan1(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=413=9.\boxed{\max=4+13=17,\qquad \min=4-13=-9.}
  3. Use

    2cosx2sinx=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.