Secant function
This functionality does not run in MATLAB.
sec(x
)
sec(x)
represents the secant function 1/cos(x)
.
The arguments have to be specified in radians, not in degrees. E.g., use π to specify an angle of 180^{o}.
All trigonometric functions are defined for complex arguments.
Floating point values are returned for floatingpoint arguments. Floating point intervals are returned for floatingpoint interval arguments. Unevaluated function calls are returned for most exact arguments.
Translations by integer multiples of π are eliminated from the argument. Further, arguments that are rational multiples of π lead to simplified results; symmetry relations are used to rewrite the result using an argument from the standard interval . Explicit expressions are returned for the following arguments:
.
Cf. Example 2.
The result is rewritten in terms of hyperbolic
functions, if the argument is a rational multiple of I
.
Cf. Example 3.
The functions expand
and combine
implement the
addition theorems for the trigonometric functions. Cf. Example 4.
The trigonometric functions do not respond to properties set
via assume
. Use simplify
to take such
properties into account. Cf. Example 4.
sec(x)
is immediately rewritten as 1/cos(x)
.
Cf. Example 5.
The inverse function is implemented by arcsec
.
Cf. Example 6.
The float attributes are kernel functions, i.e., floatingpoint evaluation is fast.
When called with a floatingpoint argument, the functions are
sensitive to the environment variable DIGITS
which determines
the numerical working precision.
We demonstrate some calls with exact and symbolic input data:
sin(PI), cos(1), tan(5 + I), csc(PI/2), sec(PI/11), cot(PI/8)
sin(x), cos(x + PI), tan(x^2  4)
Floating point values are computed for floatingpoint arguments:
sin(123.4), cos(5.6 + 7.8*I), cot(1.0/10^20)
Floating point intervals are computed for interval arguments:
sin(0 ... 1), cos(20 ... 30), tan(0 ... 5)
For the functions with discontinuities, the result may be a union of intervals:
csc(1 ... 1), tan(1 ... 2)
Some special values are implemented:
sin(PI/10), cos(2*PI/5), tan(123/8*PI), cot(PI/12)
Translations by integer multiples of π are eliminated from the argument:
sin(x + 10*PI), cos(3  PI), tan(x + PI), cot(2  10^100*PI)
All arguments that are rational multiples of π are transformed to arguments from the interval :
sin(4/7*PI), cos(20*PI/9), tan(123/11*PI), cot(PI/13)
Arguments that are rational multiples of I
are
rewritten in terms of hyperbolicfunctions:
sin(5*I), cos(5/4*I), tan(3*I)
For other complex arguments, use expand
to rewrite the result:
sin(5*I + 2*PI/3), cos(PI/4  5/4*I), tan(3*I + PI/2)
expand(sin(5*I + 2*PI/3)), expand(cos(5/4*I  PI/4)), expand(tan(3*I + PI/2))
The expand
function
implements the addition theorems:
expand(sin(x + PI/2)), expand(cos(x + y))
The combine
function
uses these theorems in the other direction, trying to rewrite products
of trigonometric functions:
combine(sin(x)*sin(y), sincos)
The trigonometric functions do not immediately respond to properties
set via assume
:
assume(n, Type::Integer): sin(n*PI), cos(n*PI)
Use simplify
to
take such properties into account:
simplify(sin(n*PI)), simplify(cos(n*PI))
assume(n, Type::Odd): sin(n*PI + x), simplify(sin(n*PI + x))
y := cos(x + n*PI) + cos(x  n*PI): y, simplify(y)
delete n, y:
Various relations exist between the trigonometric functions:
csc(x), sec(x)
Use rewrite
to
obtain a representation in terms of a specific target function:
rewrite(tan(x)*exp(2*I*x), sincos), rewrite(sin(x), cot)
The inverse functions are implemented by arcsin
, arccos
etc.:
sin(arcsin(x)), sin(arccos(x)), cos(arctan(x))
Note that arcsin(sin(x))
does not necessarily
yield x
, because arcsin
produces
values with real parts in the interval
:
arcsin(sin(3)), arcsin(sin(1.6 + I))
Various system functions such as diff
, float
, limit
, or series
handle expressions involving the
trigonometric functions:
diff(sin(x^2), x), float(sin(3)*cot(5 + I))
limit(x*sin(x)/tan(x^2), x = 0)
series((tan(sin(x))  sin(tan(x)))/sin(x^7), x = 0)

Arithmetical expression or a floatingpoint interval
x