Trigonometric Equation Roots Calculator

Enter sine and cosine coefficients through the second harmonic. Inspect the exact half-angle polynomial, the separate half-turn test and every periodic solution family.

Trigonometric equations

Solve a harmonic equation

Equation coefficients

a + b cos x + c sin x + d cos(2x) + e sin(2x) = 0

Use zero for an unused term. Enter a signed decimal or exact fraction such as −1/2.

Roots over one turn

Harmonic function through one turnThe function has 3 distinct roots in the half-open period. Filled circles are crossings and outlined diamonds are touches.−2.2402.240°90°180°270°360°Function valueAngle (degrees)
  • ● Crossing
  • ◇ Touching
  • Teal positive · orange negative

The reference turn includes 0 and excludes 360°. Add a whole turn to repeat a solution.

3 roots per period

Crossing · multiplicity 1

t ∈ (332819770519635731/576460752303423488, 665639541039271463/1152921504606846976]

Repeat this angle by adding 360° × k for any integer k.

Half-angle proof

Substitute t = tan(x/2)

P(t) = 2 − 6t²

Separate half-turn check

x = π is a root of multiplicity 2.

Exact root ledger and CSV
Root 1 · ≈ 60°
t ∈ (332819770519635731/576460752303423488, 665639541039271463/1152921504606846976] · order 1
Root 2 · 180°
No finite t at x = π · order 2
Root 3 · ≈ 300°
t ∈ (-665639541039271463/1152921504606846976, -332819770519635731/576460752303423488] · order 1

Interior signs

  • 0 to root 1 · Positive
  • Root 1 to root 2 · Negative
  • Root 2 to root 3 · Negative
  • Root 3 to 360° · Positive

How to use this calculator

  1. Move every term to one side and enter the constant and the four sine and cosine multipliers. Use zero for any unused term.
  2. Inspect the graph and root rows in degrees or radians. A crossing changes sign, while a touch keeps the same sign on both sides.
  3. Select a root to view its half-angle expression or rational bounds. Check the separate half-turn row for π.
  4. Add whole turns to any root to generate its full family. Open the proof ledger for the exact polynomial and signs between roots.

The Formula

The mathematical logic powering this calculation is:

Solve F(x) = a + b cos x + c sin x + d cos(2x) + e sin(2x) = 0. Set t = tan(x/2). The identities cos x = (1 − t²)/(1 + t²) and sin x = 2t/(1 + t²) express both harmonics with denominator (1 + t²)², which is positive when t is finite. The numerator coefficients, in ascending order, are a + b + d, 2c + 4e, 2a − 6d, 2c − 4e, a − b + d.

A square-free polynomial removes repeated factors for Sturm counting. Rational signs in each exact half-open bracket (lower, upper] separate every finite real root. Successive gcds with derivatives recover multiplicity. Brackets are at most 10⁻¹⁸ wide in t. A continued-fraction candidate with denominator at most 1,000,000 is labeled exact only after exact substitution, and dyadic roots found at bisection boundaries are also exact. Negative t maps to the second half of the reference turn after adding 2π.

At x = π the tangent substitution is undefined. The reciprocal coordinate v = 1/t reverses the degree-four numerator, so the root order at v = 0 is 4 minus the degree of the nonzero numerator. If all numerator coefficients vanish, every real angle is a solution. Odd multiplicity crosses the axis and even multiplicity touches it.

The reference domain is 0 ≤ x < 2π, equivalent to 0° ≤ x < 360°. Repeat solutions by adding integer multiples of 2π or 360°. A finite half-angle bracket identifies its root exactly. The reported angle, plotted positions and spacing of close roots use numerical approximations. Enter signed decimals with up to six decimal places or fractions with a positive denominator of up to six digits. Each coefficient has magnitude at most 1,000,000. The model explicitly reports if its bounded exact isolation cannot complete.

Worked Example

If you input:

  • Equation: cos x + cos(2x) = 0
  • Period: 0° ≤ x < 360°

Result:

The roots are 60°, 180° and 300°. At 180° the equation touches zero with multiplicity 2. The finite half-angle polynomial is 2 − 6t².

Frequently Asked Questions

Why does the solver test π separately?

The value tan(x/2) has no finite value at x = π. If the highest powers of the degree-four numerator vanish, their missing order identifies the root at that angle.

Why is a touch still counted as a solution?

The equation holds whenever its value is zero. A root of even multiplicity reaches zero and returns to the same side.

How do I list angles outside this period?

Add or subtract whole turns from each reference angle. If the expression is identically zero, every real angle solves it.

Why show a half-angle interval for an approximate angle?

The two rational endpoints prove where the unique finite half-angle root lies. That bracket distinguishes close roots even when their displayed angles round to the same label.

What happens at 360°?

It represents the same orientation as 0°. The half-open reference period includes 0° and excludes 360° to avoid displaying the same family twice.

Can the equation contain a third harmonic or tangent?

The worksheet accepts a constant plus sine and cosine of x and 2x. Other frequencies and functions require a different transformation.

Similar Calculators