Calculus/More Differentiation Rules

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search
← Differentiation Calculus Higher Order Derivatives →
More Differentiation Rules

Contents

[edit] Chain Rule

We know how to differentiate regular polynomial functions. For example:

\frac{d}{dx}(3x^3 - 6x^2 + x) = 9x^2 - 12x + 1


f(x)=(x^2+5)^2 \, \!
f(x)=x^4 + 10x^2 + 25 \, \!
f '(x) = 4x^3 + 20x \, \!

However, there is a useful rule known as the chain method rule. The function above (f(x) = (x2 + 5)2) can be consolidated into two nested parts f(x) = u2, where u = m(x) = (x2 + 5). Therefore:

if
g(u) = u^2 \, \! and
u = m(x)=x^2+5 \, \!

Then:

f(x) = g(m(x)) \, \!

Then

f '(x) = g '(m (x))m'(x) \, \!

The chain rule states that if we have a function of the form y(u(x)) (i.e. y can be written as a function of u and u can be written as a function of x) then:

\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}


Chain Rule

If a function F(x) is composed to two differentiable functions g(x) and m(x), so that F(x)=g(m(x)), then F(x) is differentiable and,

F '(x)= g'(m(x))m'(x) \, \!

We can now investigate the original function:

\frac{dy}{du} = 2u
\frac{du}{dx} = 2x

Therefore

\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} = 2u\cdot 2x = 2(x^2+5)(2x) = 4x^3 + 20x

This can be performed for more complicated equations. If we consider:

\frac{d}{dx} \sqrt{1 + x^2}

and let y = \sqrt{u} and u=1+x2, so that \frac{dy}{du} = \frac{1}{2 \sqrt{u}} and \frac{du}{dx} = 2x, then, by applying the chain rule, we find that

\frac d {dx} \sqrt{1 + x^2} = \frac {1} {2 \sqrt {1 + x^2}}\cdot 2x = \frac {x} \sqrt {1 + x^2}

So, in just plain words, for the chain rule you take the normal derivative of the whole thing (make the exponent the coefficient, then multiply by original function but decrease the exponent by 1) then multiply by the derivative of the inside.

[edit] Product and Quotient Rules

When we wish to differentiate a more complicated expression such as:

h(x) = (x^2+5)^5 \cdot (x^3 + 2)^3

our only way (up to this point) to differentiate the expression is to expand it and get a polynomial, and then differentiate that polynomial. This method becomes very complicated and is particularly error prone when doing calculations by hand. It is advantageous to find the derivative of h(x) using just the functions f(x) = (x2+5)5 and g(x) = (x3 + 2)3 and their derivatives.


Derivatives of products (Product rule)

\frac{d}{dx}\left[ f(x) \cdot g(x) \right] = f'(x) \cdot g(x)+f(x) \cdot g'(x)\,\!


What this rule basically means is that if one has a function that is the product of two functions, then all one has to do is differentiate the first function, multiply it by the other undifferentiated function, add that to the first function undifferentiated multiplied by the differentiated second function. For example, if one were to take the function

 H(x) = (x+2)^3 \cdot 2(x+1)^2

its derivative would not be

{\color{red}3(x+2)^2 \cdot 4(x+1)}

Instead it would be

 3(x+2)^2 \cdot 2(x+1)^2 + (x+2)^3 \cdot 4(x+1)

Another way of approaching this is if one were to have a function that was a product of the two functions A and B

 h(x) = A \cdot B

Its derivative would be

h'(x) = A' \cdot B + A \cdot B'

[edit] Proof

Proving this rule is relatively straightforward, first let us state the equation for the derivative:

\frac{d}{dx} \left[ f(x) \cdot g(x) \right] = \lim_{h \to 0} \frac{ f(x+h)\cdot g(x+h) - f(x) \cdot g(x)}{h}

We will then apply one of the oldest tricks in the book—adding a term that cancels itself out to the middle:


\frac{d}{dx} \left[ f(x) \cdot g(x) \right] = \lim_{h \to 0} \frac{ f(x+h)\cdot g(x+h) \mathbf{- f(x) \cdot g(x+h) + f(x) \cdot g(x+h)} - f(x) \cdot g(x)}{h}

Notice that those terms sum to zero, and so all we have done is add 0 to the equation.

Now we can split the equation up into forms that we already know how to solve:

\frac{d}{dx} \left[ f(x) \cdot g(x) \right] = \lim_{h \to 0} \left[ \frac{ f(x+h)\cdot g(x+h) - f(x) \cdot g(x+h) }{h} + \frac{f(x) \cdot g(x+h) - f(x) \cdot g(x)}{h} \right]

Looking at this, we see that we can separate the common terms out of the numerators to get:

\frac{d}{dx} \left[ f(x) \cdot g(x) \right] = \lim_{h \to 0} \left[ g(x+h) \frac{ f(x+h) - f(x) }{h} + f(x) \frac{g(x+h) - g(x)}{h} \right]

Which, when we take the limit, becomes:

\frac{d}{dx} \left[ f(x) \cdot g(x) \right] = f(x) \cdot g'(x) + g(x) \cdot f'(x) , or the mnemonic "one D-two plus two D-one"


This can be extended to 3 functions:

\frac{d}{dx}[fgh] = f(x) g(x) h'(x) + f(x) g'(x) h(x) + f'(x) g(x) h(x) \,

For any number of functions, the derivative of their product is the sum, for each function, of its derivative times each other function.


[edit] Application, proof of the power rule

The product rule can be used to give a proof of the power rule for whole numbers. The proof proceeds by mathematical induction. We begin with the base case n = 1. If f1(x) = x then from the definition is easy to see that

 
f_1'(x) = \lim _{ h \rightarrow 0} \frac {x+h - x} h = 1

Next we suppose that for fixed value of N, we know that for fN(x) = xN, fN'(x) = NxN − 1. Consider the derivative of fN + 1(x) = xN + 1,

 f_{N+1}'(x) = ( x \cdot x^N) ' = (x)' x^N + x\cdot(x^N)'= x^N + x\cdot N\cdot x^{N-1} = (N+1)x^N.

We have shown that the statement f_n'(x)=n\cdot x^{n-1} is true for n = 1 and that if this statement holds for n = N, then it also holds for n = N + 1. Thus by the principle of mathematical induction, the statement must hold for n=1, 2, \dots.

[edit] Quotient rule

For quotients, where one function is divided by another function, the equation is more complicated but it is simply a special case of the product rule.

\frac{f(x)}{g(x)} = f(x) \cdot g(x)^{-1}

Then we can just use the product rule and the chain rule:

\frac{d}{dx} \frac{f(x)}{g(x)} =  f'(x) \cdot g(x)^{-1} - f(x) \cdot g'(x) \cdot g(x)^{-2}

We can then multiply through by 1, or more precisely: g(x)2 / g(x)2, which cancels out into 1, to get:

\frac{d}{dx} \frac{f(x)}{g(x)} =  \frac{f'(x) \cdot g(x)}{g(x)^2} - \frac{ f(x) \cdot g'(x) }{g(x)^{2}}

This leads us to the so-called "quotient rule":


Derivatives of quotients (Quotient Rule)

 \frac{d}{dx} \left[{f(x)\over g(x)}\right] = \frac{f'(x) \cdot g(x) - f(x) \cdot g'(x)}{g(x)^2}\,\!

Which some people remember with the mnemonic "low D-high minus high D-low (over) square the low and away we go!"

[edit] Examples

The derivative of (4x − 2) / (x2 + 1) is:

\begin{align}
\frac{d}{dx}\left[\frac{(4x - 2)}{x^2 + 1}\right] &= \frac{(x^2 + 1)(4) - (4x - 2)(2x)}{(x^2 + 1)^2} \\
                                                  &= \frac{(4x^2 + 4) - (8x^2 - 4x)}{(x^2 + 1)^2} \\
                                                  &= \frac{-4x^2 + 4x + 4}{(x^2 + 1)^2}
\end{align}

Remember: the derivative of a product/quotient is not the product/quotient of the derivatives. (That is, differentiation does not distribute over multiplication or division.) However one can distribute before taking the derivative. That is \frac{d}{dx}\left((a+b)\times(c+d)\right) = \frac{d}{dx}\left(ac+ad+bc+bd\right)

[edit] Implicit Differentiation

Generally, one will encounter functions expressed in explicit form, that is, y = f(x) form. You might encounter a function that contains a mixture of different variables. Many times it is inconvenient or even impossible to solve for y. A good example is the function y^2 + 2yx + 3 = 5x \,. It is too cumbersome to isolate y in this function. One can utilize implicit differentiation to find the derivative. To do so, consider y to be a nested function that is defined implicitly by x. You need to employ the chain rule whenever you take the derivative of a variable with respect to a different variable: i.e., \frac{d}{dx} (the derivative with respect to x) of x is 1; \frac{d}{dx} of y is \frac{dy}{dx}.

Remember:

\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}

Therefore:

 \frac{d}{dx} (y^3) = \frac{d}{dy} (y^3) \frac{dy}{dx}=3y^2 \cdot \frac{dy}{dx} \

[edit] Examples

Example 1
xy \,=1

can be solved as:

y=\frac{1}{x}

then differentiated:

\frac{dy}{dx}=-\frac{1}{x^2}

However, using implicit differentiation it can also be differentiated like this:

\frac{d}{dx}[xy]=\frac{d}{dx}[1]

use the product rule:

x\frac{dy}{dx}+y=0

solve for \frac{dy}{dx}:

\frac{dy}{dx}=-\frac{y}{x}

Note that, if we substitute y=\frac{1}{x} into \frac{dy}{dx}=-\frac{y}{x}, we end up with \frac{dy}{dx}=-\frac{1}{x^2} again.

Example 2

Find the derivative of y2 + x2 = 25 with respect to x.

You are seeking  dy \over dx.

Take the derivative of each side of the equation with respect to x.

 \frac{d (y^2 + x^2)}{dx} = \frac{d(25)}{dx}
 2y \cdot \frac{dy}{dx} + 2x  = 0
 2y \cdot \frac{dy}{dx} = -2x
 \frac{dy}{dx} = -\frac{x}{y}

[edit] Exponential, logarithmic, and trigonometric functions

[edit] Exponential

To determine the derivative of an exponent requires use of the symmetric difference equation for determining the derivative:

\frac{d}{dx} f(x) = \lim_{h \to 0} \frac{f(x+h) - f(x - h)}{2h}

First we will solve this for the specific case of an exponent with a base of e and then extend it to the general case with a base of a where a is a positive real number.

First we set up our problem using f(x) = ex:

\frac{d}{dx} e^x = \lim_{h \to 0} \frac{e^{x+h} - e^{x-h}}{2h}

Then we apply some basic algebra with powers (specifically that ab + c = ab ac):

\frac{d}{dx} e^x = \lim_{h \to 0} \frac{e^{x} e^{h} - e^{x} e^{-h} }{2h}

Treating ex as a constant with respect to what we are taking the limit of, we can use the limit rules to move it to the outside, leaving us with:

\frac{d}{dx} e^x = e^x \cdot \lim_{h \to 0} \frac{e^{h} - e^{-h} }{2h}

A careful examination of the limit reveals a hyperbolic sine:

\frac{d}{dx} e^x = e^x \cdot \lim_{h \to 0} \frac{\sinh(h)}{h}

The limit of \sinh(h) \over h as h approaches 0 is equal to 1 (using L'Hopital's rule), leaving us with:

Derivative of the exponential function

\frac{d}{dx}e^x = e^x\,\!

in which f'(x) = f(x).

Now that we have derived a specific case, let us extend things to the general case. Assuming that a is a positive real constant, we wish to calculate:

\frac{d}{dx}a^x

One of the oldest tricks in mathematics is to break a problem down into a form that we already know we can handle. Since we have already determined the derivative of ex, we will attempt to rewrite ax in that form.

Using that eln(c) = c and that ln(ab) = b · ln(a), we find that:

a^x = e^{x \cdot \ln(a)}

Thus, we simply apply the chain rule:

\frac{d}{dx}e^{x \cdot \ln(a)} = \left[ \frac{d}{dx} x\cdot \ln(a) \right] e^{x \cdot \ln(a)}

In which we can solve for the derivative and substitute back with ex · ln(a) = ax to get:


Derivative of the exponential function

\frac{d}{dx}a^x = \ln\left(a\right)a^x\,\!

[edit] Logarithms

Closely related to the exponentiation is the logarithm. Just as with exponents, we will derive the equation for a specific case first (the natural log, where the base is e), and then work to generalize it for any logarithm.

First let us create a variable y such that:

y = \ln\left(x\right)

It should be noted that what we want to find is the derivative of y or \frac{dy}{dx} .

Next we will put both sides to the power of e in an attempt to remove the logarithm from the right hand side:

ey = x

Now, applying the chain rule and the property of exponents we derived earlier, we take the derivative of both sides:

 \frac{dy}{dx} \cdot e^y = 1

This leaves us with the derivative:

 \frac{dy}{dx}  = \frac{1}{e^y}

Substituting back our original equation of x = ey, we find that:


Derivative of the Natural Logarithm

\frac{d}{dx}\ln\left(x\right) = \frac{1}{x}\,\!

If we wanted, we could go through that same process again for a generalized base, but it is easier just to use properties of logs and realize that:

\log_b(x) = \frac{\ln(x)}{\ln(b)}

Since 1 / ln(b) is a constant, we can just take it outside of the derivative:

\frac{d}{dx}\log_b(x) = \frac{1}{\ln(b)} \cdot \frac{d}{dx} \ln(x)

Which leaves us with the generalized form of:


Derivative of the Logarithm

\frac{d}{dx}\log_b\left(x\right) = \frac{1}{x\ln\left(b\right)}\,\!

[edit] Trigonometric Functions

Sine, Cosine, Tangent, Cosecant, Secant, Cotangent. These are functions that crop up continuously in mathematics and engineering and have a lot of practical applications. They also appear in more advanced mathematics, particularly when dealing with things such as line integrals with complex numbers and alternate representations of space like spherical and cylindrical coordinate systems.

We use the definition of the derivative, i.e.,

f'(x) = \lim_{h \to 0}\frac{f(x+h)-f(x)}{h},

to work these first two out.

Let us find the derivative of sin x, using the above definition.

 f(x) = \sin{x} \, \!


 f'(x) = \lim_{h \to 0}{\sin(x+h)-\sin{x} \over h} Definition of derivative


 = \lim_{h \to 0}{\cos(x)\sin(h)+\cos(h)\sin(x) - sin(x) \over h} trigonometric identity


 = \lim_{h \to 0}{\cos(x)\sin(h)+(\cos(h) - 1)\sin(x) \over h} factoring


 = \lim_{h \to 0}{\cos(x)\sin(h) \over h}  +\lim_{h \to 0}{(\cos(h) - 1)\sin(x) \over h} separation of terms


 = \cos{x} \, \! \times 1 + \sin{x} \, \! \times 0 application of limit


 = \cos{x} \, \! solution

Now for the case of cos x

 f(x) = \cos{x} \, \!


 f'(x) = \lim_{h \to 0}{\cos(x+h)-\cos{x} \over h} Definition of derivative


 = \lim_{h \to 0}{\cos(x)\cos(h)-\sin(h)\sin(x) - cos(x) \over h} trigonometric identity


 = \lim_{h \to 0}{\cos(x)(\cos(h) - 1)-\sin(x)\sin(h) \over h} factoring


 =\lim_{h \to 0}{\cos(x)(\cos(h) - 1) \over h}  - \lim_{h \to 0}{\sin(x)\sin(h) \over h} separation of terms


 = \cos{x} \, \! \times 0 - \sin{x} \, \! \times 1 application of limit


 = -\sin{x} \, \! solution

Therefore we have established

Derivative of Sine and Cosine

\frac{d}{dx} \sin(x) = \cos(x)\,\!
\frac{d}{dx} \cos(x) = -\sin(x)\,\!


To find the derivative of the tangent, we just remember that:

\tan(x) = \frac{\sin(x)}{\cos(x)}

which is a quotient. Applying the quotient rule, we get:

\frac{d}{dx} \tan(x) = \frac{\cos^2(x) + \sin^2(x)}{\cos^2(x)}

Then, remembering that cos2(x) + sin2(x) = 1, we simplify:

\frac{\cos^2(x) + \sin^2(x)}{\cos^2(x)} =\frac{1}{\cos^2(x)}
=\sec^2(x)\,


Derivative of the Tangent

\frac{d}{dx}  \tan(x) = \sec^2(x)\,\!

For secants, we just need to apply the chain rule to the derivations we have already determined.

\sec(x) = \frac{1}{\cos(x)}

So for the secant, we state the equation as:

\sec(x) = \frac{1}{u}
u(x) = cos(x)

Take the derivative of both equations, we find:

\frac{d}{dx} \sec(x) = \frac{-1}{u^2} \cdot \frac{du}{dx}
\frac{du}{dx} = -\sin(x)

Leaving us with:

\frac{d}{dx} \sec(x) = \frac{\sin(x)}{\cos^2(x)}

Simplifying, we get:


Derivative of the Secant

\frac{d}{dx} \sec(x) = \sec(x) \tan(x)\,\!

Using the same procedure on cosecants:

\csc(x) = \frac{1}{\sin(x)}

We get:


Derivative of the Cosecant

\frac{d}{dx} \csc(x) = -\csc(x) \cot(x)\,\!

Using the same procedure for the cotangent that we used for the tangent, we get:


Derivative of the Cotangent

\frac{d}{dx} \cot(x) = -\csc^2(x) \,\!

[edit] Inverse Trigonometric Functions

Arcsine, arccosine, arctangent. These are the functions that allow you to determine the angle given the sine, cosine, or tangent of that angle.

First, let us start with the arcsine such that:

y = arcsin(x)

To find dy/dx we first need to break this down into a form we can work with:

x = sin(y)

Then we can take the derivative of that:

1 = \cos(y) \cdot \frac{dy}{dx}

...and solve for dy / dx:

\frac{dy}{dx} = \frac{1}{\cos(y)}

At this point we need to go back to the unit triangle. Since y is the angle and the opposite side is sin(y) (which is equal to x), the adjacent side is cos(y) (which is equal to the square root of 1 minus x2, based on the Pythagorean theorem), and the hypotenuse is 1. Since we have determined the value of cos(y) based on the unit triangle, we can substitute it back in to the above equation and get:


Derivative of the Arcsine

\frac{d}{dx} \arcsin(x) = \frac{1}{\sqrt{1-x^2}}\,\!

We can use an identical procedure for the arccosine and arctangent:


Derivative of the Arccosine

\frac{d}{dx} \arccos(x) = \frac{-1}{\sqrt{1-x^2}}\,\!

Derivative of the Arctangent

\frac{d}{dx} \arctan(x) = \frac{1}{1+x^2}\,\!

[edit] Logarithmic differentiation

We can use the properties of the logarithm, particularly the natural log, to differentiate more difficult functions, such a products with many terms, quotients of composed functions, or functions with variable or function exponents. We do this by taking the natural logarithm of both sides, re-arranging terms using the logarithm laws below, and then differentiating both sides implicitly, before multiplying through by y.

\log\left(\frac{a}{b}\right) = \log(a) - \log(b)

\log(a^n) = n\log(a)\,\!

\log(a) + \log(b) = \log(ab)\,\!

See the examples below.

Example 1

Suppose we wished to differentiate

y = \frac{(6x^2+9)^2}{\sqrt{3x^3-2}}

We take the natural logarithm of both sides


\begin{align}
 \ln(y) & = \ln\Bigg(\frac{(6x^2+9)^2}{\sqrt{3x^3-2}}\Bigg) \\
            & = \ln(6x^2+9)^2 - \ln(3x^3-2)^{\frac{1}{2}} \\
            & = 2\ln(6x^2+9) - \frac{1}{2}\ln(3x^3-2) \\
\end{align}

Differentiating implicitly


\begin{align}
 \frac{1}{y} \frac{dy}{dx} & = 2 \times \frac{12x}{6x^2+9} - \frac{1}{2} \times \frac{9x^2}{3x^3-2} \\
                                           & = \frac{24x}{6x^2+9} - \frac{\frac{9}{2}x^2}{3x^3-2} \\
                                           & = \frac{24x(3x^3-2) - \frac{9}{2}x^2(6x^2+9)}{(6x^2+9)(3x^3-2)} \\
\end{align}

Multiplying by y

\frac{dy}{dx} = \frac{(6x^2+9)^2}{\sqrt{3x^3-2}} \times \frac{24x(3x^3-2) - \frac{9}{2}x^2(6x^2+9)}{(6x^2+9)(3x^3-2)}
Example 2

Let us differentiate a function

y=x^x\,\!

Taking the natural logarithm of left and right


\begin{align}
 \ln y & = \ln(x^x) \\
          & = x\ln(x) \\
\end{align}

We then differentiate both sides, recalling the product rule


\begin{align}
 \frac{1}{y} \frac{dy}{dx} & = \ln(x) + x\frac{1}{x} \\
                                           & = \ln(x) + 1 \\
\end{align}

Multiplying by the original function y

\frac{dy}{dx} = x^x(\ln(x) + 1)
Example 3

Take a function

y=x^{6\cos(x)}\,\!

Then


\begin{align}
 \ln y & = \ln(x^{6\cos(x)})\,\! \\
          & = 6\cos(x)\ln(x)\,\! \\
\end{align}

We then differentiate

\frac{1}{y} \frac{dy}{dx} = -6\sin(x)\ln(x)+\frac{6\cos(x)}{x}

And finally multiply by y

\frac{dy}{dx} = x^{6\cos(x)}\Bigg(-6\sin(x)\ln(x)+\frac{6\cos(x)}{x}\Bigg)

[edit] Exercises

Given the above rules, practice differentiation on the following.

  1. \frac{d}{dx}[(x^3 + 5)^{10}] \, \!
  2. \frac{d}{dx}[x^3 + 3x] \, \!
  3. \frac{d}{dx}[(x+4)\cdot (x+2)\cdot (x-3)]
  4. \frac{d}{dx}[\frac{x+1}{3x^2}]
  5. \frac{d}{dx}[3\cdot x^3]
  6. \frac{d}{dx}[\sin x \cdot x^4]
  7. \frac{d}{dx}[2^x]
  8. \frac{d}{dx}[e^{x^2}]
  9. \frac{d}{dx}[ e^{2^x} ]
  10. \frac{d}{dx}[ (6x)^{\cos(x) + 1} ]

[edit] Answers

[edit] External links