Hyperbolic functions#

The full set of hyperbolic and inverse hyperbolic functions is available:

REFERENCES:

EXAMPLES:

Inverse hyperbolic functions have logarithmic expressions, so expressions of the form exp(c*f(x)) simplify:

sage: # needs sage.symbolic
sage: exp(2*atanh(x))
-(x + 1)/(x - 1)
sage: exp(2*acoth(x))
(x + 1)/(x - 1)
sage: exp(2*asinh(x))
(x + sqrt(x^2 + 1))^2
sage: exp(2*acosh(x))
(x + sqrt(x^2 - 1))^2
sage: exp(2*asech(x))
(sqrt(-x^2 + 1)/x + 1/x)^2
sage: exp(2*acsch(x))
(sqrt(1/x^2 + 1) + 1/x)^2
>>> from sage.all import *
>>> # needs sage.symbolic
>>> exp(Integer(2)*atanh(x))
-(x + 1)/(x - 1)
>>> exp(Integer(2)*acoth(x))
(x + 1)/(x - 1)
>>> exp(Integer(2)*asinh(x))
(x + sqrt(x^2 + 1))^2
>>> exp(Integer(2)*acosh(x))
(x + sqrt(x^2 - 1))^2
>>> exp(Integer(2)*asech(x))
(sqrt(-x^2 + 1)/x + 1/x)^2
>>> exp(Integer(2)*acsch(x))
(sqrt(1/x^2 + 1) + 1/x)^2
class sage.functions.hyperbolic.Function_arccosh[source]#

Bases: GinacFunction

The inverse of the hyperbolic cosine function.

EXAMPLES:

sage: # needs sage.symbolic
sage: acosh(1/2)
arccosh(1/2)
sage: acosh(1 + I*1.0)
1.06127506190504 + 0.904556894302381*I
sage: float(acosh(2))
1.3169578969248168
sage: cosh(float(acosh(2)))
2.0

sage: acosh(complex(1, 2))  # abs tol 1e-15                                 # needs sage.rings.complex_double
(1.5285709194809982+1.1437177404024204j)
>>> from sage.all import *
>>> # needs sage.symbolic
>>> acosh(Integer(1)/Integer(2))
arccosh(1/2)
>>> acosh(Integer(1) + I*RealNumber('1.0'))
1.06127506190504 + 0.904556894302381*I
>>> float(acosh(Integer(2)))
1.3169578969248168
>>> cosh(float(acosh(Integer(2))))
2.0

>>> acosh(complex(Integer(1), Integer(2)))  # abs tol 1e-15                                 # needs sage.rings.complex_double
(1.5285709194809982+1.1437177404024204j)

Warning

If the input is in the complex field or symbolic (which includes rational and integer input), the output will be complex. However, if the input is a real decimal, the output will be real or \(NaN\). See the examples for details.

sage: acosh(CC(0.5))                                                        # needs sage.rings.real_mpfr
1.04719755119660*I

sage: # needs sage.symbolic
sage: acosh(0.5)
NaN
sage: acosh(1/2)
arccosh(1/2)
sage: acosh(1/2).n()
NaN
sage: acosh(0)
1/2*I*pi
sage: acosh(-1)
I*pi
>>> from sage.all import *
>>> acosh(CC(RealNumber('0.5')))                                                        # needs sage.rings.real_mpfr
1.04719755119660*I

>>> # needs sage.symbolic
>>> acosh(RealNumber('0.5'))
NaN
>>> acosh(Integer(1)/Integer(2))
arccosh(1/2)
>>> acosh(Integer(1)/Integer(2)).n()
NaN
>>> acosh(Integer(0))
1/2*I*pi
>>> acosh(-Integer(1))
I*pi

To prevent automatic evaluation use the hold argument:

sage: acosh(-1, hold=True)                                                  # needs sage.symbolic
arccosh(-1)
>>> from sage.all import *
>>> acosh(-Integer(1), hold=True)                                                  # needs sage.symbolic
arccosh(-1)

To then evaluate again, use the unhold method:

sage: acosh(-1, hold=True).unhold()                                         # needs sage.symbolic
I*pi
>>> from sage.all import *
>>> acosh(-Integer(1), hold=True).unhold()                                         # needs sage.symbolic
I*pi

conjugate(arccosh(x))==arccosh(conjugate(x)) unless on the branch cut which runs along the real axis from +1 to -inf.:

sage: # needs sage.symbolic
sage: conjugate(acosh(x))
conjugate(arccosh(x))
sage: var('y', domain='positive')
y
sage: conjugate(acosh(y))
conjugate(arccosh(y))
sage: conjugate(acosh(y+I))
conjugate(arccosh(y + I))
sage: conjugate(acosh(1/16))
conjugate(arccosh(1/16))
sage: conjugate(acosh(2))
arccosh(2)
sage: conjugate(acosh(I/2))
arccosh(-1/2*I)
>>> from sage.all import *
>>> # needs sage.symbolic
>>> conjugate(acosh(x))
conjugate(arccosh(x))
>>> var('y', domain='positive')
y
>>> conjugate(acosh(y))
conjugate(arccosh(y))
>>> conjugate(acosh(y+I))
conjugate(arccosh(y + I))
>>> conjugate(acosh(Integer(1)/Integer(16)))
conjugate(arccosh(1/16))
>>> conjugate(acosh(Integer(2)))
arccosh(2)
>>> conjugate(acosh(I/Integer(2)))
arccosh(-1/2*I)
class sage.functions.hyperbolic.Function_arccoth[source]#

Bases: GinacFunction

The inverse of the hyperbolic cotangent function.

EXAMPLES:

sage: # needs sage.symbolic
sage: acoth(2.0)
0.549306144334055
sage: acoth(2)
1/2*log(3)
sage: acoth(1 + I*1.0)
0.402359478108525 - 0.553574358897045*I
sage: acoth(2).n(200)
0.54930614433405484569762261846126285232374527891137472586735

sage: bool(diff(acoth(x), x) == diff(atanh(x), x))                          # needs sage.symbolic
True
sage: diff(acoth(x), x)                                                     # needs sage.symbolic
-1/(x^2 - 1)

sage: float(acoth(2))                                                       # needs sage.symbolic
0.5493061443340549
sage: float(acoth(2).n(53))   # Correct result to 53 bits                   # needs sage.rings.real_mpfr sage.symbolic
0.5493061443340549
sage: float(acoth(2).n(100))  # Compute 100 bits and then round to 53       # needs sage.rings.real_mpfr sage.symbolic
0.5493061443340549
>>> from sage.all import *
>>> # needs sage.symbolic
>>> acoth(RealNumber('2.0'))
0.549306144334055
>>> acoth(Integer(2))
1/2*log(3)
>>> acoth(Integer(1) + I*RealNumber('1.0'))
0.402359478108525 - 0.553574358897045*I
>>> acoth(Integer(2)).n(Integer(200))
0.54930614433405484569762261846126285232374527891137472586735

>>> bool(diff(acoth(x), x) == diff(atanh(x), x))                          # needs sage.symbolic
True
>>> diff(acoth(x), x)                                                     # needs sage.symbolic
-1/(x^2 - 1)

>>> float(acoth(Integer(2)))                                                       # needs sage.symbolic
0.5493061443340549
>>> float(acoth(Integer(2)).n(Integer(53)))   # Correct result to 53 bits                   # needs sage.rings.real_mpfr sage.symbolic
0.5493061443340549
>>> float(acoth(Integer(2)).n(Integer(100)))  # Compute 100 bits and then round to 53       # needs sage.rings.real_mpfr sage.symbolic
0.5493061443340549
class sage.functions.hyperbolic.Function_arccsch[source]#

Bases: GinacFunction

The inverse of the hyperbolic cosecant function.

EXAMPLES:

sage: # needs sage.symbolic
sage: acsch(2.0)
0.481211825059603
sage: acsch(2)
arccsch(2)
sage: acsch(1 + I*1.0)
0.530637530952518 - 0.452278447151191*I
sage: acsch(1).n(200)
0.88137358701954302523260932497979230902816032826163541075330
sage: float(acsch(1))
0.881373587019543

sage: diff(acsch(x), x)                                                     # needs sage.symbolic
-1/(sqrt(x^2 + 1)*x)
sage: latex(acsch(x))                                                       # needs sage.symbolic
\operatorname{arcsch}\left(x\right)
>>> from sage.all import *
>>> # needs sage.symbolic
>>> acsch(RealNumber('2.0'))
0.481211825059603
>>> acsch(Integer(2))
arccsch(2)
>>> acsch(Integer(1) + I*RealNumber('1.0'))
0.530637530952518 - 0.452278447151191*I
>>> acsch(Integer(1)).n(Integer(200))
0.88137358701954302523260932497979230902816032826163541075330
>>> float(acsch(Integer(1)))
0.881373587019543

>>> diff(acsch(x), x)                                                     # needs sage.symbolic
-1/(sqrt(x^2 + 1)*x)
>>> latex(acsch(x))                                                       # needs sage.symbolic
\operatorname{arcsch}\left(x\right)
class sage.functions.hyperbolic.Function_arcsech[source]#

Bases: GinacFunction

The inverse of the hyperbolic secant function.

EXAMPLES:

sage: # needs sage.symbolic
sage: asech(0.5)
1.31695789692482
sage: asech(1/2)
arcsech(1/2)
sage: asech(1 + I*1.0)
0.530637530952518 - 1.11851787964371*I
sage: asech(1/2).n(200)
1.3169578969248167086250463473079684440269819714675164797685
sage: float(asech(1/2))
1.3169578969248168

sage: diff(asech(x), x)                                                     # needs sage.symbolic
-1/(sqrt(-x^2 + 1)*x)
sage: latex(asech(x))                                                       # needs sage.symbolic
\operatorname{arsech}\left(x\right)
sage: asech(x)._sympy_()                                                    # needs sympy sage.symbolic
asech(x)
>>> from sage.all import *
>>> # needs sage.symbolic
>>> asech(RealNumber('0.5'))
1.31695789692482
>>> asech(Integer(1)/Integer(2))
arcsech(1/2)
>>> asech(Integer(1) + I*RealNumber('1.0'))
0.530637530952518 - 1.11851787964371*I
>>> asech(Integer(1)/Integer(2)).n(Integer(200))
1.3169578969248167086250463473079684440269819714675164797685
>>> float(asech(Integer(1)/Integer(2)))
1.3169578969248168

>>> diff(asech(x), x)                                                     # needs sage.symbolic
-1/(sqrt(-x^2 + 1)*x)
>>> latex(asech(x))                                                       # needs sage.symbolic
\operatorname{arsech}\left(x\right)
>>> asech(x)._sympy_()                                                    # needs sympy sage.symbolic
asech(x)
class sage.functions.hyperbolic.Function_arcsinh[source]#

Bases: GinacFunction

The inverse of the hyperbolic sine function.

EXAMPLES:

sage: asinh
arcsinh
sage: asinh(0.5)                                                            # needs sage.rings.real_mpfr
0.481211825059603
sage: asinh(1/2)                                                            # needs sage.symbolic
arcsinh(1/2)
sage: asinh(1 + I*1.0)                                                      # needs sage.symbolic
1.06127506190504 + 0.666239432492515*I
>>> from sage.all import *
>>> asinh
arcsinh
>>> asinh(RealNumber('0.5'))                                                            # needs sage.rings.real_mpfr
0.481211825059603
>>> asinh(Integer(1)/Integer(2))                                                            # needs sage.symbolic
arcsinh(1/2)
>>> asinh(Integer(1) + I*RealNumber('1.0'))                                                      # needs sage.symbolic
1.06127506190504 + 0.666239432492515*I

To prevent automatic evaluation use the hold argument:

sage: asinh(-2, hold=True)                                                  # needs sage.symbolic
arcsinh(-2)
>>> from sage.all import *
>>> asinh(-Integer(2), hold=True)                                                  # needs sage.symbolic
arcsinh(-2)

To then evaluate again, use the unhold method:

sage: asinh(-2, hold=True).unhold()                                         # needs sage.symbolic
-arcsinh(2)
>>> from sage.all import *
>>> asinh(-Integer(2), hold=True).unhold()                                         # needs sage.symbolic
-arcsinh(2)

conjugate(asinh(x))==asinh(conjugate(x)) unless on the branch cuts which run along the imaginary axis outside the interval [-I, +I].:

sage: # needs sage.symbolic
sage: conjugate(asinh(x))
conjugate(arcsinh(x))
sage: var('y', domain='positive')
y
sage: conjugate(asinh(y))
arcsinh(y)
sage: conjugate(asinh(y+I))
conjugate(arcsinh(y + I))
sage: conjugate(asinh(1/16))
arcsinh(1/16)
sage: conjugate(asinh(I/2))
arcsinh(-1/2*I)
sage: conjugate(asinh(2*I))
conjugate(arcsinh(2*I))
>>> from sage.all import *
>>> # needs sage.symbolic
>>> conjugate(asinh(x))
conjugate(arcsinh(x))
>>> var('y', domain='positive')
y
>>> conjugate(asinh(y))
arcsinh(y)
>>> conjugate(asinh(y+I))
conjugate(arcsinh(y + I))
>>> conjugate(asinh(Integer(1)/Integer(16)))
arcsinh(1/16)
>>> conjugate(asinh(I/Integer(2)))
arcsinh(-1/2*I)
>>> conjugate(asinh(Integer(2)*I))
conjugate(arcsinh(2*I))
class sage.functions.hyperbolic.Function_arctanh[source]#

Bases: GinacFunction

The inverse of the hyperbolic tangent function.

EXAMPLES:

sage: atanh(0.5)                                                            # needs sage.rings.real_mpfr
0.549306144334055
sage: atanh(1/2)                                                            # needs sage.symbolic
1/2*log(3)
sage: atanh(1 + I*1.0)                                                      # needs sage.symbolic
0.402359478108525 + 1.01722196789785*I
>>> from sage.all import *
>>> atanh(RealNumber('0.5'))                                                            # needs sage.rings.real_mpfr
0.549306144334055
>>> atanh(Integer(1)/Integer(2))                                                            # needs sage.symbolic
1/2*log(3)
>>> atanh(Integer(1) + I*RealNumber('1.0'))                                                      # needs sage.symbolic
0.402359478108525 + 1.01722196789785*I

To prevent automatic evaluation use the hold argument:

sage: atanh(-1/2, hold=True)                                                # needs sage.symbolic
arctanh(-1/2)
>>> from sage.all import *
>>> atanh(-Integer(1)/Integer(2), hold=True)                                                # needs sage.symbolic
arctanh(-1/2)

To then evaluate again, use the unhold method:

sage: atanh(-1/2, hold=True).unhold()                                       # needs sage.symbolic
-1/2*log(3)
>>> from sage.all import *
>>> atanh(-Integer(1)/Integer(2), hold=True).unhold()                                       # needs sage.symbolic
-1/2*log(3)

conjugate(arctanh(x)) == arctanh(conjugate(x)) unless on the branch cuts which run along the real axis outside the interval [-1, +1].

sage: # needs sage.symbolic
sage: conjugate(atanh(x))
conjugate(arctanh(x))
sage: var('y', domain='positive')
y
sage: conjugate(atanh(y))
conjugate(arctanh(y))
sage: conjugate(atanh(y + I))
conjugate(arctanh(y + I))
sage: conjugate(atanh(1/16))
1/2*log(17/15)
sage: conjugate(atanh(I/2))
arctanh(-1/2*I)
sage: conjugate(atanh(-2*I))
arctanh(2*I)
>>> from sage.all import *
>>> # needs sage.symbolic
>>> conjugate(atanh(x))
conjugate(arctanh(x))
>>> var('y', domain='positive')
y
>>> conjugate(atanh(y))
conjugate(arctanh(y))
>>> conjugate(atanh(y + I))
conjugate(arctanh(y + I))
>>> conjugate(atanh(Integer(1)/Integer(16)))
1/2*log(17/15)
>>> conjugate(atanh(I/Integer(2)))
arctanh(-1/2*I)
>>> conjugate(atanh(-Integer(2)*I))
arctanh(2*I)
class sage.functions.hyperbolic.Function_cosh[source]#

Bases: GinacFunction

The hyperbolic cosine function.

EXAMPLES:

sage: cosh(3.1415)                                                          # needs sage.rings.real_mpfr
11.5908832931176

sage: # needs sage.symbolic
sage: cosh(pi)
cosh(pi)
sage: float(cosh(pi))
11.591953275521519
sage: RR(cosh(1/2))
1.12762596520638
sage: latex(cosh(x))
\cosh\left(x\right)
sage: cosh(x)._sympy_()                                                     # needs sympy
cosh(x)
>>> from sage.all import *
>>> cosh(RealNumber('3.1415'))                                                          # needs sage.rings.real_mpfr
11.5908832931176

>>> # needs sage.symbolic
>>> cosh(pi)
cosh(pi)
>>> float(cosh(pi))
11.591953275521519
>>> RR(cosh(Integer(1)/Integer(2)))
1.12762596520638
>>> latex(cosh(x))
\cosh\left(x\right)
>>> cosh(x)._sympy_()                                                     # needs sympy
cosh(x)

To prevent automatic evaluation, use the hold parameter:

sage: cosh(arcsinh(x), hold=True)                                           # needs sage.symbolic
cosh(arcsinh(x))
>>> from sage.all import *
>>> cosh(arcsinh(x), hold=True)                                           # needs sage.symbolic
cosh(arcsinh(x))

To then evaluate again, use the unhold method:

sage: cosh(arcsinh(x), hold=True).unhold()                                  # needs sage.symbolic
sqrt(x^2 + 1)
>>> from sage.all import *
>>> cosh(arcsinh(x), hold=True).unhold()                                  # needs sage.symbolic
sqrt(x^2 + 1)
class sage.functions.hyperbolic.Function_coth[source]#

Bases: GinacFunction

The hyperbolic cotangent function.

EXAMPLES:

sage: coth(3.1415)                                                          # needs sage.rings.real_mpfr
1.00374256795520
sage: coth(complex(1, 2))  # abs tol 1e-15                                  # needs sage.rings.complex_double
(0.8213297974938518+0.17138361290918508j)

sage: # needs sage.symbolic
sage: coth(pi)
coth(pi)
sage: coth(0)
Infinity
sage: coth(pi*I)
Infinity
sage: coth(pi*I/2)
0
sage: coth(7*pi*I/2)
0
sage: coth(8*pi*I/2)
Infinity
sage: coth(7.*pi*I/2)
-I*cot(3.50000000000000*pi)
sage: float(coth(pi))
1.0037418731973213
sage: RR(coth(pi))
1.00374187319732

sage: # needs sage.symbolic
sage: bool(diff(coth(x), x) == diff(1/tanh(x), x))
True
sage: diff(coth(x), x)
-1/sinh(x)^2
sage: latex(coth(x))
\coth\left(x\right)
sage: coth(x)._sympy_()                                                     # needs sympy
coth(x)
>>> from sage.all import *
>>> coth(RealNumber('3.1415'))                                                          # needs sage.rings.real_mpfr
1.00374256795520
>>> coth(complex(Integer(1), Integer(2)))  # abs tol 1e-15                                  # needs sage.rings.complex_double
(0.8213297974938518+0.17138361290918508j)

>>> # needs sage.symbolic
>>> coth(pi)
coth(pi)
>>> coth(Integer(0))
Infinity
>>> coth(pi*I)
Infinity
>>> coth(pi*I/Integer(2))
0
>>> coth(Integer(7)*pi*I/Integer(2))
0
>>> coth(Integer(8)*pi*I/Integer(2))
Infinity
>>> coth(RealNumber('7.')*pi*I/Integer(2))
-I*cot(3.50000000000000*pi)
>>> float(coth(pi))
1.0037418731973213
>>> RR(coth(pi))
1.00374187319732

>>> # needs sage.symbolic
>>> bool(diff(coth(x), x) == diff(Integer(1)/tanh(x), x))
True
>>> diff(coth(x), x)
-1/sinh(x)^2
>>> latex(coth(x))
\coth\left(x\right)
>>> coth(x)._sympy_()                                                     # needs sympy
coth(x)
class sage.functions.hyperbolic.Function_csch[source]#

Bases: GinacFunction

The hyperbolic cosecant function.

EXAMPLES:

sage: csch(3.1415)                                                          # needs sage.rings.real_mpfr
0.0865975907592133

sage: # needs sage.symbolic
sage: csch(pi)
csch(pi)
sage: float(csch(pi))
0.0865895375300469...
sage: RR(csch(pi))
0.0865895375300470
sage: csch(0)
Infinity
sage: csch(pi*I)
Infinity
sage: csch(pi*I/2)
-I
sage: csch(7*pi*I/2)
I
sage: csch(7.*pi*I/2)
-I*csc(3.50000000000000*pi)

sage: # needs sage.symbolic
sage: bool(diff(csch(x), x) == diff(1/sinh(x), x))
True
sage: diff(csch(x), x)
-coth(x)*csch(x)
sage: latex(csch(x))
\operatorname{csch}\left(x\right)
sage: csch(x)._sympy_()                                                     # needs sympy
csch(x)
>>> from sage.all import *
>>> csch(RealNumber('3.1415'))                                                          # needs sage.rings.real_mpfr
0.0865975907592133

>>> # needs sage.symbolic
>>> csch(pi)
csch(pi)
>>> float(csch(pi))
0.0865895375300469...
>>> RR(csch(pi))
0.0865895375300470
>>> csch(Integer(0))
Infinity
>>> csch(pi*I)
Infinity
>>> csch(pi*I/Integer(2))
-I
>>> csch(Integer(7)*pi*I/Integer(2))
I
>>> csch(RealNumber('7.')*pi*I/Integer(2))
-I*csc(3.50000000000000*pi)

>>> # needs sage.symbolic
>>> bool(diff(csch(x), x) == diff(Integer(1)/sinh(x), x))
True
>>> diff(csch(x), x)
-coth(x)*csch(x)
>>> latex(csch(x))
\operatorname{csch}\left(x\right)
>>> csch(x)._sympy_()                                                     # needs sympy
csch(x)
class sage.functions.hyperbolic.Function_sech[source]#

Bases: GinacFunction

The hyperbolic secant function.

EXAMPLES:

sage: sech(3.1415)                                                          # needs sage.rings.real_mpfr
0.0862747018248192

sage: # needs sage.symbolic
sage: sech(pi)
sech(pi)
sage: float(sech(pi))
0.0862667383340544...
sage: RR(sech(pi))
0.0862667383340544
sage: sech(0)
1
sage: sech(pi*I)
-1
sage: sech(pi*I/2)
Infinity
sage: sech(7*pi*I/2)
Infinity
sage: sech(8*pi*I/2)
1
sage: sech(8.*pi*I/2)
sec(4.00000000000000*pi)

sage: # needs sage.symbolic
sage: bool(diff(sech(x), x) == diff(1/cosh(x), x))
True
sage: diff(sech(x), x)
-sech(x)*tanh(x)
sage: latex(sech(x))
\operatorname{sech}\left(x\right)
sage: sech(x)._sympy_()                                                     # needs sympy
sech(x)
>>> from sage.all import *
>>> sech(RealNumber('3.1415'))                                                          # needs sage.rings.real_mpfr
0.0862747018248192

>>> # needs sage.symbolic
>>> sech(pi)
sech(pi)
>>> float(sech(pi))
0.0862667383340544...
>>> RR(sech(pi))
0.0862667383340544
>>> sech(Integer(0))
1
>>> sech(pi*I)
-1
>>> sech(pi*I/Integer(2))
Infinity
>>> sech(Integer(7)*pi*I/Integer(2))
Infinity
>>> sech(Integer(8)*pi*I/Integer(2))
1
>>> sech(RealNumber('8.')*pi*I/Integer(2))
sec(4.00000000000000*pi)

>>> # needs sage.symbolic
>>> bool(diff(sech(x), x) == diff(Integer(1)/cosh(x), x))
True
>>> diff(sech(x), x)
-sech(x)*tanh(x)
>>> latex(sech(x))
\operatorname{sech}\left(x\right)
>>> sech(x)._sympy_()                                                     # needs sympy
sech(x)
class sage.functions.hyperbolic.Function_sinh[source]#

Bases: GinacFunction

The hyperbolic sine function.

EXAMPLES:

sage: sinh(3.1415)                                                          # needs sage.rings.real_mpfr
11.5476653707437

sage: # needs sage.symbolic
sage: sinh(pi)
sinh(pi)
sage: float(sinh(pi))
11.54873935725774...
sage: RR(sinh(pi))
11.5487393572577
sage: latex(sinh(x))
\sinh\left(x\right)
sage: sinh(x)._sympy_()                                                     # needs sympy
sinh(x)
>>> from sage.all import *
>>> sinh(RealNumber('3.1415'))                                                          # needs sage.rings.real_mpfr
11.5476653707437

>>> # needs sage.symbolic
>>> sinh(pi)
sinh(pi)
>>> float(sinh(pi))
11.54873935725774...
>>> RR(sinh(pi))
11.5487393572577
>>> latex(sinh(x))
\sinh\left(x\right)
>>> sinh(x)._sympy_()                                                     # needs sympy
sinh(x)

To prevent automatic evaluation, use the hold parameter:

sage: sinh(arccosh(x), hold=True)                                           # needs sage.symbolic
sinh(arccosh(x))
>>> from sage.all import *
>>> sinh(arccosh(x), hold=True)                                           # needs sage.symbolic
sinh(arccosh(x))

To then evaluate again, use the unhold method:

sage: sinh(arccosh(x), hold=True).unhold()                                  # needs sage.symbolic
sqrt(x + 1)*sqrt(x - 1)
>>> from sage.all import *
>>> sinh(arccosh(x), hold=True).unhold()                                  # needs sage.symbolic
sqrt(x + 1)*sqrt(x - 1)
class sage.functions.hyperbolic.Function_tanh[source]#

Bases: GinacFunction

The hyperbolic tangent function.

EXAMPLES:

sage: tanh(3.1415)                                                          # needs sage.rings.real_mpfr
0.996271386633702
sage: tan(3.1415/4)                                                         # needs sage.rings.real_mpfr
0.999953674278156

sage: # needs sage.symbolic
sage: tanh(pi)
tanh(pi)
sage: float(tanh(pi))
0.99627207622075
sage: tanh(pi/4)
tanh(1/4*pi)
sage: RR(tanh(1/2))
0.462117157260010
>>> from sage.all import *
>>> tanh(RealNumber('3.1415'))                                                          # needs sage.rings.real_mpfr
0.996271386633702
>>> tan(RealNumber('3.1415')/Integer(4))                                                         # needs sage.rings.real_mpfr
0.999953674278156

>>> # needs sage.symbolic
>>> tanh(pi)
tanh(pi)
>>> float(tanh(pi))
0.99627207622075
>>> tanh(pi/Integer(4))
tanh(1/4*pi)
>>> RR(tanh(Integer(1)/Integer(2)))
0.462117157260010
sage: CC(tanh(pi + I*e))                                                    # needs sage.rings.real_mpfr sage.symbolic
0.997524731976164 - 0.00279068768100315*I
sage: ComplexField(100)(tanh(pi + I*e))                                     # needs sage.rings.real_mpfr sage.symbolic
0.99752473197616361034204366446 - 0.0027906876810031453884245163923*I
sage: CDF(tanh(pi + I*e))  # rel tol 2e-15                                  # needs sage.rings.complex_double sage.symbolic
0.9975247319761636 - 0.002790687681003147*I
>>> from sage.all import *
>>> CC(tanh(pi + I*e))                                                    # needs sage.rings.real_mpfr sage.symbolic
0.997524731976164 - 0.00279068768100315*I
>>> ComplexField(Integer(100))(tanh(pi + I*e))                                     # needs sage.rings.real_mpfr sage.symbolic
0.99752473197616361034204366446 - 0.0027906876810031453884245163923*I
>>> CDF(tanh(pi + I*e))  # rel tol 2e-15                                  # needs sage.rings.complex_double sage.symbolic
0.9975247319761636 - 0.002790687681003147*I

To prevent automatic evaluation, use the hold parameter:

sage: tanh(arcsinh(x), hold=True)                                           # needs sage.symbolic
tanh(arcsinh(x))
>>> from sage.all import *
>>> tanh(arcsinh(x), hold=True)                                           # needs sage.symbolic
tanh(arcsinh(x))

To then evaluate again, use the unhold method:

sage: tanh(arcsinh(x), hold=True).unhold()                                  # needs sage.symbolic
x/sqrt(x^2 + 1)
>>> from sage.all import *
>>> tanh(arcsinh(x), hold=True).unhold()                                  # needs sage.symbolic
x/sqrt(x^2 + 1)