Solving quadratic trig equations

The Endeavour 2022-11-14

A few days ago I wrote about how to systematically solve trig equations. That post was abstract and general. This post will be concrete and specific, looking at the special case of quadratic equations in sines and cosines, i.e. any equation of the form

A \sin^2\theta + B \cos^2\theta + C \sin\theta + D \cos\theta + E \sin\theta \cos\theta + F = 0

As outlined earlier, we turn the equation into a system of equations in s and c.

\begin{align*} A s^2 + B c^2 + C s + D c + E s c + F &= 0 \\ s^2 + c^2 - 1 &= 0 \end{align*}

The resultant of

A s^2 + B c^2 + C s + D c + E s c + F

and

s^2 + c^2 - 1

as a function of sis

\alpha s^4 + \beta s^3 + \gamma s^2 + \delta s + \epsilon

where

\begin{align*} \alpha &= A^2 - 2AB + B^2 + E^2 \\ \beta &= 2AC - 2BC + 2DE \\ \gamma &= 2AB - 2B^2 + C^2 + D^2 - e^2 + 2AF - 2BF \\ \delta &= 2BC - 2DE + 2CF \\ \epsilon &= B^2 - D^2 + 2BF + F^2 \end{align*}

Example 1

Let’s look at a particular example. Suppose we want to solve

11 \sin ^2\theta +14 \cos ^2\theta + 20 \sin\theta +22 \cos \theta+100 \sin \theta \cos \theta = 0

Then the possible sine values are the roots of

 10009 s^4 + 4280 s^3 - 9200 s^2 - 3840 s -288 = 0

This equation as four real roots: s = -0.993462, -0.300859, -0.0996236, or 0.966329.

So any solution θ to our original equation must have sine equal to one of these values. Now sine takes on each value twice during each period, so we have a little work left to find the values of θ. Take the last root for example. If we take the arcsine of 0.966329 we get 1.31056, and θ = 1.31056 is not a solution to our equation. But arcsin(y) returns only one possible solution to the equation sin(x) = y. In this case, θ = π – 1.31056 is the solution we’re looking for.

The full set of solutions for 0 ≤ θ < 2π are

\begin{align*} \theta  &= \phantom{2}\pi - \arcsin(-0.993462) = 4.59798 \\ \theta  &= 2\pi + \arcsin(-0.300859) = 5.97759 \\ \theta &= \phantom{2}\pi - \arcsin(-0.099623) = 3.24138 \\ \theta &= \phantom{2}\pi - \arcsin(\phantom{-}0.966329) = 1.83103 \end{align*}

In the example above our polynomial in s had four real roots in [-1, 1]. In general we could have roots outside this interval, including complex roots. If we’re looking for solutions with real values of θ then we discard these.

Example 2

Now suppose we want to solve

11 \sin ^2\theta +14 \cos ^2\theta + 20 \sin\theta +22 \cos \theta+100 \sin \theta \cos \theta -50 = 0

Our resultant is

10009s^4 +4280s^3 -8900s^2 - 5840s + 812

and the roots are 0.119029, 0.987302, and -0.766973 ± 0.319513i.

If we’re only interested in real values of θ then the two solutions are arcsin(0.119029) = 0.119312 and arcsin(0.987302) = 1.41127. But there are two complex solutions, θ = 3.91711 ± 0.433731i.

The post Solving quadratic trig equations first appeared on John D. Cook.