Quick answer:
$$\frac{d}{dx}\sec x = \sec x\,\tan x$$
The formula is short, but it hides a few ideas worth understanding: why the answer is a product, where it is positive or negative, how it combines with the chain rule, and why it is the key to the famous integral of secant. This guide covers all of them with worked examples.
Why it works: the intuition
Secant is the reciprocal of cosine, \( \sec x = \frac{1}{\cos x} \). Think about what happens to a reciprocal when the original number changes. When \( \cos x \) is close to 1, small changes in cosine barely move \( \frac{1}{\cos x} \). When \( \cos x \) gets small, even a tiny change in cosine makes the reciprocal jump. So the slope of secant should be small near \( x = 0 \) and huge near \( x = \pm\frac{\pi}{2} \), where cosine hits zero.
The formula \( \sec x\tan x \) does exactly that. At \( x = 0 \) it equals 0, because \( \tan 0 = 0 \): the secant graph has a flat bottom there. As \( x \) approaches \( \frac{\pi}{2} \), both factors grow without bound, so the graph shoots up steeply toward its asymptote.
The sign also makes sense. Writing the derivative as \( \frac{\sin x}{\cos^2 x} \), the denominator is always positive, so the sign of the slope is the sign of \( \sin x \). Secant rises wherever sine is positive and falls wherever sine is negative.
Proof
Secant is the reciprocal of cosine: \( \sec x = \frac{1}{\cos x} = (\cos x)^{-1} \). Using the chain rule with the power rule, bring down the exponent \( -1 \), lower it to \( -2 \), and multiply by the derivative of cosine:
$$\frac{d}{dx}(\cos x)^{-1} = -(\cos x)^{-2}\cdot(-\sin x) = \frac{\sin x}{\cos^2 x}$$
Split the fraction into two familiar pieces:
$$\frac{\sin x}{\cos^2 x} = \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} = \sec x\,\tan x$$
Second proof: the quotient rule
If you prefer the quotient rule, treat \( \sec x \) as \( \frac{1}{\cos x} \) with top 1 and bottom \( \cos x \). The top has derivative 0, so only one term survives:
$$\frac{0\cdot\cos x - 1\cdot(-\sin x)}{\cos^2 x} = \frac{\sin x}{\cos^2 x}$$
Both proofs land on the same fraction, and splitting it gives \( \sec x\tan x \) again.
Chain rule form
$$\frac{d}{dx}\sec\big(g(x)\big) = \sec\big(g(x)\big)\tan\big(g(x)\big)\,g'(x)$$
Keep the same inside in both the secant and the tangent, then multiply by the derivative of the inside.
Examples
- \( \frac{d}{dx}\sec(2x) = 2\sec(2x)\tan(2x) \)
- \( \frac{d}{dx}\sec(x^3) = 3x^2\sec(x^3)\tan(x^3) \)
- \( \frac{d}{dx}\sec^2 x = 2\sec x\cdot\sec x\tan x = 2\sec^2 x\tan x \)
Example 3 is worth remembering: it is also the second derivative of \( \tan x \), because \( (\tan x)' = \sec^2 x \).
Example 4: \( e^{\sec x} \). The outer function is the exponential, which copies itself, and the inside is \( \sec x \):
$$\frac{d}{dx}e^{\sec x} = \sec x\tan x\,e^{\sec x}$$
Example 5: \( \ln|\sec x| \). Use derivative of the inside over the inside:
$$\frac{\sec x\tan x}{\sec x} = \tan x$$
That is why \( \int\tan x\,dx \) can be written \( \ln|\sec x| + C \), the same answer as \( -\ln|\cos x| + C \).
Example 6 (exam level): \( \ln|\sec x + \tan x| \). The inside has derivative \( \sec x\tan x + \sec^2 x \). Factor out \( \sec x \) and the inside cancels:
$$\begin{aligned} \frac{d}{dx}\ln|\sec x + \tan x| &= \frac{\sec x\tan x + \sec^2 x}{\sec x + \tan x} \\ &= \frac{\sec x(\tan x + \sec x)}{\sec x + \tan x} \\ &= \sec x \end{aligned}$$
This calculation proves the integral formula for secant, explained in detail in integral of sec x.
Slope and tangent line at a point
Find the tangent line to \( y = \sec x \) at \( x = \frac{\pi}{3} \). Since \( \cos\frac{\pi}{3} = \frac12 \), the point is \( \left(\frac{\pi}{3}, 2\right) \). The slope is \( \sec\frac{\pi}{3}\tan\frac{\pi}{3} = 2\sqrt3 \). In point-slope form:
$$y - 2 = 2\sqrt3\left(x - \frac{\pi}{3}\right)$$
The same steps work at any point; the equation of a tangent line guide has more examples.
The second derivative of sec x
Differentiate \( \sec x\tan x \) with the product rule. The first factor gives \( \sec x\tan x\cdot\tan x \) and the second gives \( \sec x\cdot\sec^2 x \):
$$\begin{aligned} \frac{d^2}{dx^2}\sec x &= \sec x\tan^2 x + \sec^3 x \\ &= 2\sec^3 x - \sec x \end{aligned}$$
The second line uses \( \tan^2 x = \sec^2 x - 1 \). On \( \left(-\frac{\pi}{2}, \frac{\pi}{2}\right) \) the secant is at least 1, so \( 2\sec^3 x - \sec x \) is positive and the graph is concave up, which matches its U shape.
Example 7: a rate problem with secant
Secant appears naturally whenever you measure a slanted distance. A lighthouse stands 1 km from a straight shoreline. Its beam makes angle \( \theta \) with the line from the lighthouse straight to the shore, so the beam’s length to the lit spot on the shore is
$$L = \sec\theta \ \text{km}$$
The light rotates at 0.5 radians per second. How fast is the beam getting longer when \( \theta = \frac{\pi}{3} \)? Differentiate with respect to time, using the chain rule because \( \theta \) depends on \( t \):
$$\frac{dL}{dt} = \sec\theta\tan\theta\,\frac{d\theta}{dt}$$
At \( \theta = \frac{\pi}{3} \) you already know \( \sec\theta\tan\theta = 2\sqrt3 \), so the rate is \( 2\sqrt3 \times 0.5 = \sqrt3 \), about 1.73 km per second. Notice how fast that grows as the angle opens up: near \( \theta = \frac{\pi}{2} \) the beam is almost parallel to the shore, and its length changes enormously for each small turn of the light.
A memory aid
Two patterns make the secant derivative hard to forget. First, it contains the original function: \( \sec x \) reappears as a factor in its own derivative, a little like \( e^x \). Second, the tangent and secant derivatives feed into each other. The derivative of tangent is made of secants, \( \sec^2 x \), and the derivative of secant is secant times tangent. If you remember that the two functions always travel together, and that neither result has a minus sign, you can rebuild the whole table. The cofunctions cosecant and cotangent follow the same pattern with a minus sign in front.
It also helps to sanity-check answers with the graph. Secant has a flat bottom at \( x = 0 \), so any formula you write down should give zero slope there. \( \sec x\tan x \) passes that test; \( \sec^2 x \), a common wrong answer, gives 1 and fails it.
The cosecant partner
The same method applied to \( \csc x = (\sin x)^{-1} \) gives
$$\frac{d}{dx}\csc x = -\csc x\,\cot x$$
The minus sign comes from differentiating \( \sin x \) to \( \cos x \) and then the \( -1 \) exponent. Compare with sec, where two minus signs cancel.
Where the slope is zero
\( \sec x\tan x = \frac{\sin x}{\cos^2 x} \) is zero exactly when \( \sin x = 0 \), that is at \( x = k\pi \). These are the turning points of the secant graph: local minima at \( x = 0, \pm 2\pi,\dots \) (where \( \sec x = 1 \)) and local maxima at \( x = \pm\pi, \pm 3\pi,\dots \) (where \( \sec x = -1 \)). You can confirm this with the critical points finder.
Common mistakes
- Answering \( \sec^2 x \). That is the derivative of \( \tan x \). For secant the answer is the product \( \sec x\tan x \).
- Mixing up secant and cosecant. \( \sec x = \frac{1}{\cos x} \), not \( \frac{1}{\sin x} \). The cosecant derivative carries a minus sign; the secant derivative does not.
- Changing the inside halfway through. \( \frac{d}{dx}\sec(2x) \) is \( 2\sec(2x)\tan(2x) \); writing \( \tan x \) instead of \( \tan(2x) \) in the second factor is a common slip.
- Forgetting the power on \( \sec^n x \). For \( \sec^3 x \) you get \( 3\sec^2 x \) times \( \sec x\tan x \), which is \( 3\sec^3 x\tan x \).
- Evaluating where secant does not exist. At \( x = \frac{\pi}{2} \) the function and its derivative are undefined.
Where it’s used
The derivative of secant is the engine behind two standard integrals, \( \int\sec x\tan x\,dx \) and \( \int\sec x\,dx \), and behind trig substitution with \( x = \sec\theta \) for expressions like \( \sqrt{x^2 - 1} \). It also appears when you differentiate \( \sec^2 x \) while working with the derivative of tan x and in problems involving the integral of sec²x.
In trig substitution, for example, setting \( x = \sec\theta \) means \( dx = \sec\theta\tan\theta\,d\theta \), and the identity \( \sec^2\theta - 1 = \tan^2\theta \) then simplifies the square root. Without the secant derivative, that whole family of integrals would be out of reach. In physics and engineering, secant shows up whenever a length is measured along a slanted line from a fixed point, so its derivative tells you how quickly that length changes as the angle moves.
Try it yourself
Type any secant expression below to see the steps, or open the full derivative calculator.
Step-by-step solver·Exact symbolic engine
Interactive Calculus Problem Solver
Derivatives, antiderivatives, definite and improper integrals, and limits. Every answer comes with the rules used, and antiderivatives are verified by differentiating them back.
Input syntax
- Powers
x^2, rootssqrt(x),cbrt(x), absolute value|x| - Implicit multiplication works:
3x sin(2x) sin cos tan sec csc cot,asin acos atan,sinh cosh tanhe^xorexp(x);ln(x)andlog(x)are both the natural log- Constants
piande; bounds acceptinfand-inf
Practice problems
Try these before checking the answers.
- \( \frac{d}{dx}\sec(4x) \)
- \( \frac{d}{dx}\,x\sec x \)
- \( \frac{d}{dx}\csc(2x) \)
- \( \frac{d}{dx}\sec(x^2) \)
- \( \frac{d}{dx}\sec^3 x \)
- \( \frac{d}{dx}(\sec x + \tan x) \)
Answers: (1) \( 4\sec(4x)\tan(4x) \); (2) \( \sec x + x\sec x\tan x \); (3) \( -2\csc(2x)\cot(2x) \); (4) \( 2x\sec(x^2)\tan(x^2) \); (5) \( 3\sec^3 x\tan x \); (6) \( \sec x\tan x + \sec^2 x \).
FAQ
What is the derivative of sec²(x)?
\( 2\sec^2 x\tan x \), shown in Example 3.
What is the integral of sec x?
\( \int\sec x\,dx = \ln|\sec x + \tan x| + C \). Example 6 above shows why it works: differentiating the right side gives back \( \sec x \).
What is the integral of sec x tan x?
Since the derivative of \( \sec x \) is \( \sec x\tan x \), the integral is simply \( \sec x + C \).
What is the second derivative of sec x?
It is \( \sec x\tan^2 x + \sec^3 x \), which simplifies to \( 2\sec^3 x - \sec x \).
What is the derivative of sec x at 0?
It is \( \sec 0\tan 0 = 1\cdot 0 = 0 \). The secant graph has a horizontal tangent at its lowest point.
Further reading
- Paul’s Online Notes: Derivatives of Trig Functions — derivations and worked examples for all six trig derivatives.
- Paul’s Online Notes: Chain Rule — many more composite-function examples, from simple to multi-layer.
Calculators for this topic
Keep learning
Implicit Differentiation: Step-by-Step Method with Examples
How to find dy/dx when y isn’t isolated. A 4-step implicit differentiation method with circle, x³+y³=6xy and trig examples, plus tangent lines.
Chain Rule Explained: Formula, Steps and 8 Examples
The chain rule differentiates composite functions: d/dx f(g(x)) = f'(g(x))·g'(x). Clear steps, 8 worked examples and the most common mistakes.

