Derivatives practice

Though often we work with out-of-the-both algorithms, opportunities to make your own will present themselves. Calculus and derivatives will help you do that.

Definition of a derivative

The derivative of f with respect to x is given by

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

when this limit exits.

Basic derivative properties

Assuming c and n to be real constants, then these theorems hold true:

$ \frac{d}{dx}c = 0 $


In [1]:
diff(1)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-6e410ba25e72> in <module>()
----> 1 diff(1)

NameError: name 'diff' is not defined

$ \frac{d}{dx}x = 1 $

$ \frac{d}{dx}(c \cdot f(x)) = c \cdot \frac{d}{dx}f(x) = c \cdot f'(x) $

$ \frac{d}{dx}(f(x) + g(x)) = f'(x) + g'(x) $ (true for minus as well)

$ \frac{d}{dx}x^n = n \cdot x^{n-1} $ the power rule

and if you want proofs.

Use these basic properties to answer the questions below.

$f(x) = 3x^2 + 3$
Find $f'(x)$

$f'(x) = 6x$

$f(y) = \frac{1}{3}y^6 + 4y^4 - 2y + 1$
Find $f'(y)$

$f'(y) = 2y^5 + 16y^3 -2$

$f(x) = \frac{2}{x^5}$
Find $f'(x)$

$f(x) = 2x^{-5}$
$f'(x) = -10x^{-6} = \frac{-10}{x^6}$

More advanced rules

The product rule

If f(x) and g(x) are differentiable functions, then the derivative of the product $fg$ with respect to x is given by

$ (f \cdot g)' = f'g + fg' $

The quotient rule

If f(x) and g(x) are differentiable functions and g(x) is not equal to zero, then the derivative of the quotient $f/g$ with respect to x is given by

$ (\frac{f}{g})' = \frac{gf' - fg'}{g^2} $

The chain rule

If f(x) and g(x) are differentiable functions, then the derivative of the composition of g with f is

$ \frac{d}{dx}(g(f(x)) = g'(f(x)) \cdot f'(x) $

where the notation $g'(f(x))$ means the function $g'(x)$ evaluated at $f(x)$.

Use the basic and more advanced rules to answer the following questions.

$ h(x) = x^2 \cdot e^x$
Find $h'(x)$

$f(x) = x^2$
$f'(x) = 2x$
$g(x) = e^x$
$g'(x) = e^x$
$h'(x) = f'g + g'f$
$h'(x) = 2x \cdot e^x + e^x \cdot x^2$

$f(x) = \frac{x^2}{x^3 + 1}$
Find $f'(x)$

$a(x) = x^2$
$a'(x) = 2x$
$b(x) = x^3 + 1$
$b'(x) = 3x^2$
$f'(x) = \frac{ba' - ab'}{b^2}$
$f'(x) = \frac{(x^3 + 1)\cdot 2x - x^2 \cdot 3x^2}{(x^3 + 1)^2}$

$h(x) = (2x^4 + 3x)^8$
Find $h'(x)$

$g(x) = x^8$
$g'(x) = 8x^7$
$f(x) = 2x^4 + 3x$
$f'(x) = 8x^3 + 3$
$h'(x) = 8(f(x))^7 \cdot f'(x)$
$h'(x) = 8(2x^4 + 3x)^7 \cdot (8x^3 + 3)$

Partial derivatives

Many times a function has more than one independent variable. In the process of partial differentiation, the derivate is taken with respect to one of the variables, keeping the others constant.
For example:

$f(x, t) = cos(x \cdot t^2)$
Find $\frac {\partial f}{\partial t}$

Even though $x$ is a variable, for this partial derivative it can be considered a constant.

$g(x,t) = x \cdot t^2$
$\frac {\partial}{\partial t}g(x,t) = g'(t) = 2xt$

$\frac {\partial}{\partial t} cos(g(t)) = -sin(g(t)) \cdot g'(t) = -sin(x \cdot t^2) \cdot 2xt$

Find the following partial derivative

$g(x,t) = \frac {t^2 + x^2 + 1}{t + 1}$
Find $\frac {\partial g}{\partial x}$

Finding with respect $x$ so all values of $t$ are constant.

$A = t^2 + 1$
$B = t + 1$
$g(x, t) = \frac{A + x^2}{B}$
$g(x, t) = \frac{A}{B} + \frac{x^2}{B}$
$\frac{\partial g}{\partial x} = \frac{2x}{B}$
$\frac{\partial g}{\partial x} = \frac{2x}{t + 1}$


In [ ]: