# Does Mathematica know about trig identities?

I am calculating some geometry via two different ways in Mathematica. One uses a known trig identity the other doesn't.

We define angles of two right-angle triangles.

angFar = ArcTan[hiod/dist];
angNear = ArcTan[hiod/(dist - depth)];


Then calculate their difference

disp = FullSimplify[angNear - angFar]


This gives

-ArcTan[hiod/dist] + ArcTan[hiod/(-depth + dist)]


We then do the same recognising that beta-alpha == ArcTan[(Tan[beta] - Tan[alpha])/(1 + Tan[beta]*Tan[alpha])]

trigID = ArcTan[(Tan[beta] - Tan[alpha])/(1 + Tan[beta]*Tan[alpha])]


Substituting

dispViaTrigID =
FullSimplify[trigID /. {alpha -> angFar, beta -> angNear}]


Gives

ArcTan[(depth hiod)/(-depth dist + dist^2 + hiod^2)]


How do I show with Mathematica that disp==dispViaTrigID?

• {disp, dispViaTrigID} /. {hiod -> 2., depth -> 2., dist -> 1.} indicates they are not equivalent (which has to do with branch cut discontinuities -- see docs for ArcTan). You might need to use appropriate hypotheses. Or be satisfied with FullSimplify[Tan[disp] == Tan[dispViaTrigID]]. Jul 4 at 15:06
• Tan[disp] // FullSimplify gives the desired result. Jul 4 at 19:18