The Formula A Surveyor Uses To Find An Angle Without Measuring It
A surveyor standing at a crossroads can find the exact angle between two roads without ever placing a protractor on the ground. If they know the slope of each road, one trigonometric identity turns those two slopes into the angle between them. That identity is the tangent difference formula, and getting it wrong by a single sign would send a property boundary or a tunnel heading off in the wrong direction.
The tan(A−B) formula is the tool. It expresses the tangent of a difference of two angles using only the tangents of the separate angles. Because the slope of a line is the tangent of the angle it makes with the horizontal, the formula reads the angle between two lines straight off their slopes - no direct measurement required.
What Is The Tan(A−B) Formula?
The tan(A−B) formula is the tangent subtraction identity. It states:
$$\tan(A-B) = \frac{\tan A - \tan B}{1 + \tan A \tan B}$$
Here $A$ and $B$ are any two angles for which the tangents are defined. The numerator is the plain difference $\tan A - \tan B$; the denominator is $1$ plus the product $\tan A \tan B$. That plus sign in the denominator is the whole personality of the formula, and it is the first thing to memorise correctly.
Tangent itself is the ratio of sine to cosine - the "tan" in sin cos tan. It is the reason this identity can be built from the sine and cosine difference formulas, which is exactly how the proof runs below. The tan(A−B) identity is one half of a pair: its companion is the tangent sum formula in the tangent formula family, and both come from the same sum and difference identities.
The Sign Rule In One Line
There is a clean symmetry between the sum and the difference versions:
Difference: $\tan(A-B) = \dfrac{\tan A - \tan B}{1 + \tan A \tan B}$ — minus on top, plus on the bottom.
Sum: $\tan(A+B) = \dfrac{\tan A + \tan B}{1 - \tan A \tan B}$ - plus on top, minus on the bottom.
The signs are always opposite between numerator and denominator. Fix that pattern once and you never write the wrong formula again.
What Are The Properties Of The Tan(A−B) Formula?
A few properties follow directly and are worth carrying into problems.
Built from a ratio. Because $\tan\theta = \dfrac{\sin\theta}{\cos\theta}$, the whole identity is really the ratio $\dfrac{\sin(A-B)}{\cos(A-B)}$ rewritten in terms of tangents. Everything the formula does inherits from that single fact.
The angle-between-lines reading. If two lines have slopes $m_1 = \tan A$ and $m_2 = \tan B$, the angle $\theta$ between them satisfies $\tan\theta = \dfrac{m_1 - m_2}{1 + m_1 m_2}$. This is the tan(A−B) formula wearing a geometry hat.
Perpendicular lines break it - usefully. When the denominator $1 + \tan A \tan B = 0$, the tangent is undefined, which signals a $90^\circ$ angle. So $\tan A \tan B = -1$ is exactly the condition for two lines to be perpendicular. The formula's undefined case is not a flaw; it is information.
Equal angles collapse it. Set $B = A$ and the numerator becomes $0$, giving $\tan(A - A) = \tan 0 = 0$ - a quick self-check that the identity behaves.
How Do You Derive The Tan(A−B) Formula?
Start from the definition of tangent as a ratio of sine to cosine, then use the sine and cosine difference formulas (from the cos(A−B) formula and its sine partner):
$$\tan(A-B) = \frac{\sin(A-B)}{\cos(A-B)} = \frac{\sin A \cos B - \cos A \sin B}{\cos A \cos B + \sin A \sin B}$$
The goal is to get everything in terms of tangents. Divide every term in the numerator and denominator by $\cos A \cos B$:
$$\tan(A-B) = \frac{\dfrac{\sin A \cos B}{\cos A \cos B} - \dfrac{\cos A \sin B}{\cos A \cos B}}{\dfrac{\cos A \cos B}{\cos A \cos B} + \dfrac{\sin A \sin B}{\cos A \cos B}}$$
Now each fraction simplifies. In the numerator, $\dfrac{\sin A}{\cos A} = \tan A$ and $\dfrac{\sin B}{\cos B} = \tan B$. In the denominator, the first term is $1$ and the second becomes $\tan A \tan B$:
$$\tan(A-B) = \frac{\tan A - \tan B}{1 + \tan A \tan B}$$
That is the identity. The plus sign in the denominator traces directly back to the plus sign in the cosine difference formula, $\cos(A-B) = \cos A \cos B + \sin A \sin B$. Dividing by $\cos A \cos B$ carried that plus straight into the denominator - so the sign is not a rule to memorise blindly, it is a consequence you can rebuild anytime.
Where Is The Tan(A−B) Formula Used? - "Reading the angle between two directions"
The identity exists to answer one question cleanly: given two directions, what is the angle between them? That is a question surveyors, navigators, and graphics engines ask constantly.
Angle between two lines or roads. Slope is tangent, so two slopes plug straight into the formula and return the angle between the lines. Civil engineering, road design, and coordinate geometry all lean on this.
Computing exact values of awkward angles. $\tan 15^\circ$ is not a special-angle value you memorise, but $15^\circ = 45^\circ - 30^\circ$, and the formula turns two known tangents into the exact value $2 - \sqrt{3}$.
Radar and tracking. When two objects are tracked as bearings from a fixed point, the closing angle between them comes from a tangent difference - the same math that later feeds double-angle work like the tan2x formula.
What most explainers skip is why the denominator matters at all. A naive guess might be $\tan(A-B) = \tan A - \tan B$, but that ignores how tangent stretches near $90^\circ$. The $1 + \tan A \tan B$ term is the correction that keeps the identity honest - and when it hits zero, it is telling you the lines are perpendicular. For a fuller catalogue of how these fit together, the list of trigonometric identities shows the whole family.
Examples Of The Tan(A−B) Formula
Example 1
Find $\tan(A - B)$ when $\tan A = 3$ and $\tan B = \dfrac{1}{2}$.
Substitute into the formula:
$$\tan(A-B) = \frac{3 - \frac{1}{2}}{1 + (3)\left(\frac{1}{2}\right)} = \frac{\frac{5}{2}}{\frac{5}{2}} = 1$$
Final answer: $\tan(A-B) = 1$.
Example 2
Find the exact value of $\tan 15^\circ$. First instinct, then the correct route.
The tempting shortcut is to treat tangent like a linear function and write $\tan 15^\circ = \tan(45^\circ - 30^\circ) = \tan 45^\circ - \tan 30^\circ = 1 - \dfrac{1}{\sqrt{3}} \approx 0.423$.
Check it. A calculator gives $\tan 15^\circ \approx 0.268$, not $0.423$, so the shortcut is wrong. Tangent is a ratio, not a straight line, and it does not distribute across subtraction. The denominator is exactly the piece the shortcut threw away.
Use the full formula with $A = 45^\circ$, $B = 30^\circ$, $\tan 45^\circ = 1$, $\tan 30^\circ = \dfrac{1}{\sqrt{3}}$:
$$\tan 15^\circ = \frac{1 - \frac{1}{\sqrt{3}}}{1 + (1)\left(\frac{1}{\sqrt{3}}\right)} = \frac{\frac{\sqrt{3} - 1}{\sqrt{3}}}{\frac{\sqrt{3} + 1}{\sqrt{3}}} = \frac{\sqrt{3} - 1}{\sqrt{3} + 1}$$
Rationalise by multiplying top and bottom by $\sqrt{3} - 1$:
$$\tan 15^\circ = \frac{(\sqrt{3} - 1)^2}{(\sqrt{3})^2 - 1^2} = \frac{3 - 2\sqrt{3} + 1}{2} = \frac{4 - 2\sqrt{3}}{2} = 2 - \sqrt{3}$$
Since $2 - \sqrt{3} \approx 0.268$, this matches the calculator.
Final answer: $\tan 15^\circ = 2 - \sqrt{3}$.
Example 3
Find the angle between two lines with slopes $m_1 = 2$ and $m_2 = 3$.
Slope is tangent, so $\tan A = 3$ and $\tan B = 2$ (take the steeper line as $A$). The angle $\theta$ between them:
$$\tan\theta = \frac{3 - 2}{1 + (3)(2)} = \frac{1}{7}$$
So $\theta = \tan^{-1}\left(\dfrac{1}{7}\right) \approx 8.13^\circ$.
Final answer: the lines meet at about $8.13^\circ$.
Example 4
Simplify $\dfrac{\tan 70^\circ - \tan 25^\circ}{1 + \tan 70^\circ \tan 25^\circ}$.
This is the tan(A−B) formula read right to left, with $A = 70^\circ$ and $B = 25^\circ$:
$$\frac{\tan 70^\circ - \tan 25^\circ}{1 + \tan 70^\circ \tan 25^\circ} = \tan(70^\circ - 25^\circ) = \tan 45^\circ = 1$$
Final answer: the expression equals $1$.
Example 5
Show that two lines with slopes $m_1 = 4$ and $m_2 = -\dfrac{1}{4}$ are perpendicular.
Plug into the denominator condition:
$$1 + m_1 m_2 = 1 + (4)\left(-\frac{1}{4}\right) = 1 - 1 = 0$$
The denominator is $0$, so $\tan\theta$ is undefined, which means $\theta = 90^\circ$.
Final answer: the lines are perpendicular, because $1 + m_1 m_2 = 0$.
Example 6
Given $\tan A = \dfrac{5}{6}$ and $\tan(A - B) = \dfrac{1}{11}$, find $\tan B$.
Set up the formula and solve for $\tan B$. Let $t = \tan B$:
$$\frac{1}{11} = \frac{\frac{5}{6} - t}{1 + \frac{5}{6}t}$$
Cross-multiply:
$$1 + \frac{5}{6}t = 11\left(\frac{5}{6} - t\right) = \frac{55}{6} - 11t$$
Collect the $t$ terms:
$$\frac{5}{6}t + 11t = \frac{55}{6} - 1$$
$$\frac{71}{6}t = \frac{49}{6}$$
$$t = \frac{49}{71}$$
Final answer: $\tan B = \dfrac{49}{71}$.
The first-instinct error students reach for in these is distributing the tangent across the subtraction — tangent is a ratio, and the denominator is the part that refuses to be dropped.
Common Mistakes With The Tan(A−B) Formula
Mistake 1: Using A Minus Sign In The Denominator
Where it slips in: Writing the difference formula from memory and borrowing the sum formula's denominator.
Don't do this: $\tan(A-B) = \dfrac{\tan A - \tan B}{1 - \tan A \tan B}$.
The correct way: The denominator takes a plus: $1 + \tan A \tan B$. The rule is that numerator and denominator always carry opposite signs. The memorizer who recites "minus over minus" gets the sum and difference formulas fused into one wrong hybrid - the fix is to anchor the sign to the cosine difference formula, where the plus comes from.
Mistake 2: Distributing Tangent Over The Subtraction
Where it slips in: Reaching for $\tan 15^\circ$ or any $\tan(A - B)$ and treating tangent as linear.
Don't do this: $\tan(A - B) = \tan A - \tan B$.
The correct way: Tangent does not distribute. The second-guesser who suspects the shortcut is too easy is right to pause - the denominator $1 + \tan A \tan B$ is the correction that a naive subtraction ignores.
Mistake 3: Forgetting Tangent Can Be Undefined
Where it slips in: Plugging in an angle like $90^\circ$, where tangent does not exist.
Don't do this: Writing $\tan(120^\circ - 90^\circ)$ by substituting $\tan 90^\circ$ as if it were a number.
The correct way: $\tan 90^\circ$ is undefined, so route around it - rewrite the angle difference using values that exist, or switch to the sine-over-cosine form.
Key Takeaways
The tan(A−B) formula is $\tan(A-B) = \dfrac{\tan A - \tan B}{1 + \tan A \tan B}$, the tangent subtraction identity.
It is derived by dividing the sine and cosine difference formulas by $\cos A \cos B$.
Numerator and denominator always carry opposite signs: minus on top, plus underneath.
With slopes $m_1$ and $m_2$, it returns the angle between two lines; a zero denominator means perpendicular.
It computes exact values like $\tan 15^\circ = 2 - \sqrt{3}$ by splitting an angle into known parts.
To take the tan(A−B) formula further with a teacher, explore Bhanzu's trigonometry tutor sessions, a high school math tutor for identity drills, or live math classes online with peers from 20+ countries.
A Practical Next Step
Practice these to solidify your understanding: compute $\tan 15^\circ$ again from scratch without looking, then find the angle between lines of slope $1$ and $-2$. If the sign in the denominator trips you, return to the derivation and rebuild it. Want a live Bhanzu trainer to work these through with you? Book a free demo class.
Read More
Trigonometric Identities — the full toolkit the tangent difference formula belongs to.
Trigonometric Ratios — how tangent is defined from sides of a triangle.
Arctan — the inverse that turns a tangent value back into an angle.
Trigonometric Functions — how sine, cosine, and tangent behave across the domain.
Trigonometric Table — the special-angle values used throughout these examples.
Was this article helpful?
Your feedback helps us write better content
