Tutorials › Calculus II › Checking Tangent, Secant, Cotangent, And Cosecant Antiderivatives

Tangent and Secant Powers · Tutorial 150 of 998

Checking Tangent, Secant, Cotangent, And Cosecant Antiderivatives

Use differentiation to verify trigonometric antiderivatives and recognize when different logarithmic answers express the same result.

Intermediate 9 min read

What You'll Learn

  • Verify proposed antiderivatives by differentiating them on their domains.
  • Track the inner-function factor when the angle is not simply x.
  • Check the signs in cotangent and cosecant logarithmic formulas.
  • Recognize equivalent logarithmic expressions using trigonometric identities.
  • Identify intervals where the formulas are defined and the integrand is continuous.

Why Check an Antiderivative?

An antiderivative is a function whose derivative equals a given integrand. Trigonometric integrals often produce logarithms, and a sign or constant-factor error can be difficult to spot by looking at the final expression alone. Differentiation provides a direct check: a proposed answer is correct on an interval if its derivative equals the integrand at every point of that interval.

This tutorial checks common antiderivatives involving tangent, secant, cotangent, and cosecant. The main points are to keep the chain-rule factor, handle the signs of cotangent and cosecant carefully, and distinguish expressions that look different but differ only by an equivalent logarithmic form.

Definition: A function \(F\) is an antiderivative of \(f\) on an interval \(I\) if \(F\) is differentiable on \(I\) and \(F'(x)=f(x)\) for every \(x\in I\). An antiderivative formula applies only on intervals where its expressions are defined and the integrand is continuous.

The Derivatives That Control the Checks

The standard derivative identities needed here are

$$ \frac{d}{dx}\tan x=\sec^2 x,\qquad \frac{d}{dx}\sec x=\sec x\tan x, $$
$$ \frac{d}{dx}\cot x=-\csc^2 x,\qquad \frac{d}{dx}\csc x=-\csc x\cot x. $$

For a composite angle \(u=g(x)\), the chain rule supplies a factor \(u'=g'(x)\). The logarithmic derivative rule, \(\frac{d}{dx}\ln|h(x)|=\frac{h'(x)}{h(x)}\) when \(h(x)\ne0\), then turns the proposed logarithms into ratios that can be simplified.

Key rule: When differentiating a logarithmic expression in \(u=g(x)\), differentiate the logarithm with respect to its entire argument and then multiply by \(g'(x)\). Omitting this factor gives a wrong antiderivative whenever \(g'(x)\ne1\).

Checking the Four Basic Forms

Each formula below is valid on any interval on which the trigonometric expressions involved are defined. In particular, tangent and secant require \(\cos x\ne0\), while cotangent and cosecant require \(\sin x\ne0\).

$$ \int \tan x\,dx=-\ln|\cos x|+C=\ln|\sec x|+C. $$

Indeed, \(\frac{d}{dx}[-\ln|\cos x|]=-\frac{-\sin x}{\cos x}=\tan x\). Also, \(\ln|\sec x|=-\ln|\cos x|\), because \(\sec x=1/\cos x\).

$$ \int \sec x\,dx=\ln|\sec x+\tan x|+C. $$

Differentiating the logarithm gives \(\frac{\sec x\tan x+\sec^2 x}{\sec x+\tan x}=\sec x\). The numerator factors as \(\sec x(\tan x+\sec x)\), so the denominator cancels.

$$ \int \cot x\,dx=\ln|\sin x|+C. $$

The derivative is \(\frac{\cos x}{\sin x}=\cot x\). This formula has a positive sign: the derivative of \(\ln|\sin x|\) is positive \(\cot x\), even though the derivative of \(\cot x\) itself is negative.

$$ \int \csc x\,dx=\ln|\csc x-\cot x|+C. $$

To check it, differentiate the logarithm. The numerator of the resulting ratio is \(-\csc x\cot x+\csc^2 x=\csc x(\csc x-\cot x)\), so division by \(\csc x-\cot x\) leaves \(\csc x\).

Why the Secant and Cosecant Logarithms Work

The secant formula can be derived by multiplying the integrand by a carefully chosen form of 1. This creates the derivative of the logarithm’s argument in the numerator.

1
Choose a useful factor.
Multiply \(\sec x\) by \(\frac{\sec x+\tan x}{\sec x+\tan x}\), wherever the denominator is nonzero.
2
Recognize a derivative.
The numerator becomes \(\sec x(\sec x+\tan x)=\sec^2 x+\sec x\tan x\), which is the derivative of \(\sec x+\tan x\).
3
Integrate the logarithmic derivative.
Thus \(\sec x=\frac{(\sec x+\tan x)'}{\sec x+\tan x}\), whose antiderivative is \(\ln|\sec x+\tan x|\).

The cosecant formula follows the same principle, with the signs determined by the derivatives of cosecant and cotangent:

$$ (\csc x-\cot x)' =-\csc x\cot x+\csc^2 x =\csc x(\csc x-\cot x). $$

Consequently, on an interval where \(\sin x\ne0\),

$$ \frac{d}{dx}\ln|\csc x-\cot x| =\frac{(\csc x-\cot x)'}{\csc x-\cot x} =\csc x. $$

This derivation also explains why changing the sign inside the cosecant logarithm without changing anything else is not harmless. In fact, the other common expression has the opposite logarithmic derivative:

$$ \frac{d}{dx}\ln|\csc x+\cot x|=-\csc x. $$

Equivalent Logarithmic Forms

Two logarithmic antiderivatives can look different while having the same derivative. The identities below show exactly how the common forms are related. Their absolute values are important because the expressions inside the logarithms need not be positive.

$$ (\sec x+\tan x)(\sec x-\tan x) =\sec^2 x-\tan^2 x=1. $$

On intervals where \(\cos x\ne0\), neither factor is zero. Taking logarithms of absolute values gives

$$ \ln|\sec x+\tan x|=-\ln|\sec x-\tan x|. $$

Similarly, where \(\sin x\ne0\),

$$ (\csc x-\cot x)(\csc x+\cot x) =\csc^2 x-\cot^2 x=1, $$

so

$$ \ln|\csc x-\cot x|=-\ln|\csc x+\cot x|. $$

The negative sign in the last identity is essential. It is why \(\ln|\csc x+\cot x|\) alone is an antiderivative of \(-\csc x\), not of \(\csc x\).

Worked Examples

Worked Example: Checking a Tangent Antiderivative with a Chain Factor

Check the proposed antiderivative \(\frac{1}{3}\ln|\sec(3x-2)|\) for \(\tan(3x-2)\). Set \(u=3x-2\), so \(u'=3\).

$$ \begin{aligned} \frac{d}{dx}\left[\frac{1}{3}\ln|\sec u|\right] &=\frac{1}{3}\frac{1}{\sec u}\left(\sec u\tan u\right)u'\\ &=\frac{1}{3}\tan u\cdot 3\\ &=\tan u\\ &=\tan(3x-2). \end{aligned} $$

Therefore the proposed expression is an antiderivative wherever \(\cos(3x-2)\ne0\). The chain factor \(3\) cancels the coefficient \(\frac13\). Differentiating the result recovers the original integrand, as required.

Worked Example: Checking a Secant Antiderivative

Check \(\frac12\ln|\sec(2x+\frac{\pi}{6})+\tan(2x+\frac{\pi}{6})|\) for \(\sec(2x+\frac{\pi}{6})\). Write \(u=2x+\frac{\pi}{6}\), so \(u'=2\).

$$ \begin{aligned} \frac{d}{dx}\left[\frac12\ln|\sec u+\tan u|\right] &=\frac12\frac{\sec u\tan u+\sec^2 u}{\sec u+\tan u}\cdot 2\\ &=\frac{\sec u(\tan u+\sec u)}{\sec u+\tan u}\\ &=\sec u\\ &=\sec\left(2x+\frac{\pi}{6}\right). \end{aligned} $$

The denominator is nonzero wherever \(\cos u\ne0\): if \(\sec u+\tan u=0\), multiplying by \(\cos u\) would give \(1+\sin u=0\), which forces \(\cos u=0\). Thus the logarithm is defined on every interval avoiding the secant’s poles, and differentiation verifies the answer there.

Worked Example: Checking a Cotangent Antiderivative

Check \(\frac14\ln|\sin(4x)|\) for \(\cot(4x)\). Let \(u=4x\), so \(u'=4\).

$$ \begin{aligned} \frac{d}{dx}\left[\frac14\ln|\sin u|\right] &=\frac14\frac{\cos u}{\sin u}\,u'\\ &=\frac14\cot u\cdot4\\ &=\cot u\\ &=\cot(4x). \end{aligned} $$

The proposed expression is valid on intervals where \(\sin(4x)\ne0\), which is also where \(\cot(4x)\) is defined. The positive sign is confirmed by the calculation.

Worked Example: Checking the Cosecant Sign and an Equivalent Form

Check \(-\frac12\ln|\csc(2x)+\cot(2x)|\) for \(\csc(2x)\). Put \(u=2x\), giving \(u'=2\).

$$ \begin{aligned} \frac{d}{dx}\left[-\frac12\ln|\csc u+\cot u|\right] &=-\frac12\frac{-\csc u\cot u-\csc^2 u}{\csc u+\cot u}\cdot2\\ &=\frac{\csc u(\cot u+\csc u)}{\csc u+\cot u}\\ &=\csc u\\ &=\csc(2x). \end{aligned} $$

So this is a correct antiderivative wherever \(\sin(2x)\ne0\). It is the same logarithmic form as \(\frac12\ln|\csc(2x)-\cot(2x)|\), because the two expressions inside the logarithms have product 1. Differentiation verifies the proposed answer directly, including its negative sign.

A Common Sign and Chain-Rule Mistake

A frequent error is to copy the cotangent formula with a negative sign, or to write a formula for an inner angle without its derivative factor. For example, the incorrect claim

$$ \frac{d}{dx}\left[-\ln|\sin(3x)|\right]=\cot(3x) $$

fails when checked: with \(u=3x\), its derivative is

$$ -\frac{\cos u}{\sin u}\cdot3=-3\cot(3x), $$

not \(\cot(3x)\). The correction is to use a positive sign and divide by the inner derivative:

$$ \frac{d}{dx}\left[\frac13\ln|\sin(3x)|\right] =\frac13\cot(3x)\cdot3 =\cot(3x). $$

Checking by differentiation catches both errors at once: the sign and the missing chain-rule factor.

How to Check a Proposed Formula Reliably

Use the following routine whenever a tangent, secant, cotangent, or cosecant antiderivative is in doubt:

1
Identify the inner angle.
If the argument is \(u=g(x)\), calculate \(u'=g'(x)\) before differentiating the proposed expression.
2
Differentiate the outer function.
For a logarithm, use \(\frac{d}{dx}\ln|h|=h'/h\), provided \(h\ne0\).
3
Include the chain factor.
Multiply by \(u'\) when differentiating trigonometric functions of \(u\).
4
Simplify and compare.
Use the trigonometric identities to reduce the derivative to the exact integrand, including its sign and coefficient.

The domain check is part of the verification, not an optional detail. An antiderivative is considered on an interval where the original integrand is defined; the derivative calculation must hold throughout that interval. For example, a formula involving \(\cot x\) cannot apply across a point where \(\sin x=0\).

Takeaway: A proposed antiderivative is verified by differentiating it on its domain and simplifying to the integrand. For these trigonometric forms, the most reliable checks track the inner derivative, preserve the signs in the cotangent and cosecant identities, and retain absolute values in logarithms.

Check Your Understanding

For each question, verify any proposed formula by differentiation and state the domain restriction that matters.

  1. Differentiate \(-\frac15\ln|\cos(5x)|\). Which trigonometric function results?
  2. Is \(\ln|\csc x+\cot x|\) an antiderivative of \(\csc x\) or of \(-\csc x\)? Show the derivative.
  3. Verify that \(\frac12\ln|\sec(2x)-\tan(2x)|\) is an antiderivative of \(-\sec(2x)\).
  4. Explain why \(\ln|\sec x+\tan x|\) and \(-\ln|\sec x-\tan x|\) have the same derivative wherever they are defined.
  5. What coefficient is required in front of \(\ln|\sin(7x)|\) for its derivative to equal \(\cot(7x)\)?

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon