3.6 Derivatives of Trigonometric Functions

We will now take a brief hiatus from our steady march through general theorems to discuss the differentiation of concrete functions. Our machinery thus far smoothly handles the differentiation of polynomials and rational functions. However, if we survey our grand taxonomy of functions in Section 1.6, we find several wild species remaining:

  • •
    ​

    Radicals (e.g., roots like xn\sqrt[n]{x})

  • •
    ​

    Trigonometric functions (sin⁡x,cos⁡x,tan⁡x\sin x,\cos x,\tan x, etc.)

  • •
    ​

    Exponentials and Logarithms (ex,log⁡x\mathrm{e}^{x},\log x)

  • •
    ​

    Non-elementary functions

In this section, we will hunt down the derivatives of the fundamental trigonometric functions. We will lay down the foundation for sine and cosine, and leave the more exotic members of the taxonomy until we have derived another sophisticated tool (the Chain Rule).

3.6.1 The Algebraic Path: Hadamard’s Advice

We start with the most fundamental wave of all: f⁢(x)=sin⁡xf(x)=\sin x. Let us boldly apply our first-principles definition of the derivative and observe where the machinery gets stuck:

equation (3.13) (3.13)
limh→0f⁢(x+h)−f⁢(x)h=limh→0sin⁡(x+h)−sin⁡xh.\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}=\lim_{h\to 0}\frac{\sin(x+h)-\sin x}{h}.

Substituting h=0h=0 inevitably brings us to the classic indeterminate form 00\frac{0}{0}. We desperately need to eliminate the hh in the denominator. Remembering our fundamental limit limh→0sin⁡hh=1\lim_{h\to 0}\frac{\sin h}{h}=1, a strategy crystallizes: we must factor the numerator into the form (sin⁡h)×(something)(\sin h)\times(\text{something}).

This requires hunting for a trigonometric identity to expand sin⁡(x+h)\sin(x+h). Which identity? Here is a powerful rule of thumb: every trigonometric identity can be derived from Euler’s identity.

Story (The Complex Bridge).

As the great French mathematician Jacques Hadamard once famously remarked:

The shortest path between two truths in the real domain passes through the complex domain.

We can find our real-valued addition formulas by taking a quick, elegant detour through the complex plane using Euler’s formula: ei⁢θ=cos⁡θ+i⁢sin⁡θ\mathrm{e}^{i\theta}=\cos\theta+i\sin\theta.

Lemma 3.6.1 (Addition Formulas via Euler).

For any x,h∈ℝx,h\in\mathbb{R}, we have:

cos⁡(x+h)=cos⁡x⁢cos⁡h−sin⁡x⁢sin⁡h,sin⁡(x+h)=cos⁡x⁢sin⁡h+sin⁡x⁢cos⁡h.\begin{split}\cos(x+h)&{}=\cos x\cos h-\sin x\sin h,\\ \sin(x+h)&{}=\cos x\sin h+\sin x\cos h.\end{split}
Proof.

Consider the complex exponential ei⁢(x+h)\mathrm{e}^{i(x+h)}. By Euler’s formula, the left-hand side is simply:

equation (3.14) (3.14)
ei⁢(x+h)=cos⁡(x+h)+i⁢sin⁡(x+h).\mathrm{e}^{i(x+h)}=\cos(x+h)+i\sin(x+h).

On the right-hand side, we utilize the standard algebraic laws of exponents to factor the expression, applying Euler’s formula to each piece:

equation (3.15) (3.15)
ei⁢(x+h)=ei⁢x⁢ei⁢h=(cos⁡x+i⁢sin⁡x)⁢(cos⁡h+i⁢sin⁡h)=(cos⁡x⁢cos⁡h−sin⁡x⁢sin⁡h)+i⁢(cos⁡x⁢sin⁡h+sin⁡x⁢cos⁡h).\begin{split}\mathrm{e}^{i(x+h)}&{}=\mathrm{e}^{ix}\mathrm{e}^{ih}\\ &{}=(\cos x+i\sin x)(\cos h+i\sin h)\\ &{}=(\cos x\cos h-\sin x\sin h)+i(\cos x\sin h+\sin x\cos h).\end{split}

Equating the real parts and the imaginary parts of (3.14) and (3.15) yields the desired identities. ∎

Armed with Lemma 3.6.1, we can conquer the derivative of sine.

Theorem 3.6.2 (Derivatives of Sine and Cosine).

The functions sin⁡x\sin x and cos⁡x\cos x are differentiable for all x∈ℝx\in\mathbb{R}, and their derivatives are given by:

(sin⁡x)′=cos⁡x,(cos⁡x)′=−sin⁡x.(\sin x)^{\prime}=\cos x,\qquad(\cos x)^{\prime}=-\sin x.
Proof.

Applying our addition formula to the limit definition of the derivative, we obtain:

limh→0sin⁡(x+h)−sin⁡xh=limh→0(cos⁡x⁢sin⁡h+sin⁡x⁢cos⁡h)−sin⁡xh=limh→0(cos⁡x⁢sin⁡hh+sin⁡x⁢cos⁡h−1h).\begin{split}\lim_{h\to 0}\frac{\sin(x+h)-\sin x}{h}&{}=\lim_{h\to 0}\frac{(% \cos x\sin h+\sin x\cos h)-\sin x}{h}\\ &{}=\lim_{h\to 0}\left(\cos x\frac{\sin h}{h}+\sin x\frac{\cos h-1}{h}\right).% \end{split}

Notice that the variable governing the limit is hh. Thus, we may treat cos⁡x\cos x and sin⁡x\sin x as constants and pull them out:

equation (3.16) (3.16)
limh→0sin⁡(x+h)−sin⁡xh=cos⁡x⁢(limh→0sin⁡hh)+sin⁡x⁢(limh→0cos⁡h−1h).\lim_{h\to 0}\frac{\sin(x+h)-\sin x}{h}=\cos x\left(\lim_{h\to 0}\frac{\sin h}% {h}\right)+\sin x\left(\lim_{h\to 0}\frac{\cos h-1}{h}\right).

Here we use the fundamental limit limh→0sin⁡hh=1\lim_{h\to 0}\frac{\sin h}{h}=1. But what of the second term?

Intuition (Screaming Pythagoras).

The presence of cos⁡h\cos h and the constant 11 is screaming for the Pythagorean identity, cos2⁡h+sin2⁡h=1\cos^{2}h+\sin^{2}h=1. By multiplying the numerator and denominator by the conjugate (cos⁡h+1)(\cos h+1), we can force a difference of squares.

Let us evaluate the second limit utilizing this Pythagorean trick:

cos⁡h−1h=(cos⁡h−1)⁢(cos⁡h+1)h⁢(cos⁡h+1)=cos2⁡h−1h⁢(cos⁡h+1)=−sin2⁡hh⁢(cos⁡h+1).\begin{split}\frac{\cos h-1}{h}&{}=\frac{(\cos h-1)(\cos h+1)}{h(\cos h+1)}\\ &{}=\frac{\cos^{2}h-1}{h(\cos h+1)}=\frac{-\sin^{2}h}{h(\cos h+1)}.\end{split}

Taking the limit as h→0h\to 0, the expression splits:

limh→0cos⁡h−1h=−(limh→0sin⁡hh)⁢(limh→0sin⁡hcos⁡h+1)=−1⋅02=0.\lim_{h\to 0}\frac{\cos h-1}{h}=-\left(\lim_{h\to 0}\frac{\sin h}{h}\right)% \left(\lim_{h\to 0}\frac{\sin h}{\cos h+1}\right)=-1\cdot\frac{0}{2}=0.

Substituting these evaluated limits back into (3.16), we conclude:

(sin⁡x)′=cos⁡x⋅(1)+sin⁡x⋅(0)=cos⁡x.(\sin x)^{\prime}=\cos x\cdot(1)+\sin x\cdot(0)=\cos x.

An analogous calculation confirms that (cos⁡x)′=−sin⁡x(\cos x)^{\prime}=-\sin x. ∎

Example 3.6.3 (Derivative of Tangent).

The derivatives of the remaining trigonometric functions fall out instantly from the Quotient Rule. For instance, to find the derivative of tan⁡x\tan x:

(tan⁡x)′=(sin⁡xcos⁡x)′=(sin⁡x)′⁢cos⁡x−sin⁡x⁢(cos⁡x)′cos2⁡x=(cos⁡x)⁢(cos⁡x)−(sin⁡x)⁢(−sin⁡x)cos2⁡x=cos2⁡x+sin2⁡xcos2⁡x=1cos2⁡x=sec2⁡x.\begin{split}(\tan x)^{\prime}&{}=\left(\frac{\sin x}{\cos x}\right)^{\prime}% \\ &{}=\frac{(\sin x)^{\prime}\cos x-\sin x(\cos x)^{\prime}}{\cos^{2}x}\\ &{}=\frac{(\cos x)(\cos x)-(\sin x)(-\sin x)}{\cos^{2}x}\\ &{}=\frac{\cos^{2}x+\sin^{2}x}{\cos^{2}x}=\frac{1}{\cos^{2}x}=\sec^{2}x.\end{split}
Exercise 3.6.4.

Prove the remaining differentiation rules:

(cot⁡x)′=−csc2⁡x,(sec⁡x)′=sec⁡x⁢tan⁡x,(csc⁡x)′=−csc⁡x⁢cot⁡x.(\cot x)^{\prime}=-\csc^{2}x,\qquad(\sec x)^{\prime}=\sec x\tan x,\qquad(\csc x% )^{\prime}=-\csc x\cot x.
Remark 3.6.5.

Since there are myriad trigonometric identities linking these functions, any derivative computation might yield multiple correct, albeit different-looking, answers. As a general rule, you should simplify as much as possible. However, do not panic if the expression you write down looks algebraically distinct from your friend’s answer; both might be entirely correct! For example, in the previous computation, we could just as easily have written the final answer as sin2⁡x+cos2⁡xcos2⁡x\frac{\sin^{2}x+\cos^{2}x}{\cos^{2}x} without moving to sec2⁡x\sec^{2}x.

3.6.2 The Geometric Path: Newton’s Vision

The proof of Theorem 3.6.2 gets the job done and carries a pleasant algebraic flavor—we massaged the limit via trigonometric identities into something recognizable. But it can feel a bit like symbol pushing.

Is there a geometric proof of the differentiation rules from first principles? Indeed there is. It uses nothing more than the geometric definitions of sine and cosine, and a bit of high school geometry. 2 bonus points: it explains why we must use radians instead of degrees, and is more faithful to the geometric vision of Isaac Newton.

Moral (The True Meaning of Radians).

Why do calculus textbooks furiously insist on measuring angles in radians? Because on a unit circle, an angle of xx radians subtends an arc of exactly length xx. This direct equivalence between angle and geometric length is what allows us to relate trigonometric limits directly to the physical geometry of the circle. Degrees are an arbitrary human construct; Nature uses radians for her geometry.

Let us visualize the unit circle in Figure 3.6. Let A0=(1,0)A_{0}=(1,0). An angle of xx radians means the arc length from A0A_{0} along the circle is exactly xx units. Let A1=(cos⁡x,sin⁡x)A_{1}=(\cos x,\sin x); thus, area⁡(A0⁢A1)=x\operatorname{area}(A_{0}A_{1})=x. Similarly, let A2=(cos⁡(x+h),sin⁡(x+h))A_{2}=(\cos(x+h),\sin(x+h)), meaning the total arc length to A2A_{2} is x+hx+h. The length of the arc between A1A_{1} and A2A_{2} is therefore exactly hh.

A geometric diagram on the Cartesian coordinate system illustrating the proof of the derivative of the cosine function. The diagram features a quarter unit circle in the first quadrant. Two points on the circle, A1 at angle 25 degrees and A2 at angle 55 degrees, form an arc with point C as its midpoint at 40 degrees. A right-angled triangle A2-B-A1 is drawn in blue, where B is the intersection of the horizontal line through A1 and the vertical line through A2. A red right-angled triangle O-D-C is also shown, where D is the projection of C onto the x-axis. The ray OC is the perpendicular bisector of the chord A1-A2, and point B is clearly positioned below the ray OC.
Figure 3.6: The geometric proof of trigonometric derivatives. Notice that Δ⁢B⁢A1⁢A2∼Δ⁢D⁢C⁢O\Delta BA_{1}A_{2}\sim\Delta DCO.

Let CC be the midpoint of the arc A1⁢A2A_{1}A_{2}. Because Δ⁢O⁢A1⁢A2\Delta OA_{1}A_{2} is an isosceles triangle (bounded by radii of length 1), the ray O⁢COC acts as the perpendicular bisector of the chord A1⁢A2A_{1}A_{2}. The coordinates of CC are naturally C=(cos⁡(x+h2),sin⁡(x+h2))C=\left(\cos\left(x+\frac{h}{2}\right),\sin\left(x+\frac{h}{2}\right)\right).

Let DD be the geometric projection of CC onto the xx-axis, so D=(cos⁡(x+h2),0)D=\left(\cos\left(x+\frac{h}{2}\right),0\right). Finally, let BB be the intersection of the horizontal line passing through A1A_{1} and the vertical line passing through A2A_{2}. Then B=(cos⁡(x+h),sin⁡x)B=(\cos(x+h),\sin x).

We now have two right-angled triangles of interest: Δ⁢B⁢A1⁢A2\Delta BA_{1}A_{2} and Δ⁢D⁢C⁢O\Delta DCO. Let us trace the angles to see that they are, in fact, similar! In Δ⁢D⁢C⁢O\Delta DCO, the leg O⁢DOD is horizontal and C⁢DCD is vertical. The angle ∠⁢D⁢O⁢C\angle DOC is exactly x+h2x+\frac{h}{2}. In Δ⁢B⁢A1⁢A2\Delta BA_{1}A_{2}, the leg A1⁢BA_{1}B is horizontal and A2⁢BA_{2}B is vertical. A quick chase of complementary angles—noting that the chord A1⁢A2A_{1}A_{2} is perpendicular to O⁢COC—reveals that the entire triangle Δ⁢B⁢A1⁢A2\Delta BA_{1}A_{2} is simply Δ⁢D⁢C⁢O\Delta DCO rotated by 90 degrees and scaled. Consequently, the angle ∠⁢B⁢A2⁢A1\angle BA_{2}A_{1} precisely matches ∠⁢D⁢O⁢C=x+h2\angle DOC=x+\frac{h}{2}.

Using the similarity Δ⁢B⁢A1⁢A2∼Δ⁢D⁢C⁢O\Delta BA_{1}A_{2}\sim\Delta DCO, we may equate the ratios of their corresponding sides. Specifically, the ratio of the horizontal leg to the hypotenuse in both triangles must be identical:

equation (3.17) (3.17)
B⁢A1A1⁢A2=D⁢CC⁢O.\frac{BA_{1}}{A_{1}A_{2}}=\frac{DC}{CO}.

Let us carefully express these lengths in terms of our spatial coordinates:

  • •
    ​

    B⁢A1BA_{1} is the horizontal distance between A1A_{1} and BB, which is cos⁡x−cos⁡(x+h)\cos x-\cos(x+h).

  • •
    ​

    D⁢CDC is the vertical height of CC, which is sin⁡(x+h2)\sin\left(x+\frac{h}{2}\right).

  • •
    ​

    C⁢OCO is the radius of the unit circle, strictly 11.

Substituting these values into (3.17) gives:

cos⁡x−cos⁡(x+h)A1⁢A2=sin⁡(x+h2).\frac{\cos x-\cos(x+h)}{A_{1}A_{2}}=\sin\left(x+\frac{h}{2}\right).

Here comes the coup de grâce. We take the limit as h→0h\to 0. For infinitesimally small angles, the length of the straight chord A1⁢A2A_{1}A_{2} is asymptotically equivalent to the length of the arc A1⁢A2A_{1}A_{2}. Because we are working in radians, that arc length is identically hh! Thus, as h→0h\to 0, we have A1⁢A2≈hA_{1}A_{2}\approx h.

Taking the limit yields:

limh→0cos⁡x−cos⁡(x+h)h=limh→0sin⁡(x+h2)−(cos⁡x)′=sin⁡x(cos⁡x)′=−sin⁡x.\begin{split}\lim_{h\to 0}\frac{\cos x-\cos(x+h)}{h}&{}=\lim_{h\to 0}\sin\left% (x+\frac{h}{2}\right)\\ -(\cos x)^{\prime}&{}=\sin x\\ (\cos x)^{\prime}&{}=-\sin x.\end{split}

This is a brilliantly geometric proof, relying on nothing more than the similarity of triangles and the true definition of radian angle measure.

Exercise 3.6.6.

Find a different pair of corresponding sides in the similar triangles Δ⁢B⁢A1⁢A2\Delta BA_{1}A_{2} and Δ⁢D⁢C⁢O\Delta DCO to geometrically prove that (sin⁡x)′=cos⁡x(\sin x)^{\prime}=\cos x.

Exercise 3.6.7.

Find the derivative of the following functions:

f⁢(x)=x2⁢sin⁡x2+cos⁡x,g⁢(x)=2+tan⁡x2−tan⁡x.\begin{split}f(x)&{}=\frac{x^{2}\sin x}{2+\cos x},\\ g(x)&{}=\frac{2+\tan x}{2-\tan x}.\end{split}