Topic 2.10

Differentiate tangent and secant

Builds on checking a simplified derivative. 7 minutes.

The slope of the tangent function

The top graph shows \(y = \tan x\), with \(x\) in radians, and the orange line is the tangent line at the orange point. The bottom graph shows the slope at each \(x\), and the orange bar is as tall as the slope at the orange point.

Go to \(x = 0\), where the slope is 1. Go to \(x = \frac{\pi}{4}\), where the height is 1 and the slope is 2. Go to \(x = \frac{\pi}{3}\), where the slope is 4.

The curve becomes steeper toward the dashed lines. A dashed line like this is an asymptote: the curve comes close to it and never touches it. The slope is never below 1, so the curve rises at every \(x\), which is why it is green.

The slopes of tangent and secant

The secant is \(\sec x = \frac{1}{\cos x}\), the reciprocal of the cosine. Both \(\tan x\) and \(\sec x\) have no value where \(\cos x = 0\), at the dashed lines.

Drag \(x\) along each curve. The slope of tan is positive at every \(x\). The curve of sec is red where it falls and green where it rises, and its slope is 0 at \(x = 0\).

Both slopes come from the quotient rule, because \(\tan x\) and \(\sec x\) are fractions with \(\cos x\) on the bottom.

Notation

  1. Write \(\tan x\) as a ratio of sine and cosine. This is a quotient, so the quotient rule applies where \(\cos x \ne 0\).

    \[\tan x = \frac{\sin x}{\cos x}\]

    These rules hold only when \(x\) is in radians, because the derivative of \(\sin x\) is \(\cos x\) only in radians.

  2. The derivative of sine is cosine, and the derivative of cosine is minus sine. Put these into the quotient rule.

    \[\begin{aligned} \frac{d}{dx}\tan x \\ {}= \frac{\cos x\cdot\cos x - \sin x\cdot(-\sin x)}{\cos^2 x} \end{aligned}\]
  3. The top is \(\cos^2 x + \sin^2 x\), which is 1 by the Pythagorean identity, so the derivative of \(\tan x\) is 1 over \(\cos^2 x\).

    \[= \frac{1}{\cos^2 x} = \cy{\sec^2 x}\]
  4. Write \(\sec x\) as 1 over \(\cos x\). The top is the constant 1, whose derivative is 0.

    \[\begin{aligned} \frac{d}{dx}\sec x \\ {}= \frac{0\cdot\cos x - 1\cdot(-\sin x)}{\cos^2 x} \\ {}= \frac{\sin x}{\cos^2 x} \end{aligned}\]
  5. Split the result into two factors. The first factor is \(\sec x\), and the second is \(\tan x\).

    \[\begin{aligned} \frac{\sin x}{\cos^2 x} &= \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} \\ \frac{d}{dx}\sec x &= \cy{\sec x\tan x} \end{aligned}\]

When it fails

As \(x\) nears \(\frac{\pi}{2}\), \(\cos x\) nears 0. The curve of tan grows without bound, and its slope \(\frac{1}{\cos^2 x}\) grows faster.

At \(x = \frac{\pi}{2}\), \(\cos x\) is 0, so neither \(\tan x\) nor \(\sec x\) has a value or a slope there.

Example 1: a sum of two rules

Find \(y'\) for \(y = 2\sec x - \tan x\), and find the slope at \(x = 0\).

  1. The constant 2 stays as a factor, and the derivative of \(\sec x\) is \(\sec x\tan x\).

    \[(2\sec x)' = 2\sec x\tan x\]
  2. The derivative of \(\tan x\) is \(\sec^2 x\), and a minus sign stays in front of it.

    \[y' = 2\sec x\tan x - \sec^2 x\]
  3. Substitute \(x = 0\), where \(\sec 0 = 1\) and \(\tan 0 = 0\). The point is \((0, 2)\), and the slope is \(-1\), so the orange tangent line falls.

    \[y'(0) = 2\cdot 1\cdot 0 - 1^2 = \cy{-1}\]

Example 2: a product with tan

Find the slope of \(y = x\tan x\) at \(x = \frac{\pi}{4}\).

  1. Use the product rule. Add the derivative of the first factor times the second to the first times the derivative of the second.

    \[y' = 1\cdot\tan x + x\cdot(\tan x)'\]
  2. A tempting wrong move: Use \(\sec x\) as the derivative of \(\tan x\).

    \[\cr{y'(\tfrac{\pi}{4}) = 1 + \tfrac{\pi}{4}\sqrt2 \approx 2.11}\]

    The slope of tan at \(\frac{\pi}{4}\) is 2, but \(\sec\frac{\pi}{4} = \sqrt2 \approx 1.41\). The red dashed line with slope 2.11 is less steep than the curve and cuts across it.

  3. The derivative of tan is \(\sec^2 x\). At \(\frac{\pi}{4}\), \(\tan x = 1\) and \(\sec^2 x = 2\).

    \[y'(\tfrac{\pi}{4}) = 1 + \tfrac{\pi}{4}\cdot 2 = \cy{1 + \tfrac{\pi}{2}}\]
  4. As a check, \(1 + \frac{\pi}{2} \approx 2.57\). The orange tangent line now has the slope of the curve at the point.

Practice

Find \(y'\) for \(y = \dfrac{\sec x}{x}\), for \(0 < x < \frac{\pi}{2}\).

The top is \(\sec x\), with derivative \(\sec x\tan x\). The curve falls and then rises, so \(y'\) changes sign.

Solution
  1. The bottom is \(x\), with derivative 1. Substitute into the quotient rule.

    \[y' = \frac{x\,\sec x\tan x - \sec x}{x^2}\]
  2. Factor \(\sec x\) from the top.

    \[y' = \frac{\sec x\,(x\tan x - 1)}{x^2}\]
  3. For \(0 < x < \frac{\pi}{2}\), the factors \(\sec x\) and \(x^2\) are positive, so \(y'\) has the sign of \(x\tan x - 1\). This factor is about \(-0.73\) at \(x = 0.5\) and about \(0.56\) at \(x = 1\).

  4. The curve is red where the slope is negative, so it falls there, and green where it is positive, so it rises.

Questions

Questions 1 and 2 use the curve \(y = \sec x\) and its tangent. Question 3 needs a calculation.

  1. At the marked point \(x = \frac{\pi}{6}\), the height is \(\frac{2}{\sqrt3}\) and \(\tan x = \frac{1}{\sqrt3}\). What is the slope?

    • \(\tfrac23\)
    • \(\tfrac43\)
    • \(\tfrac{1}{\sqrt3}\)
    • \(\tfrac{2}{\sqrt3}\)
    Answer

    \(\tfrac23\)

  2. At the marked point \(x = -\frac{\pi}{4}\), the curve falls from left to right. What is the slope?

    • \(-\sqrt2\)
    • \(\sqrt2\)
    • \(-1\)
    Answer

    \(-\sqrt2\)

  3. Find \(y'\) for \(y = 3\tan x + x\).

    • \(3\sec^2 x + 1\)
    • \(3\sec x + 1\)
    • \(3\sec^2 x\)
    • \(3\sec x\tan x + 1\)
    Answer

    \(3\sec^2 x + 1\)

Summary

You differentiate \(\tan x\) to \(\sec^2 x\), and \(\sec x\) to \(\sec x\tan x\), when \(x\) is in radians.

Both rules come from the quotient rule, because tan is sine over cosine and sec is 1 over cosine.

You use them for every term that contains tan or sec, at inputs where \(\cos x\) is not 0.

This is one of four skills in topic 2.10 of Which & Why: AP Calculus.