13.3.3 Hyperbolic Functions
13.3.3 Hyperbolic Functions
The Math::Cephes module provides access to hyperbolic functions with real arguments as well as complex. Hyperbolic functions are certain combinations of the exponentials and . There are two main uses of hyperbolic functions: for solving differential equations and for solving many engineering problems that are specified in terms of differential equations. For example, the tension at any point in a cable suspended by its ends and hanging under its own weight can be computed using hyperbolic functions.
The combinations and occur so frequently that it has been found convenient to give names to them. They are called cosh:u and sinh u, respectively. Thus, the definitions of the hyperbolic cosine and the hyperbolic sine are the following.
(8)
(9)
The properties the hyperbolic functions exhibit are quite similar to those shown by trigonometric functions. In addition, there is another parallel. When we talk about trigonometric functions, we think of a point (x,y) on the unit circle . It can be shown that we can describe hyperbolic functions with respect to the coordinates of a point (x,y) on the unit hyperbola . The hyperbolic function tanh u is defined in terms of sihn u and cosh u as follows.
(10)
The hyperbolic cotagent, secant and cosecant: coth u, sech u and csch u respectively, are defined as inverses of tanh u, sihn u and cosh u respectively.
Computing inverses of hyperbolic functions is also useful for many mathematical and engineering computations. The following program illustrates the use of the functions.
Program 13.4
#!/usr/bin/perl #file hyper.pl use strict; use Math::Cephes qw(:hypers); my $angle = $Math::Cephes::SQRT2; my $coshVal = cosh ($angle); my $sinhVal = sinh ($angle); my $tanhVal = tanh ($angle); print "cosh ($angle) = " . $coshVal . "\n"; print "sinh ($angle) = " . $sinhVal . "\n"; print "tanh ($angle) = " . $tanhVal . "\n"; print "acosh ($coshVal) = " . acosh ($coshVal) . "\n"; print "asinh ($sinhVal) = " . asinh ($sinhVal) . "\n"; print "atanh ($tanhVal) = " . atanh ($tanhVal) . "\n";
In this program, we call the variable passed as argument to the hyperbolic functions $angle simply to illustrate the parallel to trigonometric functions discussed earlier. The argument taken by the hyperbolic functions is not an angle in any sense, and can be any number, real or complex.
The output of the program is given below.
cosh (1.4142135623731) = 2.17818355660857
sinh (1.4142135623731) = 1.93506682217436
tanh (1.4142135623731) = 0.888385561585661
acosh (2.17818355660857) = 1.4142135623731
asinh (1.93506682217436) = 1.4142135623731
atanh (0.888385561585661) = 1.4142135623731
Math::Cephes provides functions to obtain the value of a hyperbolic function for a complex argument as well. The functions are called ccosh, csihn, ctanh, cacosh, casinhn and catanh, for cosine, sine, tangent and their inverses with complex arguments, respectively.
