TExcelTAD
Home › Pre-Calculus, Geometry & Trigonometry › Trigonometric Equations

Trigonometric Equations

An identity holds for every angle; an equation like 2sin⁡x=12\sin x = 1 holds only for some. Because trig functions repeat, a trig equation usually has infinitely many solutions. This lesson shows how to find all of them, how to list those in a given interval, and how to check a computer algebra answer numerically.

One equation, infinitely many solutions

Solve 2sin⁡x−1=02\sin x - 1 = 0. First isolate the function: sin⁡x=12\sin x = \frac{1}{2}. On one turn [0,2π)[0, 2\pi) the unit circle has two points with height 12\frac{1}{2}: x=π6x = \frac{\pi}{6} (quadrant I) and x=5π6x = \frac{5\pi}{6} (quadrant II). Adding any whole number of turns gives the same points again, so the general solution is

x=π6+2kπorx=5π6+2kπ,k∈Z (any integer)x = \frac{\pi}{6} + 2k\pi \quad\text{or}\quad x = \frac{5\pi}{6} + 2k\pi, \qquad k \in \mathbb{Z}\ (\text{any integer})

The general recipe for the three basic equations, with α\alpha the principal value from the inverse function:

Equation Principal value General solution
sin⁡x=c\sin x = c, −1≤c≤1-1 \le c \le 1 α=arcsin⁡c\alpha = \arcsin c x=α+2kπx = \alpha + 2k\pi or x=π−α+2kπx = \pi - \alpha + 2k\pi
cos⁡x=c\cos x = c, −1≤c≤1-1 \le c \le 1 α=arccos⁡c\alpha = \arccos c x=±α+2kπx = \pm\alpha + 2k\pi
tan⁡x=c\tan x = c, any cc α=arctan⁡c\alpha = \arctan c x=α+kπx = \alpha + k\pi

If ∣c∣>1\lvert c \rvert > 1, sin⁡x=c\sin x = c and cos⁡x=c\cos x = c have no solutions. Tangent needs only one family because its period is π\pi.

Solving on an interval

Applications usually want solutions in a window, such as [0,2π)[0, 2\pi) or [0∘,360∘)[0^\circ, 360^\circ). Generate the general solution and keep the values that land in the window:

python · try it yourself
import math

def sin_solutions(c, lo, hi):
    """All x in [lo, hi) with sin x = c."""
    if abs(c) > 1:
        return []
    a = math.asin(c)
    out = set()
    for k in range(math.floor(lo / (2 * math.pi)) - 1, math.ceil(hi / (2 * math.pi)) + 2):
        for x in (a + 2 * k * math.pi, math.pi - a + 2 * k * math.pi):
            if lo <= x < hi:
                out.add(round(x, 12))
    return sorted(out)

print("sin x = 0.5 on [0, 2π):", [round(x / math.pi, 4) for x in sin_solutions(0.5, 0, 2 * math.pi)], "× π")
print("sin x = 0.5 on [0, 6π):", [round(x / math.pi, 4) for x in sin_solutions(0.5, 0, 6 * math.pi)], "× π")
print("sin x = -0.3 on [0, 360°):", [round(math.degrees(x), 3) for x in sin_solutions(-0.3, 0, 2 * math.pi)])
sin x = 0.5 on [0, 2π): [0.1667, 0.8333] × π
sin x = 0.5 on [0, 6π): [0.1667, 0.8333, 2.1667, 2.8333, 4.1667, 4.8333] × π
sin x = -0.3 on [0, 360°): [197.458, 342.542]

For sin⁡x=−0.3\sin x = -0.3, arcsin⁡\arcsin gives about −17.458°, which is outside the window; adding 360° gives 342.542°, and π−α\pi - \alpha gives 197.458°.

Harder equations: reduce to the basic ones

Quadratic in a trig function. Solve 2cos⁡2x−cos⁡x−1=02\cos^2 x - \cos x - 1 = 0 on [0,2π)[0, 2\pi). Substitute u=cos⁡xu = \cos x: 2u2−u−1=02u^2 - u - 1 = 0 factors as (2u+1)(u−1)=0(2u + 1)(u - 1) = 0, so cos⁡x=−12\cos x = -\frac{1}{2} or cos⁡x=1\cos x = 1. That gives x=2π3,4π3x = \frac{2\pi}{3}, \frac{4\pi}{3} and x=0x = 0.

Use an identity to get one function. Solve sin⁡2x=cos⁡x\sin 2x = \cos x on [0,2π)[0, 2\pi).

2sin⁡xcos⁡x=cos⁡x2sin⁡xcos⁡x−cos⁡x=0cos⁡x (2sin⁡x−1)=0cos⁡x=0→ x=π2,3π2sin⁡x=12→ x=π6,5π6\begin{aligned} 2\sin x\cos x &= \cos x \\ 2\sin x\cos x - \cos x &= 0 \\ \cos x\,(2\sin x - 1) &= 0 \\ \cos x &= 0 && \to\ x = \tfrac{\pi}{2}, \tfrac{3\pi}{2} \\ \sin x &= \tfrac{1}{2} && \to\ x = \tfrac{\pi}{6}, \tfrac{5\pi}{6} \end{aligned}

Note: Never divide both sides by cos⁡x\cos x here. Dividing throws away exactly the solutions where cos⁡x=0\cos x = 0. Move everything to one side and factor instead.

Multiple angles. For sin⁡3x=12\sin 3x = \frac{1}{2} on [0,2π)[0, 2\pi), solve for u=3xu = 3x first. Since xx runs over [0,2π)[0, 2\pi), uu runs over [0,6π)[0, 6\pi): three turns, so six solutions u=π6,5π6,13π6,17π6,25π6,29π6u = \frac{\pi}{6}, \frac{5\pi}{6}, \frac{13\pi}{6}, \frac{17\pi}{6}, \frac{25\pi}{6}, \frac{29\pi}{6}, and x=u/3x = u/3.

Computer algebra, checked numerically

SymPy's solveset handles many trig equations and can restrict to an interval. It is a great tool, but it is not infallible: for some equations it returns an incomplete set, or a ConditionSet that means "I could not solve this". The older solve returns only a few principal solutions. Always confirm with an independent numeric method, for example by scanning for sign changes and refining each with a root finder.

python · try it yourself
import numpy as np
import sympy as sp
from scipy.optimize import brentq

x = sp.Symbol("x", real=True)
expr = sp.sin(2 * x) - sp.cos(x)
exact = sp.solveset(expr, x, sp.Interval.Ropen(0, 2 * sp.pi))
print("solveset:", exact)
print("solve   :", sp.solve(expr, x))

f = sp.lambdify(x, expr, "numpy")
grid = np.linspace(0, 2 * np.pi, 19_999)   # odd spacing, so no grid point is exactly a root
vals = f(grid)
roots = [brentq(f, a, b) for a, b, fa, fb in zip(grid, grid[1:], vals, vals[1:]) if fa * fb < 0]
print("numeric :", [round(r / np.pi, 6) for r in roots], "× π")
print("same count?", len(roots) == len(exact))
solveset: {pi/6, pi/2, 5*pi/6, 3*pi/2}
solve   : [-pi/2, pi/6, pi/2, 5*pi/6]
numeric : [0.166667, 0.5, 0.833333, 1.5] × π
same count? True

Here everything agrees. Notice that solve returned −π2-\frac{\pi}{2} instead of 3π2\frac{3\pi}{2} and gave no general solution: it only lists some representatives. A sign-change scan has its own blind spot: a root where the graph only touches zero (like cos⁡x=1\cos x = 1 at x=0x = 0, where cos⁡x−1\cos x - 1 never changes sign) is invisible to it. Using two different methods is what makes the check trustworthy.

In software

  • Event timing. When does a lighthouse beam pointing at angle ωt\omega t first hit a ship at bearing β\beta? Solve ωt≡β(mod2π)\omega t \equiv \beta \pmod{2\pi}: t=(β+2πk)/ωt = (\beta + 2\pi k)/\omega for the smallest t≥0t \ge 0.
  • Threshold crossings. A day/night model brightness=sin⁡(2πt/24)\text{brightness} = \sin(2\pi t/24) crosses 0.5 at the times sin⁡=0.5\sin = 0.5 has solutions; a game spawns night monsters between those times.
  • Collision with oscillating objects. A platform at height 3+2sin⁡t3 + 2\sin t meets a player at height 4 when sin⁡t=12\sin t = \frac{1}{2}.
  • Robust solvers. Production code rarely solves trig equations symbolically; it uses closed-form general solutions like the table above, or bracketing root finders (bisection, Brent) on a known interval.

Exercises

Exercise 1: General solution

Find all solutions of 2cos⁡x+3=02\cos x + \sqrt{3} = 0, then list those in [0,2π)[0, 2\pi).

Answer

x=±5π6+2kπx = \pm\frac{5\pi}{6} + 2k\pi; in [0,2π)[0, 2\pi): 5π6\frac{5\pi}{6} and 7π6\frac{7\pi}{6}.

Solution
cos⁡x=−32,α=arccos⁡(−32)=5π6x=±5π6+2kπin [0,2π): 5π6, and −5π6+2π=7π6\begin{aligned} &\cos x = -\tfrac{\sqrt{3}}{2}, \quad \alpha = \arccos\left(-\tfrac{\sqrt{3}}{2}\right) = \tfrac{5\pi}{6} \\ &x = \pm\tfrac{5\pi}{6} + 2k\pi \\ &\text{in } [0, 2\pi)\text{: } \tfrac{5\pi}{6}, \text{ and } -\tfrac{5\pi}{6} + 2\pi = \tfrac{7\pi}{6} \end{aligned}

Exercise 2: Tangent

Solve tan⁡x=−1\tan x = -1 on [0∘,360∘)[0^\circ, 360^\circ).

Answer

135° and 315°.

Solution

arctan⁡(−1)=−45∘\arctan(-1) = -45^\circ, and tan⁡\tan has period 180°, so x=−45∘+180∘kx = -45^\circ + 180^\circ k. In the window: k=1k = 1 gives 135°, k=2k = 2 gives 315°.

Exercise 3: Quadratic type

Solve 2sin⁡2x+3sin⁡x+1=02\sin^2 x + 3\sin x + 1 = 0 on [0,2π)[0, 2\pi).

Answer

x=7π6,3π2,11π6x = \frac{7\pi}{6}, \frac{3\pi}{2}, \frac{11\pi}{6}.

Solution
(2sin⁡x+1)(sin⁡x+1)=0sin⁡x=−12→ x=7π6,11π6sin⁡x=−1→ x=3π2\begin{aligned} (2\sin x + 1)(\sin x + 1) &= 0 \\ \sin x &= -\tfrac{1}{2} && \to\ x = \tfrac{7\pi}{6}, \tfrac{11\pi}{6} \\ \sin x &= -1 && \to\ x = \tfrac{3\pi}{2} \end{aligned}
python · try it yourself
import sympy as sp
x = sp.Symbol("x", real=True)
print(sp.solveset(2*sp.sin(x)**2 + 3*sp.sin(x) + 1, x, sp.Interval.Ropen(0, 2*sp.pi)))
{7*pi/6, 3*pi/2, 11*pi/6}

Note that 3π2\frac{3\pi}{2} is a double-touch point of the graph (sin⁡x+1≥0\sin x + 1 \ge 0 never changes sign), so a sign-change scan alone would miss it.

Exercise 4: Multiple angle

Solve cos⁡2x=0\cos 2x = 0 on [0,2π)[0, 2\pi).

Answer

x=π4,3π4,5π4,7π4x = \frac{\pi}{4}, \frac{3\pi}{4}, \frac{5\pi}{4}, \frac{7\pi}{4}.

Solution

With u=2xu = 2x in [0,4π)[0, 4\pi): cos⁡u=0\cos u = 0 at u=π2,3π2,5π2,7π2u = \frac{\pi}{2}, \frac{3\pi}{2}, \frac{5\pi}{2}, \frac{7\pi}{2}. Divide by 2.

Exercise 5: Platform meets player

A platform's height is h(t)=3+2sin⁡th(t) = 3 + 2\sin t (metres, tt in seconds). Find every time in [0,10][0, 10] when it is at height 4, and confirm numerically with brentq.

Answer

t=π6,5π6,13π6,17π6≈0.5236,2.618,6.8068,8.9012 st = \frac{\pi}{6}, \frac{5\pi}{6}, \frac{13\pi}{6}, \frac{17\pi}{6} \approx 0.5236, 2.618, 6.8068, 8.9012\ \text{s}.

Solution

sin⁡t=12\sin t = \frac{1}{2}, so t=π6+2kπt = \frac{\pi}{6} + 2k\pi or 5π6+2kπ\frac{5\pi}{6} + 2k\pi. The next one, 25π6≈13.09\frac{25\pi}{6} \approx 13.09, is beyond 10.

python · try it yourself
import math
import numpy as np
from scipy.optimize import brentq

f = lambda t: 3 + 2 * math.sin(t) - 4
grid = np.linspace(0, 10, 1001)
roots = [brentq(f, a, b) for a, b in zip(grid, grid[1:]) if f(a) * f(b) < 0]
print([round(r, 4) for r in roots])
print([round(v, 4) for v in (math.pi/6, 5*math.pi/6, 13*math.pi/6, 17*math.pi/6)])
[0.5236, 2.618, 6.8068, 8.9012]
[0.5236, 2.618, 6.8068, 8.9012]

Test yourself

How many solutions does sin⁡x=0.8\sin x = 0.8 have in [0,2π)[0, 2\pi)?

  1. 0
  2. 1
  3. 2
  4. Infinitely many

Solving sin⁡xcos⁡x=cos⁡x\sin x\cos x = \cos x, a student divides by cos⁡x\cos x and gets sin⁡x=1\sin x = 1. What went wrong?

  1. Nothing, x=π/2x = \pi/2 is the only solution
  2. Dividing by cos⁡x\cos x lost the solutions where cos⁡x=0\cos x = 0
  3. They should have squared both sides
  4. sin⁡x=1\sin x = 1 has no solutions

What is the general solution of tan⁡x=3\tan x = \sqrt{3}?

  1. x=π/3+2kπx = \pi/3 + 2k\pi
  2. x=π/3+kπx = \pi/3 + k\pi
  3. x=±π/3+2kπx = \pm\pi/3 + 2k\pi
  4. x=π/6+kπx = \pi/6 + k\pi