3.3 Derivatives of Trigonometric Functions

Derivative of \(\sin(x)\) and \(\cos(x)\)

In this section, we differentiate \(\sin(x)\) and \(\cos(x)\).

Theorem (Derivative of sine and cosine): The derivative of \(\sin(x)\) is \(\cos(x)\) and the derivative of \(\cos(x)\) is \(-\sin(x)\). That is, \[\dfrac{d}{dx}\sin(x) = \cos(x) \hspace{0.5in} \text{and} \hspace{0.5in} \dfrac{d}{dx} \cos(x) = -\sin(x).\]

All of the rules that we have studied previously still apply here.

Example: Let \(f(x) = 5x\sin(x)\). Find \(f^{\prime}(x)\).

Solution: The function \(5x\sin(x)\) is a constant multiplied by a product of two functions. So, the product rule applies here. Let \(u = x\) and \(v = \sin(x)\). Then, we know that \(u^{\prime} = 1\) and \(v^{\prime} = \cos(x)\). By the product rule, \[\begin{align*} f^{\prime}(x) &= \dfrac{d}{dx} 5x\sin(x)\\ &= 5\dfrac{d}{dx} uv\\ &= 5(u^{\prime}v + v^{\prime}u)\\ &= 5(1(\sin(x)) + \cos(x)(x))\\ &= 5\sin(x) + 5x\cos(x). \end{align*}\] Therefore, by the product rule, \(f^{\prime}(x) = 5\sin(x) + 5x\cos(x)\).

Example: Let \(y = \dfrac{\cos(x) + x}{3\sin(x)}\). Find \(\dfrac{dy}{dx}\).

Solution: The function \(y\) is a quotient of two functions. So, one must use the quotient rule in this example. Let \(u = \cos(x) + x\) and \(v = 3\sin(x)\). Then, we know that \(u^{\prime} = -\sin(x) + 1\) and \(v^{\prime} = 3\cos(x)\). Using the quotient rule, we find that \[\begin{align*} \dfrac{dy}{dx} &= \dfrac{d}{dx} \dfrac{\cos(x) + x}{3\sin(x)}\\ &= \dfrac{d}{dx} \dfrac{u}{v}\\ &= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\ &= \dfrac{(-\sin(x) + 1)(3\sin(x)) - 3\cos(x)(\cos(x) + 1)}{(3\sin(x))^2}\\ &= \dfrac{-3\sin^2(x) + 3\sin(x) - 3\cos^2(x) - 3\cos(x)}{9\sin^2(x)}\\ &= \dfrac{-3 + 3\sin(x) - 3\cos(x)}{9\sin^2(x)}\\ &= \dfrac{-1 + \sin(x) - \cos(x)}{3\sin^2(x)}. \end{align*}\] Therefore, by the quotient rule, \(\dfrac{dy}{dx} =\dfrac{-1 + \sin(x) - \cos(x)}{3\sin^2(x)}\).

Example: Let \(y = \sin(x)\cos(x)\). Find \(y^{\prime}\).

Solution: We proceed by the product rule. Let \(u = \sin(x)\) and \(v = \cos(x)\). Then, we know that \(u^{\prime} = \cos(x)\) and \(v^{\prime} = -\sin(x)\). Using the product rule, we find that \[\begin{align*} y^{\prime} &= \dfrac{d}{dx} \sin(x)cos(x)\\ &= \dfrac{d}{dx} uv\\ &= u^{\prime}v + v^{\prime}u\\ &= \cos(x)\cos(x) + (-\sin(x))\sin(x)\\ &= \cos^2(x) - \sin^2(x). \end{align*}\] Therefore, by the product rule, \(y^{\prime}=\cos^2(x) - \sin^2(x)\).

Practice Problems

  1. Differentiate.
  • \(y = 3^x\sin(x)\)
  • \(y = \cos(x)e^x\)
  • \(y = x^3\sin(x)\)
  • \(y = (x^5 + 2^x)\cos(x)\)
  • \(y = (x^2 + x + 1)\sin(x)\)
  • \(y = e^x(\sin(x) + \cos(x))\)
  • \(y = \dfrac{\sin(x)}{2^x}\)
  • \(y = \dfrac{x}{\cos(x)}\)
  • \(y = \dfrac{e^x}{\sin(x) + x + 1}\)
  • \(y = \dfrac{\cos(x) + x}{e^x + 2^x}\)
  • \(y = \dfrac{\sin(x)}{x^2 + 1}\)
  • \(y = \dfrac{\sqrt{x}}{\cos(x)}\)
  1. Find the equation of the tangent line at the given point.
  • \(y = \sin(x)\) at \(a = \pi\)
  • \(y = \cos(x)\) at \(a = 0\)
  • \(y = x^3\sin(x)\) at \(a = 0\)
  • \(y = e^x\cos(x)\) at \(a = \pi\)

Other Trigonometric Derivatives

In this section, we introduce the derivatives of the other four basic trigonometric functions.

Example: Let \(y = \tan(x)\). Find \(y^{\prime}\) for all values \(x\) in the domain of \(\tan(x)\).

Solution: The function \(y = \tan(x) = \dfrac{\sin(x)}{cos(x)}\) is a quotient of two functions. We proceed by the quotient rule. Let \(u = \sin(x)\) and \(v = \cos(x)\). Then, we know that \(u^{\prime} = \cos(x)\) and \(v^{\prime} = -\sin(x)\). Using the quotient rule, we find that \[\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{\sin(x)}{\cos(x)}\\ &= \dfrac{d}{dx} \dfrac{u}{v}\\ &= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\ &= \dfrac{\cos(x)\cos(x) - (-\sin(x))\sin(x)}{(\cos(x))^2}\\ &= \dfrac{\cos^2(x)\cos(x) + \sin^2(x)}{\cos^2(x)}\\ &= \dfrac{1}{\cos^2(x)}\\ &= \sec^2(x). \end{align*}\] Therefore, by the quotient rule, \(y^{\prime}=\sec^2(x)\).

Theorem (Derivative of the tangent function): For all \(x\) in the domain of \(\tan(x)\), we have \[\dfrac{d}{dx} \tan(x) = \sec^2(x).\]

Remember that the domain of \(\tan(x)\) is \(\mathbb{R}-\{x|x = \pi/2 + k\pi, k \in \mathbb{Z}\}\). Therefore, the derivative of \(\tan(x)\) is undefined at these points (since \(\tan(x)\) has an infinite discontinuity at these points).

Example: Let \(y = \sec(x)\). Find \(y^{\prime}\) for all values \(x\) in the domain of \(\sec(x)\).

Solution: The function \(y = \sec(x) = \dfrac{1}{\cos(x)}\) is a quotient of two functions. We proceed by the quotient rule. Let \(u = 1\) and \(v = \cos(x)\). Then, we know that \(u^{\prime} = 0\) and \(v^{\prime} = -\sin(x)\). Using the quotient rule, we find that \[\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{1}{\cos(x)}\\ &= \dfrac{d}{dx} \dfrac{u}{v}\\ &= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\ &= \dfrac{0\cos(x) - (-\sin(x))(1)}{(\cos(x))^2}\\ &= \dfrac{\sin(x)}{\cos^2(x)}\\ &= \dfrac{1}{\cos(x)}\dfrac{\sin(x)}{\cos(x)}\\ &= \sec(x)\tan(x). \end{align*}\] Therefore, by the quotient rule, \(y^{\prime}=\sec(x)\tan(x)\).

Theorem (Derivative of the secant function): For all \(x\) in the domain of \(\sec(x)\), we have \[\dfrac{d}{dx} \sec(x) = \sec(x)\tan(x).\]

Since \(\cos(x) = 0\) at \(x = \pi/2 + k\pi\) with \(k \in \mathbb{Z}\), we know that the domain of \(\sec(x)\) is \(\mathbb{R} - \{x | x = \pi/2 + k\pi, k \in \mathbb{Z}\}\).

Example: Let \(y = \csc(x)\). Find \(y^{\prime}\) for all values \(x\) in the domain of \(\csc(x)\).

Solution: The function \(y = \csc(x) = \dfrac{1}{\sin(x)}\) is a quotient of two functions. We proceed by the quotient rule. Let \(u = 1\) and \(v = \sin(x)\). Then, we know that \(u^{\prime} = 0\) and \(v^{\prime} = \cos(x)\). Using the quotient rule, we find that \[\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{1}{\sin(x)}\\ &= \dfrac{d}{dx} \dfrac{u}{v}\\ &= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\ &= \dfrac{0\sin(x) - \cos(x)(1)}{(\sin(x))^2}\\ &= \dfrac{\cos(x)}{\sin^2(x)}\\ &= \dfrac{1}{\sin(x)}\dfrac{\cos(x)}{\sin(x)}\\ &= \csc(x)\cot(x). \end{align*}\] Therefore, by the quotient rule, \(y^{\prime}=\csc(x)\cot(x)\).

Theorem (Derivative of the cosecant function): For all \(x\) in the domain of \(\csc(x)\), we have \[\dfrac{d}{dx} \csc(x) = \csc(x)\cot(x).\]

Since \(\sin(x) = 0\) at integer multiples of \(\pi\), we know that the domain of \(\csc(x)\) is \(\mathbb{R} - \{x | x = k\pi, k \in \mathbb{Z}\}\).

Example: Let \(y = \cot(x)\). Find \(y^{\prime}\) for all values \(x\) in the domain of \(\cot(x)\).

Solution: The function \(y = \cot(x) = \dfrac{\cos(x)}{\sin(x)}\) is a quotient of two functions. We proceed by the quotient rule. Let \(u = \cos(x)\) and \(v = \sin(x)\). Then, we know that \(u^{\prime} = -\sin(x)\) and \(v^{\prime} = \cos(x)\). Using the quotient rule, we find that \[\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{\cos(x)}{\sin(x)}\\ &= \dfrac{d}{dx} \dfrac{u}{v}\\ &= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\ &= \dfrac{-\sin(x)\sin(x) - \cos(x)\cos(x)}{(\sin(x))^2}\\ &= \dfrac{-1}{\sin^2(x)}\\ &= -\csc^2(x). \end{align*}\] Therefore, by the quotient rule, \(y^{\prime}=-\csc^2(x)\).

Theorem (Derivative of the cotangent function): For all \(x\) in the domain of \(\cot(x)\), we have \[\dfrac{d}{dx} \cot(x) = -\csc^2(x).\]

Since \(\sin(x) = 0\) at integer multiples of \(\pi\), we know that the domain of \(\cot(x)\) is \(\mathbb{R} - \{x | x = k\pi, k \in \mathbb{Z}\}\).

Example: Let \(f(x) = \dfrac{\csc(x)e^x}{x^2}\). Find \(f^{\prime}(x)\) for \(x \not = 0\).

Solution: The function \(f(x) = \dfrac{\csc(x)e^x}{x^2}\) is a quotient of two functions with the numerator a product of two functions. We proceed by the quotient rule. Let \(u = \csc(x)e^x\) and \(v = x^2\). Then, we know that \(u^{\prime} = \csc(x)\cot(x)e^x + e^x\csc(x)\) (by the product rule) and \(v^{\prime} = 2x\). Using the quotient rule, we find that \[\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{\csc(x)e^x}{x^2}\\ &= \dfrac{d}{dx} \dfrac{u}{v}\\ &= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\ &= \dfrac{(\csc(x)\cot(x)e^x + e^x\csc(x))x^2 - 2x(\csc(x)e^x)}{(x^2)^2}\\ &= \dfrac{xe^x(x\csc(x)\cot(x) + x\csc(x) - 2\csc(x))}{x^4}\\ &= \dfrac{e^x(x\csc(x)\cot(x) + x\csc(x) - 2\csc(x))}{x^3}. \end{align*}\] Therefore, by the quotient rule, \(f^{\prime}(x)= \dfrac{e^x(x\csc(x)\cot(x) + x\csc(x) - 2\csc(x))}{x^3}\).

Practice Problems

  1. Differentiate.
  • \(y = x^2\sec(x)\)
  • \(y = \cot(x)e^x\)
  • \(y = (x^3 + 9\sin(x))\csc(x)\)
  • \(y = (8x^5 + \sin(x)2^x)\cot(x)\)
  • \(y = (7x^2 + x\sin(x) + 1)\sec(x)\)
  • \(y = e^x(\csc(x) + 6\cot(x))\)
  • \(y = \dfrac{5\sec(x)}{2^x}\)
  • \(y = \dfrac{x}{4\csc(x)}\)
  • \(y = \dfrac{e^x}{\cot(x) + \sin(x)}\)
  • \(y = \dfrac{\cos(x) + 3x}{\csc(x)}\)
  • \(y = \dfrac{\sin(x)}{2\cot(x) + 1}\)
  • \(y = \dfrac{4\sqrt{x}}{\sec(x)}\)
  1. Find the equation of the tangent line at the given point.
  • \(y = \csc(x)\) at \(a = \pi\)
  • \(y = \cot(x)\) at \(a = 3\pi/2\)
  • \(y = x^3\sec(x)\) at \(a = 0\)
  • \(y = e^x\cot(x)\) at \(a = \pi\)

Proofs of Trigonometric Derivatives

The derivatives for \(\tan(x)\), \(\sec(x)\), \(\csc(x)\) and \(\cot(x)\) were predicated on the derivatives of \(\sin(x)\) and \(\cos(x)\) being what we claimed. Consequently, we cannot consider these derivative rules proved until we prove the derivative of the sine and cosine functions. In this section, we do just that.

Theorem (Derivative of the sine and cosine functions): The derivative of \(\sin(x)\) is \(\cos(x)\). That is, \[\dfrac{d}{dx}\sin(x) = \cos(x).\]

Proof: We use the limit definition of the derivative. Let \(f(x) = \sin(x)\). \[\begin{align*} \dfrac{d}{dx} \sin(x) &= \lim_{h \rightarrow 0} \dfrac{f(x+h) - f(x)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\sin(x+h) - \sin(x)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\sin(x)\cos(h) + \cos(x)\sin(h) - \sin(x)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\sin(x)(\cos(h) - 1) + \cos(x)\sin(h)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\sin(x)(\cos(h) - 1)}{h} + \lim_{h \rightarrow 0}\dfrac{\cos(x)\sin(h)}{h}\\ &= \sin(x)\lim_{h \rightarrow 0} \dfrac{\cos(h) - 1}{h} + \cos(x)\lim_{h \rightarrow 0}\dfrac{\sin(h)}{h}\\ &= \sin(x)(0) + \cos(x)(1)\\ &= \cos(x). \end{align*}\] The last two limits were as a result of Theorem \(\ref{Thm:TrigLimits}\).

Theorem (Squeeze Theorem): The derivative of \(\cos(x)\) is \(-\sin(x)\). That is, \[\dfrac{d}{dx} \cos(x) = -\sin(x).\]

Proof: We use the limit definition of the derivative. Let \(f(x) = \cos(x)\). \[\begin{align*} \dfrac{d}{dx} \cos(x) &= \lim_{h \rightarrow 0} \dfrac{f(x+h) - f(x)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\cos(x+h) - \cos(x)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\cos(x)\cos(h) - \sin(x)\sin(h) - \cos(x)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\cos(x)(\cos(h) - 1) - \sin(x)\sin(h)}{h}\\ &= \lim_{h \rightarrow 0} \dfrac{\cos(x)(\cos(h) - 1)}{h} - \lim_{h \rightarrow 0}\dfrac{\sin(x)\sin(h)}{h}\\ &= \cos(x)\lim_{h \rightarrow 0} \dfrac{\cos(h) - 1}{h} - \sin(x)\lim_{h \rightarrow 0}\dfrac{\sin(h)}{h}\\ &= \cos(x)(0) - \sin(x)(1)\\ &=-\sin(x). \end{align*}\] The final two limits are as a result of Theorem \(\ref{Thm:TrigLimits}\).

Practice Problems

  1. Find the derivative of \(\sec^3(x)\).

  2. Find the derivative of \(\dfrac{\sin^2(x)}{\cos^2(x)}\).

  3. Evaluate \(\displaystyle\lim_{h \rightarrow 0} \dfrac{\sin(\pi/3 + h) - \sin(\pi/3)}{h}\).

  4. Find the \(3^{rd}\) derivative of \(x^2\csc(x)\).

Higher Derivatives

The term higher derivative refers to second, third and, in general, \(n^{th}\) derivatives. A function like \[f(x) = 4x^3 + 5x^2 + 8x + 3\] has first derivative \[f^{\prime}(x) = 12x^2 + 10x + 8.\] The second derivative of \(f\) is \[f^{\prime \prime}(x) = 24x + 10\] The third derivative is \[f^{\prime \prime \prime}(x) = 24.\] Of course, the fourth derivative of \(f\) is \[f^{(4)}(x) = 0.\]

Theorem: If \(p(x)\) is a polynomial of degree \(n\) then, \[p^{(k)}(x) = 0,\] for all \(k \geq n+1\).

Proof: Any derivative of a polynomial reduces the degree of the polynomial by one. Therefore, if \(p\) is a polynomial of degree \(n\), the degree of the \(n^{th}\) derivative of \(p\) will be 0 (ie, a constant). The \(n+1^{st}\) derivative and all subsequent derivatives will therefore be 0.

Example: Find the \(n^{th}\) derivative of the function \(f(x) = \sin(x)\).

Solution: We can find the first few derivatives of \(f\) and we can then try to extrapolate a general case.

\[\begin{align*} f(x) &= \sin(x)\\ f^{\prime}(x) &= \cos(x)\\ f^{\prime \prime}(x) &= -\sin(x)\\ f^{\prime \prime \prime}(x) &= -\cos(x)\\ f^{(4)}(x) &= \sin(x)\\ f^{(5)}(x) &= \cos(x)\\ f^{(6)}(x) &= -\sin(x)\\ f^{(7)}(x) &= -\cos(x)\\ f^{(8)}(x) &= \sin(x). \end{align*}\]

We can see that there is a cyclical pattern for the derivatives. Consider the integer \(n\). It can take the form \(n = 4k\), \(n = 4k+1\), \(n = 4k+2\), or \(n = 4k+3\) (where \(k\) is an integer). When \(n\) has the form \(4k\) (as in \(f(x)\), \(f^{(4)}(x)\) and \(f^{(8)}(x)\)), the \(n^{th}\) derivative is \(f^{(n)}(x) = \sin(x)\). When \(n\) has the form \(4k+1\) (as in \(f^{\prime}(x)\) or \(f^{(5)}\)), we have \(f^{(n)}(x) = \cos(x)\). If \(n = 4k+2\), \(f^{(n)}(x) = -\sin(x)\) and when \(n = 4k+3\), we see that \(f^{(n)}(x) = -\cos(x)\). We can write \[f^{(n)}(x) = \begin{cases} \sin(x) & n = 4k\\ \cos(x) & n = 4k+1\\ -\sin(x) & n=4k+2\\ -\cos(x) & n = 4k+3 \end{cases}.\]

Many times a pattern emerges. In the previous example, it was a result of the cyclical pattern of the derivatives of trigonometric functions. The next example deals with constants that result from the chain rule.

Example: Find the \(n^{th}\) derivative of the function \(f(x) = e^{2x}\).

Solution: We can find the first few derivatives of \(f\) and we can then try to extrapolate a general case.

We can see that there is again a pattern for the derivatives. The third derivative is \(2^3e^{2x}\) and the fourth derivative is \(2^4e^{2x}\). It appears that, in general, we have \[f^{(n)}(x) = 2^ne^{2x}.\]

We can find a higher derivative using implicit differentiation.

Example: Find the second derivative of the curve \(x^2 + y^2 = 2xy\).

Solution: We can find the first few derivatives using implicit differentiation: \[\begin{align*} x^2 + y^2 &= 2\\ 2x + 2y \dfrac{dy}{dx} &=0\\ \dfrac{dy}{dx} &= \dfrac{-x}{y}. \end{align*}\] We differentiate again. \[\begin{align*} \dfrac{dy}{dx} &= \dfrac{-x}{y}\\ \dfrac{d^2y}{dx^2} &= \dfrac{-y + x\dfrac{dy}{dx}}{y^2}\\ \dfrac{d^2y}{dx^2} &= \dfrac{-y + x(-x/y)}{y^2}\\ \dfrac{d^2y}{dx^2} &= \dfrac{-y -x^2/y}{y^2}\\ \dfrac{d^2y}{dx^2} &= \dfrac{-(y^2 + x^2)}{y^3}\\ \dfrac{d^2y}{dx^2} &= \dfrac{-2}{y^3}. \end{align*}\] Therefore, the second derivative of the curve \(x^2 + y^2 = 2\) is \(\dfrac{d^2y}{dx^2} = \dfrac{-2}{y^3}\).

Note that in the previous example, we were able to substitute out \(dy/dx\) since we had already found that value. We also substituted out \(x^2 + y^2\) since we knew that it was equal to 2.

Practice Problems

  1. Find the second, third and fourth derivatives of each of the following.
  • \(y = e^{4x}\)
  • \(f(x) = \sin(2x + 1)\)
  • \(y = x^3 + x^2 + x + 1\)
  • \(g(x) = \ln(x)\)
  • \(h(x) = \tan(x)\)
  • \(f(x) = \cos(2x) + e^{3x}\)
  1. Find a general formula for the \(n^{th}\) derivative for each of the following.
  • \(y = \cos(x)\)
  • \(f(x) = \sec(x)\)
  • \(y = e^{3x}\)
  • \(g(x) = \sin(2x + 1)\)
  • \(f(x) = x^2 + x + 1\)
  • \(y = \ln(x)\)
  • \(g(x) = \cos(3x - 2)\)
  • \(y = \cos(2x) + e^{2x}\)
  1. Find the second derivative of each of the following functions.
  • \(x^2 + y^2 = 5\)
  • \(x^2 + 2y = xy\)
  • \(x^2y^3 = 3x\)
  • \(y = x^x\)
  • \(\sin(y) = x\)
  • \(e^y - e^x = 1\)