White H House of Math logo on multicolored square

Learning Tools

Curriculum

Curriculum

Curriculum

Log in

Transforming into a Harmonic Oscillator

You might come across situations where you need to transform functions that contain both sines and cosines into harmonic oscillators. Then you will need to use this formula:

Formula

Transforming into a Harmonic Oscillator

a sin ⁡ cx + b cos ⁡ cx = A sin ⁡ (cx + ϕ) = A cos ⁡ (cx + ϕ∗) where A = a2 + b2 tan ⁡ ϕ = b a ϕ∗ = ϕ −π 2

and ϕ is in the same quadrant as the point (a,b). You can decide which quadrant an angle ϕ is in by comparing it to π 2, π, 3π 2 and 2π.

Note! It’s often useful to draw the unit circle to be sure that the value you have found for ϕ is in the correct quadrant.

When you are solving equations in the form

a sin ⁡ cx + b cos ⁡ cx = d

it’s a good idea to rewrite the left-hand side to fit the form A sin ⁡ (cx + ϕ).

Example 1

Rewrite the expression sin ⁡ 2x − 4 cos ⁡ 2x into a harmonic oscillator with sine as the base function: f(x) = A sin ⁡ (cx + ϕ)

To rewrite the equation, you have to find the amplitude A and the phase ϕ first. The amplitude A is

A = a2 + b2 = 12 + (−4)2 = 17.

When you’re finding the phase, you need to take the signs of a (x-axis) and b (y-axis) into account. As a > 0 and b < 0, you can see that (a,b) is in the fourth quadrant. That means you find the phase like this:

tan ⁡ ϕ = b a = − 4 1 ϕ = tan ⁡ −1(−4) ≈−1.33 + nπ

As −π 2 < −1.33 < 0, − 1.33 is the value for ϕ you’re looking for. That makes the equation look like this on the form of a harmonic oscillator:

17 sin ⁡ (2x − 1.33)

Example 2

Solve the equation

3 sin ⁡ 2x + 4 cos ⁡ 2x = 1x ∈ ℝ

First, you find A:

A = a2 + b2 = 32 + 42 = 5

Then you find ϕ:

tan ⁡ ϕ = b a = 4 3, ϕ = tan ⁡ −1 (4 3) ≈ 0.93 + nπ

You get that ϕ ≈ 0.93 + n ⋅ π. As a > 0 and b > 0, ϕ has to be in the first quadrant, and because 0 < 0.93 < π 2 ≈ 1.57, you get ϕ = 0.93. That gives you

5 sin ⁡ (2x + 0.93) = 1 sin ⁡ (2x + 0.93) = 0.2

This equation has the solutions

2x1 + 0.93 = sin ⁡ −10.2 + n ⋅ 2π ≈ 0.2 + n ⋅ 2π 2x2 + 0.93 = (π − sin ⁡ −1(0.2)) + n ⋅ 2π ≈ (π − 0.2) + n ⋅ 2π

That gives you these two solutions:

x1 ≈−0.365 + n ⋅ π x2 ≈ 1.01 + n ⋅ π

Example 3

Rewrite the expression 2 sin ⁡ x + 3 cos ⁡ x as a harmonic oscillator with the cosine as the base function: f(x) = A cos ⁡ (cx + ϕ∗)

Note! When you want to make a cosine function, you need to subtract π 2 from the value you find for ϕ with the tan ⁡ function. You get ϕ∗ = ϕ −π 2.

First, you find the amplitude A:

A = a2 + b2 = 22 + 32 = 13

When you’re finding the phase, you need to take the sign of a (x-axis) and b (y-axis) into account. As a > 0 and b > 0, you are in the first quadrant, and you can find the phase like this:

tan ⁡ ϕ = b a = 3 2, ϕ = tan ⁡ −1 (3 2) ≈ 0.98 + nπ

Because 0 < 0.98 < π 2, 0.98 is the value for ϕ you need to subtract π 2 from. You get

ϕ∗ = 0.98 −π 2 ≈ 0.59

That means the harmonic oscillator is

13 cos ⁡ (x − 0.59)

Example 4

Solve the equation

4 sin ⁡ 2x − 2 cos ⁡ 2x = 1x ∈ ℝ

First, you find A and ϕ∗ to let you use the formula for the harmonic oscillator:

A = a2 + b2 = 42 + (−2)2 = 20 tan ⁡ ϕ = b a = − 2 4 = −1 2 ϕ = tan ⁡ −1 (−1 2) ≈−0.46 + nπ

A = a2 + b2 = 42 + (−2)2 = 20 tan ⁡ ϕ = b a = − 2 4 = −1 2 ϕ = tan ⁡ −1 (−1 2) ≈−0.46 + nπ

As a > 0 and b < 0, ϕ is in the fourth quadrant, and because

−π 2 ≈−1.57 < −0.46 < 0

you can use

ϕ∗ = −0.46 −π 2 ≈−2.03

You get

20 cos ⁡ (2x − 2.03) = 1| ÷20 cos ⁡ (2x − 2.03) = 0.22 2x − 2.03 = cos ⁡ −1(0.22)

This base equation has the solutions

2x1 − 2.03 = cos ⁡ −1(0.22) + n ⋅ 2π ≈ 1.35 + n ⋅ 2π 2x2 − 2.03 = − cos ⁡ −1(0.22) + n ⋅ 2π ≈−1.35 + n ⋅ 2π

Solving these equations gives you

x1 ≈ 1.69 + nπ x2 ≈ 0.34 + nπ

These are the solutions to the equation, as there are no restrictions on x.