Skip to content

Mathematics · Ch 12 — Limits and Derivatives

Derivative of Polynomials and Trigonometric Functions

12.5.2

Derivative of Polynomials and Trigonometric Functions

Derivative of Polynomials and Trigonometric Functions

The power of differentiation becomes truly useful when we apply it to the two most common families of functions: polynomials and trigonometric functions. Once you understand the derivative of xnx^n and the basic trig functions, you can differentiate almost any combination of them using the rules you have already learned.

Theorem 7 — Derivative of a General Polynomial

A polynomial function is any function of the form

f(x)=anxn+an−1xn−1+⋯+a1x+a0f(x) = a_n x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0

where each aia_i is a real number and an≠0a_n \neq 0. The derivative of this polynomial is obtained by differentiating term by term:

dfdx=nanxn−1+(n−1)an−1xn−2+⋯+2a2x+a1\frac{df}{dx} = n a_n x^{n-1} + (n-1) a_{n-1} x^{n-2} + \cdots + 2 a_2 x + a_1

Notice what happens to the constant term a0a_0 — its derivative is zero, so it disappears entirely. The coefficient a1a_1 (the one multiplying xx) becomes just a1a_1 after differentiation, since the derivative of xx is 11.

›Proof

This theorem follows directly from two results you already know. Part (i) of Theorem 5 tells us that the derivative of a sum is the sum of the derivatives. Theorem 6 gives us ddx(xn)=nxn−1\frac{d}{dx}(x^n) = n x^{n-1}. Putting them together:

ddx(anxn+an−1xn−1+⋯+a1x+a0)\frac{d}{dx}\left(a_n x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0\right)

=anddx(xn)+an−1ddx(xn−1)+⋯+a1ddx(x)+ddx(a0)= a_n \frac{d}{dx}(x^n) + a_{n-1} \frac{d}{dx}(x^{n-1}) + \cdots + a_1 \frac{d}{dx}(x) + \frac{d}{dx}(a_0)

=an(nxn−1)+an−1((n−1)xn−2)+⋯+a1(1)+0= a_n (n x^{n-1}) + a_{n-1} ((n-1) x^{n-2}) + \cdots + a_1 (1) + 0

=nanxn−1+(n−1)an−1xn−2+⋯+a1= n a_n x^{n-1} + (n-1) a_{n-1} x^{n-2} + \cdots + a_1


Derivative of sin x

Example 16: Compute the derivative of sin⁡x\sin x from first principles.

Let f(x)=sin⁡xf(x) = \sin x. By the definition of the derivative:

f′(x)=lim⁡h→0sin⁡(x+h)−sin⁡xhf'(x) = \lim_{h \to 0} \frac{\sin(x+h) - \sin x}{h}

Use the identity sin⁡A−sin⁡B=2cos⁡(A+B2)sin⁡(A−B2)\sin A - \sin B = 2 \cos\left(\frac{A+B}{2}\right) \sin\left(\frac{A-B}{2}\right) with A=x+hA = x+h and B=xB = x:

sin⁡(x+h)−sin⁡x=2cos⁡(2x+h2)sin⁡(h2)=2cos⁡(x+h2)sin⁡(h2)\sin(x+h) - \sin x = 2 \cos\left(\frac{2x+h}{2}\right) \sin\left(\frac{h}{2}\right) = 2 \cos\left(x + \frac{h}{2}\right) \sin\left(\frac{h}{2}\right)

Substitute this back:

f′(x)=lim⁡h→02cos⁡(x+h2)sin⁡(h2)hf'(x) = \lim_{h \to 0} \frac{2 \cos\left(x + \frac{h}{2}\right) \sin\left(\frac{h}{2}\right)}{h}

Rewrite as a product of two limits:

f′(x)=lim⁡h→0cos⁡(x+h2)⋅lim⁡h→0sin⁡(h2)h2f'(x) = \lim_{h \to 0} \cos\left(x + \frac{h}{2}\right) \cdot \lim_{h \to 0} \frac{\sin\left(\frac{h}{2}\right)}{\frac{h}{2}}

As h→0h \to 0, cos⁡(x+h2)→cos⁡x\cos\left(x + \frac{h}{2}\right) \to \cos x. And using the standard limit lim⁡θ→0sin⁡θθ=1\lim_{\theta \to 0} \frac{\sin \theta}{\theta} = 1 with θ=h2\theta = \frac{h}{2}, the second limit equals 11. Therefore

ddx(sin⁡x)=cos⁡x\frac{d}{dx}(\sin x) = \cos x

Important

The derivative of sin⁡x\sin x is cos⁡x\cos x. This is a fundamental result that you must memorize — it appears constantly in calculus.


Derivative of tan x

Example 17: Compute the derivative of tan⁡x\tan x.

Let f(x)=tan⁡x=sin⁡xcos⁡xf(x) = \tan x = \frac{\sin x}{\cos x}. Using the definition:

f′(x)=lim⁡h→0tan⁡(x+h)−tan⁡xhf'(x) = \lim_{h \to 0} \frac{\tan(x+h) - \tan x}{h}

Write each tan⁡\tan as sin⁡cos⁡\frac{\sin}{\cos}:

f′(x)=lim⁡h→01h[sin⁡(x+h)cos⁡(x+h)−sin⁡xcos⁡x]f'(x) = \lim_{h \to 0} \frac{1}{h}\left[\frac{\sin(x+h)}{\cos(x+h)} - \frac{\sin x}{\cos x}\right]

Combine the fractions:

f′(x)=lim⁡h→0sin⁡(x+h)cos⁡x−sin⁡xcos⁡(x+h)hcos⁡(x+h)cos⁡xf'(x) = \lim_{h \to 0} \frac{\sin(x+h)\cos x - \sin x \cos(x+h)}{h \cos(x+h) \cos x}

The numerator is sin⁡(x+h)cos⁡x−sin⁡xcos⁡(x+h)=sin⁡[(x+h)−x]=sin⁡h\sin(x+h)\cos x - \sin x \cos(x+h) = \sin[(x+h) - x] = \sin h, using the identity sin⁡(A−B)=sin⁡Acos⁡B−cos⁡Asin⁡B\sin(A-B) = \sin A \cos B - \cos A \sin B.

f′(x)=lim⁡h→0sin⁡hhcos⁡(x+h)cos⁡xf'(x) = \lim_{h \to 0} \frac{\sin h}{h \cos(x+h) \cos x}

Separate into two limits:

f′(x)=lim⁡h→0sin⁡hh⋅lim⁡h→01cos⁡(x+h)cos⁡xf'(x) = \lim_{h \to 0} \frac{\sin h}{h} \cdot \lim_{h \to 0} \frac{1}{\cos(x+h) \cos x}

The first limit is 11. As h→0h \to 0, cos⁡(x+h)→cos⁡x\cos(x+h) \to \cos x, so the second limit becomes 1cos⁡2x=sec⁡2x\frac{1}{\cos^2 x} = \sec^2 x. Therefore

ddx(tan⁡x)=sec⁡2x\frac{d}{dx}(\tan x) = \sec^2 x


Derivative of sin² x Using the Product Rule

Example 18: Compute the derivative of f(x)=sin⁡2xf(x) = \sin^2 x.

Write sin⁡2x\sin^2 x as (sin⁡x)(sin⁡x)(\sin x)(\sin x) and apply the product rule:

f′(x)=(sin⁡x)′(sin⁡x)+(sin⁡x)(sin⁡x)′f'(x) = (\sin x)'(\sin x) + (\sin x)(\sin x)'

=(cos⁡x)(sin⁡x)+(sin⁡x)(cos⁡x)= (\cos x)(\sin x) + (\sin x)(\cos x)

=2sin⁡xcos⁡x= 2 \sin x \cos x

Using the double-angle identity sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2 \sin x \cos x, we can also write

f′(x)=sin⁡2xf'(x) = \sin 2x

Note

This example shows how the product rule can be used even when the function is a power of a simpler function. The same approach works for cos⁡2x\cos^2 x, tan⁡2x\tan^2 x, and so on.


Derivatives of Other Trigonometric Functions

Example 21(i): Derivative of sin⁡2x\sin 2x.

Use the identity sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2 \sin x \cos x, then apply the product rule:

ddx(sin⁡2x)=2ddx(sin⁡xcos⁡x)\frac{d}{dx}(\sin 2x) = 2 \frac{d}{dx}(\sin x \cos x)

=2[(sin⁡x)′cos⁡x+sin⁡x(cos⁡x)′]= 2\left[(\sin x)' \cos x + \sin x (\cos x)'\right]

=2[cos⁡x⋅cos⁡x+sin⁡x⋅(−sin⁡x)]= 2\left[\cos x \cdot \cos x + \sin x \cdot (-\sin x)\right]

=2(cos⁡2x−sin⁡2x)= 2(\cos^2 x - \sin^2 x)

Using cos⁡2x−sin⁡2x=cos⁡2x\cos^2 x - \sin^2 x = \cos 2x, we get ddx(sin⁡2x)=2cos⁡2x\frac{d}{dx}(\sin 2x) = 2 \cos 2x.

Example 21(ii): Derivative of cot⁡x\cot x — two methods.

Method 1 (quotient rule): Write cot⁡x=cos⁡xsin⁡x\cot x = \frac{\cos x}{\sin x}.

ddx(cot⁡x)=(cos⁡x)′sin⁡x−cos⁡x(sin⁡x)′sin⁡2x\frac{d}{dx}(\cot x) = \frac{(\cos x)' \sin x - \cos x (\sin x)'}{\sin^2 x}

=(−sin⁡x)(sin⁡x)−(cos⁡x)(cos⁡x)sin⁡2x= \frac{(-\sin x)(\sin x) - (\cos x)(\cos x)}{\sin^2 x}

=−sin⁡2x−cos⁡2xsin⁡2x=−1sin⁡2x=−csc⁡2x= \frac{-\sin^2 x - \cos^2 x}{\sin^2 x} = -\frac{1}{\sin^2 x} = -\csc^2 x

Method 2 (using cot⁡x=1tan⁡x\cot x = \frac{1}{\tan x}):

ddx(cot⁡x)=ddx(1tan⁡x)=(1)′tan⁡x−1⋅(tan⁡x)′tan⁡2x\frac{d}{dx}(\cot x) = \frac{d}{dx}\left(\frac{1}{\tan x}\right) = \frac{(1)' \tan x - 1 \cdot (\tan x)'}{\tan^2 x}

=0−sec⁡2xtan⁡2x=−sec⁡2xtan⁡2x=−1cos⁡2x⋅cos⁡2xsin⁡2x=−1sin⁡2x=−csc⁡2x= \frac{0 - \sec^2 x}{\tan^2 x} = -\frac{\sec^2 x}{\tan^2 x} = -\frac{1}{\cos^2 x} \cdot \frac{\cos^2 x}{\sin^2 x} = -\frac{1}{\sin^2 x} = -\csc^2 x

Both methods give the same result: ddx(cot⁡x)=−csc⁡2x\frac{d}{dx}(\cot x) = -\csc^2 x.


Derivatives from First Principles — More Examples

Example 19(i): Derivative of f(x)=2x+3x−2f(x) = \frac{2x+3}{x-2} from first principles.

The function is not defined at x=2x = 2. Using the definition:

f′(x)=lim⁡h→02(x+h)+3(x+h)−2−2x+3x−2hf'(x) = \lim_{h \to 0} \frac{\frac{2(x+h)+3}{(x+h)-2} - \frac{2x+3}{x-2}}{h}

Combine the fractions in the numerator:

=lim⁡h→01h⋅(2x+2h+3)(x−2)−(2x+3)(x+h−2)(x+h−2)(x−2)= \lim_{h \to 0} \frac{1}{h} \cdot \frac{(2x+2h+3)(x-2) - (2x+3)(x+h-2)}{(x+h-2)(x-2)}

Expand the numerator carefully. The (2x+3)(x−2)(2x+3)(x-2) terms cancel, leaving −7h-7h. So

f′(x)=lim⁡h→0−7hh(x+h−2)(x−2)=lim⁡h→0−7(x+h−2)(x−2)=−7(x−2)2f'(x) = \lim_{h \to 0} \frac{-7h}{h(x+h-2)(x-2)} = \lim_{h \to 0} \frac{-7}{(x+h-2)(x-2)} = -\frac{7}{(x-2)^2}

Note that f′(x)f'(x) is also not defined at x=2x = 2.

Example 19(ii): Derivative of f(x)=x+1xf(x) = x + \frac{1}{x} from first principles.

The function is not defined at x=0x = 0.

f′(x)=lim⁡h→0(x+h)+1x+h−(x+1x)hf'(x) = \lim_{h \to 0} \frac{(x+h) + \frac{1}{x+h} - \left(x + \frac{1}{x}\right)}{h}

=lim⁡h→0h+1x+h−1xh=lim⁡h→0[1+1h(1x+h−1x)]= \lim_{h \to 0} \frac{h + \frac{1}{x+h} - \frac{1}{x}}{h} = \lim_{h \to 0} \left[1 + \frac{1}{h}\left(\frac{1}{x+h} - \frac{1}{x}\right)\right]

=lim⁡h→0[1+1h⋅x−(x+h)x(x+h)]=lim⁡h→0[1−1x(x+h)]= \lim_{h \to 0} \left[1 + \frac{1}{h} \cdot \frac{x - (x+h)}{x(x+h)}\right] = \lim_{h \to 0} \left[1 - \frac{1}{x(x+h)}\right]

=1−1x2= 1 - \frac{1}{x^2}

Again, f′(x)f'(x) is not defined at x=0x = 0.

Example 20(i): Derivative of f(x)=sin⁡x+cos⁡xf(x) = \sin x + \cos x from first principles.

f′(x)=lim⁡h→0sin⁡(x+h)+cos⁡(x+h)−sin⁡x−cos⁡xhf'(x) = \lim_{h \to 0} \frac{\sin(x+h) + \cos(x+h) - \sin x - \cos x}{h}

Group the sine terms and cosine terms:

=lim⁡h→0sin⁡(x+h)−sin⁡xh+lim⁡h→0cos⁡(x+h)−cos⁡xh= \lim_{h \to 0} \frac{\sin(x+h) - \sin x}{h} + \lim_{h \to 0} \frac{\cos(x+h) - \cos x}{h}

The first limit is cos⁡x\cos x (as shown in Example 16). For the second, use cos⁡(A+B)=cos⁡Acos⁡B−sin⁡Asin⁡B\cos(A+B) = \cos A \cos B - \sin A \sin B:

cos⁡(x+h)−cos⁡x=cos⁡xcos⁡h−sin⁡xsin⁡h−cos⁡x\cos(x+h) - \cos x = \cos x \cos h - \sin x \sin h - \cos x

=cos⁡x(cos⁡h−1)−sin⁡xsin⁡h= \cos x (\cos h - 1) - \sin x \sin h

So

lim⁡h→0cos⁡(x+h)−cos⁡xh=cos⁡x⋅lim⁡h→0cos⁡h−1h−sin⁡x⋅lim⁡h→0sin⁡hh\lim_{h \to 0} \frac{\cos(x+h) - \cos x}{h} = \cos x \cdot \lim_{h \to 0} \frac{\cos h - 1}{h} - \sin x \cdot \lim_{h \to 0} \frac{\sin h}{h}

Using lim⁡h→0cos⁡h−1h=0\lim_{h \to 0} \frac{\cos h - 1}{h} = 0 and lim⁡h→0sin⁡hh=1\lim_{h \to 0} \frac{\sin h}{h} = 1, this becomes −sin⁡x-\sin x. Therefore

f′(x)=cos⁡x−sin⁡xf'(x) = \cos x - \sin x

Example 20(ii): Derivative of f(x)=xsin⁡xf(x) = x \sin x from first principles.

f′(x)=lim⁡h→0(x+h)sin⁡(x+h)−xsin⁡xhf'(x) = \lim_{h \to 0} \frac{(x+h)\sin(x+h) - x \sin x}{h}

Expand the numerator:

=lim⁡h→0xsin⁡(x+h)+hsin⁡(x+h)−xsin⁡xh= \lim_{h \to 0} \frac{x\sin(x+h) + h\sin(x+h) - x\sin x}{h} …

Theorem 7

Theorem 7: Derivative of a Polynomial Function

Statement. Let

f(x)=anxn+an−1xn−1+⋯+a1x+a0f(x) = a_n x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0

be a polynomial function, where each aia_i is a real number and an≠0a_n \neq 0. Then the derivative function is given by

f′(x)=nanxn−1+(n−1)an−1xn−2+⋯+2a2x+a1.f'(x) = n a_n x^{n-1} + (n-1) a_{n-1} x^{n-2} + \cdots + 2 a_2 x + a_1.

The theorem tells us exactly how to differentiate any polynomial: bring down the power as a coefficient, then reduce the power by one, and do this for every term. The constant term a0a_0 vanishes because its derivative is zero.

Watch out

The hypothesis an≠0a_n \neq 0 simply guarantees that the polynomial is genuinely of degree nn. If the leading coefficient were zero, the highest power would be lower, and the formula would still work — it would just start from the actual highest non-zero term.


›Proof

Proof. We prove this by putting together two earlier results: part (i) of Theorem 5 and Theorem 6 from the textbook.

Step 1: Derivative of xnx^n. From Theorem 5, part (i), we already know that

ddxxn=nxn−1\frac{d}{dx} x^n = n x^{n-1}

for any positive integer nn. This is the foundation.

Step 2: Constant multiple rule. Theorem 6 tells us that if cc is a constant and gg is a differentiable function, then

ddx[c g(x)]=c⋅g′(x).\frac{d}{dx} [c\,g(x)] = c \cdot g'(x).

So for any term akxka_k x^k, we have

ddx(akxk)=ak⋅ddxxk=ak⋅kxk−1=kakxk−1.\frac{d}{dx} (a_k x^k) = a_k \cdot \frac{d}{dx} x^k = a_k \cdot k x^{k-1} = k a_k x^{k-1}.

Step 3: Sum rule. Theorem 6 also gives us that the derivative of a sum is the sum of the derivatives:

ddx[g(x)+h(x)]=g′(x)+h′(x).\frac{d}{dx} [g(x) + h(x)] = g'(x) + h'(x).

Step 4: Putting it together. The polynomial f(x)f(x) is a sum of terms of the form akxka_k x^k for k=0,1,2,…,nk = 0, 1, 2, \dots, n. Applying the sum rule and the constant multiple rule:

f′(x)=ddx(anxn+an−1xn−1+⋯+a1x+a0)f'(x) = \frac{d}{dx} \left( a_n x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0 \right)

=ddx(anxn)+ddx(an−1xn−1)+⋯+ddx(a1x)+ddx(a0).= \frac{d}{dx}(a_n x^n) + \frac{d}{dx}(a_{n-1} x^{n-1}) + \cdots + \frac{d}{dx}(a_1 x) + \frac{d}{dx}(a_0).

Now apply the derivative of xkx^k to each term:

=nanxn−1+(n−1)an−1xn−2+⋯+1⋅a1x0+0.= n a_n x^{n-1} + (n-1) a_{n-1} x^{n-2} + \cdots + 1 \cdot a_1 x^{0} + 0.

The last term ddx(a0)=0\frac{d}{dx}(a_0) = 0 because the derivative of any constant is zero. And x0=1x^0 = 1, so a1x0=a1a_1 x^0 = a_1.

Therefore …