# sec() Function & Examples

Use the sec() trigonometry function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## sec

#### sec(x)

Try it yourself:

```calculio
sec(2)
1 / cos(2)
```

[cot](https://calcul.io/function/cot/index.md)

[csc](https://calcul.io/function/csc/index.md)

[cos](https://calcul.io/function/cos/index.md)

---

## Calculate secant with sec

**sec(x)** returns the reciprocal of cosine: `1 / cos(x)`. It is useful in trigonometric identities and formulas expressed through reciprocal ratios.

## Example

`sec(0)` is 1. See [cos](https://calcul.io/function/cos/index.md) for the direct ratio and [asec](https://calcul.io/function/asec/index.md) for an inverse principal angle. The identity `sec(x)^2 = 1 + tan(x)^2` connects it to [tan](https://calcul.io/function/tan/index.md).

## Domain caution

Secant is undefined where cosine is zero, at odd multiples of pi/2. It grows rapidly near those angles, so use [pi](https://calcul.io/function/pi/index.md) for exact radians and handle near-pole values deliberately.

[All functions](https://calcul.io/functions/index.md)
