Sec
✖
Sec
Details

- Mathematical function, suitable for both symbolic and numerical manipulation.
- The argument of Sec is assumed to be in radians. (Multiply by Degree to convert from degrees.)
.
- 1/Cos[z] is automatically converted to Sec[z]. TrigFactorList[expr] does decomposition.
- For certain special arguments, Sec automatically evaluates to exact values.
- Sec can be evaluated to arbitrary numerical precision.
- Sec automatically threads over lists. »
- Sec can be used with Interval and CenteredInterval objects. »
Background & Context
- Sec is the secant function, which is one of the basic functions encountered in trigonometry. It is defined as the reciprocal of the cosine function:
. It is defined for real numbers by letting
be a radian angle measured counterclockwise from the
axis along the circumference of the unit circle. Sec[x] then gives the reciprocal of the horizontal coordinate of the arc endpoint. The equivalent schoolbook definition of the secant of an angle
in a right triangle is the ratio of the length of the hypotenuse to the length of the leg adjacent to
.
- Sec automatically evaluates to exact values when its argument is a simple rational multiple of
. For more complicated rational multiples, FunctionExpand can sometimes be used to obtain an explicit exact value. TrigFactorList can be used to factor expressions involving Sec into terms containing Sin and Cos. To specify an argument using an angle measured in degrees, the symbol Degree can be used as a multiplier (e.g. Sec[30 Degree]). When given exact numeric expressions as arguments, Sec may be evaluated to arbitrary numeric precision. Other operations useful for manipulation of symbolic expressions involving Sec include TrigToExp, TrigExpand, Simplify, and FullSimplify.
- Sec threads element-wise over lists and matrices. In contrast, MatrixFunction can be used to give the secant of a square matrix (i.e. the power series for the secant function with ordinary powers replaced by matrix powers) as opposed to the secants of the individual matrix elements.
- Sec is periodic with period
, as reported by FunctionPeriod. Sec is periodic with period
, as reported by FunctionPeriod. Sec satisfies the identity
, which is equivalent to the Pythagorean theorem. The definition of the secant function is extended to complex arguments
using the definition
, where
is the base of the natural logarithm. Sec has poles at
for
an integer and evaluates to ComplexInfinity at these points. Sec[z] has series expansion
about the origin that may be expressed in terms of the Euler numbers EulerE.
- The inverse function of Sec is ArcSec. The hyperbolic secant is given by Sech. Other related mathematical functions include Cos and Csc.
Examples
open allclose allBasic Examples (7)Summary of the most common use cases
The argument is given in radians:

https://wolfram.com/xid/0bud2i-s2m

Use Degree to specify an argument in degrees:

https://wolfram.com/xid/0bud2i-lx6


https://wolfram.com/xid/0bud2i-lxs

Plot over a subset of the reals:

https://wolfram.com/xid/0bud2i-koz

Plot over a subset of the complexes:

https://wolfram.com/xid/0bud2i-kiedlx


https://wolfram.com/xid/0bud2i-unh

Asymptotic expansion at a singular point:

https://wolfram.com/xid/0bud2i-klydni

Scope (47)Survey of the scope of standard use cases
Numerical Evaluation (5)

https://wolfram.com/xid/0bud2i-txv

The precision of the output tracks the precision of the input:

https://wolfram.com/xid/0bud2i-xth5g

Evaluate for complex arguments:

https://wolfram.com/xid/0bud2i-mw6

Evaluate Sec efficiently at high precision:

https://wolfram.com/xid/0bud2i-di5gcr


https://wolfram.com/xid/0bud2i-bq2c6r

Compute the elementwise values of an array using automatic threading:

https://wolfram.com/xid/0bud2i-thgd2

Or compute the matrix Sec function using MatrixFunction:

https://wolfram.com/xid/0bud2i-o5jpo

Compute worst-case guaranteed intervals using Interval and CenteredInterval objects:

https://wolfram.com/xid/0bud2i-d49o1


https://wolfram.com/xid/0bud2i-lmyeh7


https://wolfram.com/xid/0bud2i-chi9ay

Or compute average-case statistical intervals using Around:

https://wolfram.com/xid/0bud2i-cw18bq

Specific Values (6)
Values of Sec at fixed points:

https://wolfram.com/xid/0bud2i-nww7l


https://wolfram.com/xid/0bud2i-bdij6w


https://wolfram.com/xid/0bud2i-drqkdo

Singular points of Sec:

https://wolfram.com/xid/0bud2i-cw39qs

Local extrema of Sec:

https://wolfram.com/xid/0bud2i-kb0ip3

Find a local minimum of Sec as a root of :

https://wolfram.com/xid/0bud2i-0hynlo


https://wolfram.com/xid/0bud2i-f2hrld


https://wolfram.com/xid/0bud2i-khtscy

Simple exact values are generated automatically:

https://wolfram.com/xid/0bud2i-du

More complicated cases require explicit use of FunctionExpand:

https://wolfram.com/xid/0bud2i-izd


https://wolfram.com/xid/0bud2i-x8a

Visualization (3)
Plot the Sec function:

https://wolfram.com/xid/0bud2i-ecj8m7


https://wolfram.com/xid/0bud2i-bo5grg


https://wolfram.com/xid/0bud2i-d21315


https://wolfram.com/xid/0bud2i-epb4bn

Function Properties (13)
The real domain of Sec:

https://wolfram.com/xid/0bud2i-cl7ele


https://wolfram.com/xid/0bud2i-de3irc

Sec achieves all real values except the open interval :

https://wolfram.com/xid/0bud2i-evf2yr

Sec is a periodic function with a period :

https://wolfram.com/xid/0bud2i-ewxrep

Sec is an even function:

https://wolfram.com/xid/0bud2i-dnla5q

Sec has the mirror property :

https://wolfram.com/xid/0bud2i-heoddu

Sec is not an analytic function:

https://wolfram.com/xid/0bud2i-h5x4l2


https://wolfram.com/xid/0bud2i-e434t9

Sec is monotonic in a specific range:

https://wolfram.com/xid/0bud2i-g6kynf


https://wolfram.com/xid/0bud2i-nlz7s

Sec is not injective:

https://wolfram.com/xid/0bud2i-gi38d7


https://wolfram.com/xid/0bud2i-ctca0g

Sec is not surjective:

https://wolfram.com/xid/0bud2i-hkqec4


https://wolfram.com/xid/0bud2i-hdm869

Sec is neither non-negative nor non-positive:

https://wolfram.com/xid/0bud2i-84dui

It has both singularity and discontinuity when x is a multiple of π/2:

https://wolfram.com/xid/0bud2i-mdtl3h


https://wolfram.com/xid/0bud2i-mn5jws


https://wolfram.com/xid/0bud2i-kdss3

It is convex for x in [-1.5,1.5]:

https://wolfram.com/xid/0bud2i-io426y


https://wolfram.com/xid/0bud2i-bb47uv

TraditionalForm formatting:

https://wolfram.com/xid/0bud2i-n2vtm

Differentiation (3)
Integration (3)
Indefinite integral of Sec:

https://wolfram.com/xid/0bud2i-bponid

Definite integral of Sec over a period is 0:

https://wolfram.com/xid/0bud2i-b9jw7l


https://wolfram.com/xid/0bud2i-petr7o


https://wolfram.com/xid/0bud2i-fmyack

Series Expansions (4)
Find the Taylor expansion using Series:

https://wolfram.com/xid/0bud2i-ewr1h8

Plot the first three approximations for Sec around :

https://wolfram.com/xid/0bud2i-binhar

General term in the series expansion of Sec:

https://wolfram.com/xid/0bud2i-dznx2j

Fourier series of Sec:

https://wolfram.com/xid/0bud2i-f64drv

Sec can be applied to power series:

https://wolfram.com/xid/0bud2i-f7dy9o

Function Identities and Simplifications (6)
Sec of a double angle:

https://wolfram.com/xid/0bud2i-mjplp7

Sec of a sum:

https://wolfram.com/xid/0bud2i-nfe4y

Convert multiple‐angle expressions:

https://wolfram.com/xid/0bud2i-jor


https://wolfram.com/xid/0bud2i-r64

Convert sums of trigonometric functions to products:

https://wolfram.com/xid/0bud2i-s7f

Expand assuming real variables and
:

https://wolfram.com/xid/0bud2i-pl4

Convert to complex exponentials:

https://wolfram.com/xid/0bud2i-i6a

Function Representations (4)
Representation through Sin:

https://wolfram.com/xid/0bud2i-df304y

Representation through Bessel functions:

https://wolfram.com/xid/0bud2i-ewa69v


https://wolfram.com/xid/0bud2i-9y9s4

Representation through SphericalHarmonicY:

https://wolfram.com/xid/0bud2i-eeooyq

Representation in terms of MeijerG:

https://wolfram.com/xid/0bud2i-6ksgj


https://wolfram.com/xid/0bud2i-d3d3ld

Applications (4)Sample problems that can be solved with this function
Generate a plot with poles removed:

https://wolfram.com/xid/0bud2i-b4w

Generate a plot over the complex argument plane:

https://wolfram.com/xid/0bud2i-d5v

Solve a differential equation:

https://wolfram.com/xid/0bud2i-dz73fk

Pursuit curve in the reference frame of the predator with prey moving half as fast along a line:

https://wolfram.com/xid/0bud2i-5ak5c


https://wolfram.com/xid/0bud2i-n4deyb

Properties & Relations (11)Properties of the function, and connections to other functions
Basic parity and periodicity properties of the secant function get automatically applied:

https://wolfram.com/xid/0bud2i-fpk


https://wolfram.com/xid/0bud2i-yh2


https://wolfram.com/xid/0bud2i-ba4


https://wolfram.com/xid/0bud2i-jhh

Use TrigFactorList to factor Sec into Sin and Cos:

https://wolfram.com/xid/0bud2i-iwb


https://wolfram.com/xid/0bud2i-eul

Complicated expressions containing trigonometric functions do not autosimplify:

https://wolfram.com/xid/0bud2i-wnm


https://wolfram.com/xid/0bud2i-lxv


https://wolfram.com/xid/0bud2i-yow


https://wolfram.com/xid/0bud2i-qwt

Evaluate under additional assumptions:

https://wolfram.com/xid/0bud2i-bhp


https://wolfram.com/xid/0bud2i-kd9

Compositions with the inverse functions:

https://wolfram.com/xid/0bud2i-fk1


https://wolfram.com/xid/0bud2i-s9l


https://wolfram.com/xid/0bud2i-qtrjkp

Solve a trigonometric equation:

https://wolfram.com/xid/0bud2i-sup


https://wolfram.com/xid/0bud2i-6j


https://wolfram.com/xid/0bud2i-y7n

Numerically solve a transcendental equation:

https://wolfram.com/xid/0bud2i-lj6

Sec is automatically returned as a special case for many mathematical functions:

https://wolfram.com/xid/0bud2i-wag

Calculate residue symbolically and numerically:

https://wolfram.com/xid/0bud2i-n85


https://wolfram.com/xid/0bud2i-tey

Possible Issues (5)Common pitfalls and unexpected behavior
Machine-precision input is insufficient to give a correct answer:

https://wolfram.com/xid/0bud2i-n9g

With exact input, the answer is correct:

https://wolfram.com/xid/0bud2i-zi

A larger setting for $MaxExtraPrecision is needed:

https://wolfram.com/xid/0bud2i-ldd


https://wolfram.com/xid/0bud2i-pxq

For arguments with imaginary part too large, the result cannot be represented by a computer:

https://wolfram.com/xid/0bud2i-dcuu7v

The precision of the output can be much smaller or larger than the precision of the input:

https://wolfram.com/xid/0bud2i-clnxgf


https://wolfram.com/xid/0bud2i-joyq7

In TraditionalForm, parentheses are needed around the argument:

https://wolfram.com/xid/0bud2i-zcw


https://wolfram.com/xid/0bud2i-uf

Neat Examples (6)Surprising or curious use cases
Various integrals and products:

https://wolfram.com/xid/0bud2i-waq


https://wolfram.com/xid/0bud2i-i4t

Plot Sec at integer points:

https://wolfram.com/xid/0bud2i-pwn


https://wolfram.com/xid/0bud2i-tqw

Generate the Sec function from integrals and sums:

https://wolfram.com/xid/0bud2i-cmv


https://wolfram.com/xid/0bud2i-trv


https://wolfram.com/xid/0bud2i-wco

Wolfram Research (1988), Sec, Wolfram Language function, https://reference.wolfram.com/language/ref/Sec.html (updated 2021).
Text
Wolfram Research (1988), Sec, Wolfram Language function, https://reference.wolfram.com/language/ref/Sec.html (updated 2021).
Wolfram Research (1988), Sec, Wolfram Language function, https://reference.wolfram.com/language/ref/Sec.html (updated 2021).
CMS
Wolfram Language. 1988. "Sec." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Sec.html.
Wolfram Language. 1988. "Sec." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Sec.html.
APA
Wolfram Language. (1988). Sec. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Sec.html
Wolfram Language. (1988). Sec. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Sec.html
BibTeX
@misc{reference.wolfram_2025_sec, author="Wolfram Research", title="{Sec}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/Sec.html}", note=[Accessed: 01-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_sec, organization={Wolfram Research}, title={Sec}, year={2021}, url={https://reference.wolfram.com/language/ref/Sec.html}, note=[Accessed: 01-May-2025
]}