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.
The Derivatives That Control the Checks
The standard derivative identities needed here are
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.
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\).
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\).
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.
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.
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.
Multiply \(\sec x\) by \(\frac{\sec x+\tan x}{\sec x+\tan x}\), wherever the denominator is nonzero.
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\).
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:
Consequently, on an interval where \(\sin x\ne0\),
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:
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.
On intervals where \(\cos x\ne0\), neither factor is zero. Taking logarithms of absolute values gives
Similarly, where \(\sin x\ne0\),
so
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\).
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\).
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\).
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\).
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
fails when checked: with \(u=3x\), its derivative is
not \(\cot(3x)\). The correction is to use a positive sign and divide by the inner derivative:
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:
If the argument is \(u=g(x)\), calculate \(u'=g'(x)\) before differentiating the proposed expression.
For a logarithm, use \(\frac{d}{dx}\ln|h|=h'/h\), provided \(h\ne0\).
Multiply by \(u'\) when differentiating trigonometric functions of \(u\).
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\).
Check Your Understanding
For each question, verify any proposed formula by differentiation and state the domain restriction that matters.
- Differentiate \(-\frac15\ln|\cos(5x)|\). Which trigonometric function results?
- Is \(\ln|\csc x+\cot x|\) an antiderivative of \(\csc x\) or of \(-\csc x\)? Show the derivative.
- Verify that \(\frac12\ln|\sec(2x)-\tan(2x)|\) is an antiderivative of \(-\sec(2x)\).
- Explain why \(\ln|\sec x+\tan x|\) and \(-\ln|\sec x-\tan x|\) have the same derivative wherever they are defined.
- What coefficient is required in front of \(\ln|\sin(7x)|\) for its derivative to equal \(\cot(7x)\)?