Derivatives

  • Determining Rules
  • Examining Relationship between Function and Derivative
[1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import sympy as sy
import pandas as pd
[2]:
#writing a derivative and its definition

Find the Derivative

\[f(x) = \sqrt{x} + x^3\]

Derivative at a Point

What is \(f'(1)\)?

[3]:
#instantaneous rate of change of function f

[4]:
#derivative as a function of x

Other Functions

  • \(\sin\) and \(\cos\)
  • \(e^x\)
[5]:
x, h = sy.symbols('x h')
[9]:
def ddf(f, x, h):
    return (f(x + h) - f(x))/h
[10]:
def f(x):
    return sy.exp(x)
[11]:
ddf(f, x, h)
[11]:
$\displaystyle \frac{- e^{x} + e^{h + x}}{h}$
[12]:
def g(x):
    return sy.sin(x)
[13]:
ddf(g, x, h)
[13]:
$\displaystyle \frac{- \sin{\left(x \right)} + \sin{\left(h + x \right)}}{h}$
[15]:
sy.diff(g(x))
[15]:
$\displaystyle \cos{\left(x \right)}$
[16]:
sy.diff(f(x))
[16]:
$\displaystyle e^{x}$

Desigining a Curve

  • At least 3 zeros between \(x = -2\) and \(x = 2\)
  • Plot function and Derivative itself
[ ]:

[ ]:

[ ]:

[ ]:

[ ]:

[ ]: