Trigonometric Identities Calculator
Verify identities containing sin(kx), cos(kx), and rational constants. See the exact contribution of each harmonic and examine how a small error changes the equation.
Prove a sine or cosine identity
Rewrite each side into exact harmonics, then see which coefficients match and where any difference changes the curve.
Enter both sides
Use sin(kx), cos(kx), numbers, and parentheses. Write sin(x)^2 to square the sine. Use * to multiply and divide only by expressions that reduce to a nonzero constant.
Exact comparison
This is an identity
Every exact coefficient matches, so the expressions agree for all real x.
- Left harmonic form
- cos(2x)
- Right harmonic form
- cos(2x)
Sampled magnitude ≈ 1 (vertical scale ±1).
Harmonic ledger and CSV
| Term | Left | Right | L − R |
|---|---|---|---|
| Constant | 0 | 0 | 0 |
| cos(2x) | 1 | 1 | 0 |
| sin(2x) | 0 | 0 | 0 |
Any omitted harmonic has zero coefficients on both sides.
How to use this calculator
- Enter a left and right expression. Use radians and write sin(x), cos(x), or sin(kx) and cos(kx) with integer k.
- Use parentheses for groups and ^ for integer powers. Use * for products, or place a factor before an opening parenthesis, sin or cos.
- Compare the exact rewrites and open the harmonic ledger to see the coefficient differences. A nonzero difference disproves the identity.
- Switch between the overlay and difference graph. Inspect the counterexample when a mismatch is found, then download the exact coefficients if needed.
The Formula
The mathematical logic powering this calculation is:
Let z = e^(ix), with angles in radians. Euler’s formulas give cos(kx) = (z^k + z^(−k))/2 and sin(kx) = (z^k − z^(−k))/(2i). Expand products by adding powers of z and collect terms of equal frequency. The coefficient arithmetic uses exact rational real and imaginary parts.
The resulting real form is a constant plus a finite sum of aₖ cos(kx) and bₖ sin(kx). The harmonics are orthogonal over one full turn. Their coefficients are unique, so the two expressions agree for every real angle precisely when every coefficient agrees. The plot samples one full turn at 193 angles. Its curves are approximate and do not determine the verdict.
A mismatch at 0, π/2, π or 3π/2 yields exact values because each sine and cosine there is 0, 1 or −1. When those four angles agree, the worksheet displays an approximate example from the sampled difference. The difference is evaluated from its own exact coefficients. It can show a small effect even when the two large values round to the same display number.
Use 180 characters or fewer per side, decimals with up to six digits before and six after the point, powers from 1 to 6, and up to 12 nested parentheses. An integer multiple k can range from −24 to 24. Intermediate harmonics must stay within that range, and intermediate reduced numerators and denominators have a 120-digit limit. A divisor must reduce to a nonzero constant. The worksheet handles this finite sine-and-cosine class over the real numbers. Angle shifts, other functions and nonconstant denominators are outside this class.Worked Example
If you input:
- Left expression: cos(x)^2 − sin(x)^2
- Right expression: cos(2x)
Result:
The left and right both reduce to cos(2x). Their constant and sine coefficients are zero, and both have cosine coefficient 1 at harmonic 2. The equality holds for every real x.
Frequently Asked Questions
Does a matching graph prove a trig identity?
Curves can look identical at finite resolution even when their formulas differ. The calculator proves the identity by comparing every coefficient in a unique finite harmonic expansion.
Why can both sides match at one angle and still differ?
An identity holds at every angle in the shared domain. For example, sin(x) cos(x) and sin(2x) both vanish at zero. At π/4 they give 1/2 and 1.
Can I enter tangent or divide by cos(x)?
This proof applies to finite sums and products of sines and cosines. A tangent or a variable denominator can have excluded angles, so it requires a separate domain analysis.
How do I enter sin squared x?
Write sin(x)^2. Write sin(2x) when the angle itself is doubled. The calculator treats these operations separately.
Why can an output contain a higher frequency?
Multiplying two harmonics can produce their sum and difference frequencies. For example, cos(x) cos(2x) becomes one half of cos(3x) plus one half of cos(x).
Can I use decimals or fractions?
Both are exact within the input limits. For example, 0.5 cos(x), cos(x)/2, and (1/2)cos(x) all use the same rational coefficient.
Similar Calculators
Inverse Trig & Angle Solutions Calculator
Find arcsin, arccos or arctan and all matching angles in a chosen window. See exact special angles, principal ranges and periodic solution graphs.
Complex Number Plane & Root Branch Calculator
Graph complex numbers, perform exact rectangular arithmetic, compare polar forms and visualize every nth root on the complex plane.
Online Calculator
Use this Online Calculator as a fully interactive scientific calculator with memory, trigonometry, powers, roots, and advanced math operations.
Rational Limit Calculator with Graph
Find exact one-sided limits of a rational function. Compare the lowest nonzero powers, cancel common factors and graph holes and vertical poles.
