I use sympy (ver1.9).
I calculate the following expressions((1)~(4)) by sympy.simplify().
All of them are expected to be identical to 1 analytically.
but (4) did not return 1, and the expression isn't simplified.

Why does this happen?
I use sympy (ver1.9).
I calculate the following expressions((1)~(4)) by sympy.simplify().
All of them are expected to be identical to 1 analytically.
but (4) did not return 1, and the expression isn't simplified.

Why does this happen?
Try rewriting to exp and then simplifying:
>>> eq=tanh(x-y)**2 + sech(x-y)**2
>>> eq.rewrite(exp).simplify()
1
or use the function to rewrite hyperbolics to trigonometric functions before simplifying, e.g. with fu:
>>> from sympy.simplify.fu import hyper_as_trig
>>> e,f=hyper_as_trig(eq)
>>> f(fu(e))
1
See also hyper_as_trig in simplify/fu.py.