Mathematics RU

Solver

Trigonometric equation solver with roots picked in an interval

Type an equation, and the solver finds every family of roots, shows them on the unit circle and, if you like, picks out the roots in an interval, as school-leaving exams often require.

Loading the solver…

What you can type

Functions are written as in a textbook: sin, cos, tan (or tg), cot (or ctg); the number $\pi$ is pi or π; the square of a sine is sin^2 x. An argument without brackets is read up to the nearest sign: sin 2x is $\sin 2x$, but sin x/2 is $\frac{\sin x}{2}$, so put a fractional argument in brackets: cos(x/2). Angles are in radians.

To pick out roots, add an interval after the equation: … on [3pi/2, 3pi], …, x ∈ [0, 2pi] or just …; [-pi, pi]. The solver also understands the whole two-part task as exam papers often print it: “a) Solve the equation … b) Find the roots in the interval …”.

The basic equations

Every trigonometric equation eventually comes down to one or more basic ones: $\sin t = a$, $\cos t = a$, $\tan t = a$. Their solutions can be seen on the unit circle. The sine of an angle is the $y$-coordinate of a point on the circle, so the roots of $\sin t = a$ are the angles of the points where the horizontal line $y = a$ crosses the circle. If $|a| > 1$ the line misses, and there are no roots. If $|a| < 1$ there are two points: the angle $t_0 = \arcsin a$ and its mirror image $\pi - t_0$. Any number of full turns can be added to each.

The principal value: the angle in $\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$ whose sine is $a$. For values from the table it’s a familiar angle; for the rest, the answer is written with $\arcsin$. For even $n$ the factor is $1$, for odd $n$ it’s $-1$. Even $n$ give the family $t_0 + 2\pi k$, odd $n$ the family $\pi - t_0 + 2\pi k$: the formula glues the two families into one line. (English textbooks usually write the two families separately.) The step round the circle. Together with the change of sign, it takes one point to the other. Example: $\sin t = \frac{1}{2}$. Here $\arcsin \frac{1}{2} = \frac{\pi}{6}$, and the formula gives $t = \frac{\pi}{6} + 2\pi k$ (even $n$) and $t = -\frac{\pi}{6} + \pi(2k + 1) = \frac{5\pi}{6} + 2\pi k$ (odd $n$). Check: $\sin \frac{5\pi}{6} = \sin\left(\pi - \frac{\pi}{6}\right) = \frac{1}{2}$.

For cosine it’s the same, but the line is vertical, $x = a$, and the points are mirror images in the $x$-axis: $t = \pm\arccos a + 2\pi n$. The tangent repeats every $\pi$, so the equation $\tan t = a$ has one family: $t = \arctan a + \pi n$, for any $a$. The special cases are remembered separately, from the picture: $\sin t = 0$ at $t = \pi n$, $\cos t = 0$ at $t = \frac{\pi}{2} + \pi n$, and $\sin t = 1$ only at the top point, $t = \frac{\pi}{2} + 2\pi n$.

If the function is applied not to $x$ but to an expression, as in $\cos\left(3x - \frac{\pi}{4}\right) = 0$, first solve the equation for the whole argument: $3x - \frac{\pi}{4} = \frac{\pi}{2} + \pi n$. Then solve for $x$, and don’t forget to divide the period as well: $x = \frac{\pi}{4} + \frac{\pi n}{3}$.

How to reduce an equation to a basic one

  • Substitution. If the equation is a polynomial in one function, $2\sin^2 x - \sin x - 1 = 0$, write $t = \sin x$, solve the quadratic and throw away values with $|t| > 1$. When $\sin^2 x$ and $\cos x$ are mixed, first replace $\sin^2 x = 1 - \cos^2 x$.
  • Factorising. A product is zero when at least one factor is zero: $\sin x(2\sin x - 1) = 0$ splits into $\sin x = 0$ and $\sin x = \frac{1}{2}$.
  • Homogeneous equations. Divide $\sin^2 x - 3\sin x\cos x + 2\cos^2 x = 0$ by $\cos^2 x$ and you get a quadratic in $\tan x$. No roots are lost: if $\cos x = 0$, the equation also demands $\sin x = 0$, and that never happens.
  • An auxiliary angle. Write $a\sin x + b\cos x$ as $\sqrt{a^2 + b^2}\,\sin(x + \varphi)$.
  • Double-angle and sum formulas. $\sin 2x = 2\sin x\cos x$, $\cos 2x = 1 - 2\sin^2 x$, $\sin a + \sin b = 2\sin\frac{a + b}{2}\cos\frac{a - b}{2}$ bring the arguments to a single one.
  • The same function of different arguments. $\sin A = \sin B$ is equivalent to $A = B + 2\pi n$ or $A = \pi - B + 2\pi n$; $\cos A = \cos B$ to $A = \pm B + 2\pi n$; a cosine can be rewritten as a sine by $\cos\beta = \sin\left(\frac{\pi}{2} - \beta\right)$.

If the equation contains a tangent, a cotangent or a fraction, write down where it’s defined: the denominator must not be zero. Points where it vanishes are thrown out of the families, and sometimes a family has to be split into parts.

Picking roots in an interval

In a typical exam problem, after the general solution you’re asked for the roots in an interval. There are two ways, and the solver shows both. The first is the circle: mark the arc that corresponds to the interval and walk along it from start to end, collecting the points of the families and labelling their actual values, turns included. The second is a double inequality: for a family $x = x_0 + Tn$, solve $a \le x_0 + Tn \le b$ for the integer $n$. If the interval is longer than $2\pi$, the circle is traversed more than once, and then the inequality or a number line is more reliable.

Worked examples

Example 1. Substitution and picking roots: $2\sin^2 x - \sin x - 1 = 0$ on $[0, 2\pi]$

Let $t = \sin x$: $2t^2 - t - 1 = 0$, $D = 1 + 8 = 9$, $t = \frac{1 \pm 3}{4}$, that is, $t = 1$ or $t = -\frac{1}{2}$. Both are at most one in absolute value.

$\sin x = 1$ gives $x = \frac{\pi}{2} + 2\pi n$; $\sin x = -\frac{1}{2}$ gives $x = -\frac{\pi}{6} + 2\pi n$ and $x = \frac{7\pi}{6} + 2\pi n$. In the interval $[0, 2\pi]$ lie $\frac{\pi}{2}$, $\frac{7\pi}{6}$ and $-\frac{\pi}{6} + 2\pi = \frac{11\pi}{6}$.

Example 2. An exam-style task: $\cos 2x = 1 - \cos\left(\frac{\pi}{2} - x\right)$, roots in $\left[-\frac{5\pi}{2}, -\pi\right]$

By the reduction formulas $\cos\left(\frac{\pi}{2} - x\right) = \sin x$, and $\cos 2x = 1 - 2\sin^2 x$. We get $1 - 2\sin^2 x = 1 - \sin x$, that is, $\sin x\,(2\sin x - 1) = 0$. So $x = \pi n$ or $\sin x = \frac{1}{2}$: $x = \frac{\pi}{6} + 2\pi n$, $x = \frac{5\pi}{6} + 2\pi n$.

Picking: from the family $\pi n$, $-2\pi$ and $-\pi$ fit; from $\frac{\pi}{6} + 2\pi n$, $\frac{\pi}{6} - 2\pi = -\frac{11\pi}{6}$; from $\frac{5\pi}{6} + 2\pi n$, $\frac{5\pi}{6} - 2\pi = -\frac{7\pi}{6}$. The answer to part b): $-2\pi,\ -\frac{11\pi}{6},\ -\frac{7\pi}{6},\ -\pi$.

Example 3. An auxiliary angle: $\sin x + \cos x = 1$

$\sin x + \cos x = \sqrt{2}\left(\frac{\sqrt{2}}{2}\sin x + \frac{\sqrt{2}}{2}\cos x\right) = \sqrt{2}\sin\left(x + \frac{\pi}{4}\right)$. The equation becomes a basic one: $\sin\left(x + \frac{\pi}{4}\right) = \frac{\sqrt{2}}{2}$. So $x + \frac{\pi}{4} = \frac{\pi}{4} + 2\pi n$ or $x + \frac{\pi}{4} = \frac{3\pi}{4} + 2\pi n$, and $x = 2\pi n$ or $x = \frac{\pi}{2} + 2\pi n$. Check: $\sin 0 + \cos 0 = 1$, $\sin\frac{\pi}{2} + \cos\frac{\pi}{2} = 1$.

Example 4. Where the domain changes the answer: $\tan 3x = \tan x$

Tangents are equal when the arguments differ by $\pi n$: $3x = x + \pi n$, $x = \frac{\pi n}{2}$. But the tangent doesn’t exist everywhere: we need $\cos x \ne 0$ and $\cos 3x \ne 0$. Odd $n$ give the points $\frac{\pi}{2} + \pi k$, where $\tan x$ is undefined, so we throw them out. Even $n$ remain: $x = \pi k$. Check: $\tan 3\pi = 0 = \tan\pi$.

Example 5. A homogeneous equation: $\sin^2 x - 3\sin x\cos x + 2\cos^2 x = 0$

Every term has degree two in sine and cosine. Let’s check whether $\cos x$ can be zero: then the equation demands $\sin^2 x = 0$, but sine and cosine never vanish together. So we may divide by $\cos^2 x$ without losing roots: $\tan^2 x - 3\tan x + 2 = 0$.

This is a quadratic in $\tan x$, with roots $1$ and $2$. Answer: $x = \frac{\pi}{4} + \pi n$, $x = \arctan 2 + \pi n$. The second family is left in terms of the arctangent: $\arctan 2 \approx 1.1071$ isn’t an angle from the table, but this is the exact answer.

How to check the answer

A family of roots is an infinite set; you can’t substitute them all. But it’s enough to check two or three values of $n$ in each family: if the formula for the family was derived correctly, the rest follow automatically, because the functions are periodic. The second way is a graph: draw the left and right sides of the equation and see how many crossing points fall within one period. In the first example there are three in an interval of length $2\pi$, and the answer has three values too. The solver does both checks: it substitutes values from the families exactly, without rounding, and shows the graphs on the “Graph” tab.

Common mistakes

  • Forgetting the period. The answer $x = \frac{\pi}{6}$ is one root out of infinitely many; you need $+2\pi n$ or $+\pi n$ and the words “$n \in \mathbb{Z}$”.
  • Losing the second family for sine. $\sin x = \frac{1}{2}$ has two points on the circle, $\frac{\pi}{6}$ and $\frac{5\pi}{6}$, not one.
  • Mixing up signs with the inverse functions. $\arcsin(-a) = -\arcsin a$, but $\arccos(-a) = \pi - \arccos a$: $\arccos\left(-\frac{1}{2}\right) = \frac{2\pi}{3}$, not $-\frac{\pi}{3}$.
  • Dividing by a function that might be zero. In $\sin x \cos x = \sin x$ you can’t “cancel” $\sin x$: the family $x = \pi n$ would vanish. Move everything to one side and factorise.
  • Not dividing the period. For $\sin 2x = 1$ the answer is $x = \frac{\pi}{4} + \pi n$, not $+2\pi n$: the whole right-hand side is divided, $2\pi n$ included.
  • Not checking where the equation is defined, in equations with tangents, cotangents and fractions, as in Example 4.
  • Mixing up degrees and radians. $\sin 30 \ne \frac{1}{2}$: without the degree sign, $30$ means radians.

See also

Where sine and cosine come from, how the unit circle “unwinds” into a sine wave, and why $\sin^2\alpha + \cos^2\alpha = 1$ is Pythagoras’ theorem are in the chapter on trigonometry. The sides and angles of a triangle, by the sine and cosine rules, are found by the triangle solver. If a substitution leaves you with a quadratic equation, the quadratic equation solver goes through it in detail, and equations with powers and logarithms go to the exponential and logarithmic equation solver.

Where this is explained

Other solvers