# Calculus/Derivatives
## Derivative of a function f at a number a
### Notation

We denote the derivative of a function $f$ at a number $a$ as $f'(a)\,\!$.

### Definition

The derivative of a function $f$ at a number $a$ a is given by the following limit (if it exists):
$f'(a)=\lim _{h\rightarrow 0}{\frac {f(a+h)-f(a)}{h}}$
An analagous equation can be defined by letting $x=(a+h)$. Then $h=(x-a)$, which shows that when $x$ approaches $a$, $h$ approaches $0$:
$f'(a)=\lim _{x\rightarrow a}{\frac {f(x)-f(a)}{x-a}}$

### Interpretations
#### As the slope of a tangent line

Given a function $y=f(x)\,\!$, the derivative $f'(a)\,\!$ can be understood as the slope of the tangent line to $f(x)$ at $x=a$:

##### Example

Find the equation of the tangent line to $y=x^{2}$ at $x=1$.

##### Solution

To find the slope of the tangent, we let $y=f(x)$ and use our first definition:
$f'(a)=\lim _{h\rightarrow 0}{\frac {f(a+h)-f(a)}{h}}\Rightarrow \lim _{h\rightarrow 0}{\frac {\color {Blue}(a+h)^{2}-(a)^{2}}{h}}\Rightarrow \lim _{h\rightarrow 0}{\frac {\color {Blue}a^{2}+2ah+h^{2}-a^{2}}{h}}\Rightarrow \lim _{h\rightarrow 0}{\frac {\color {Blue}h(2a+h)}{h}}\Rightarrow \lim _{h\rightarrow 0}{\color {Blue}(2a+h)}$
It can be seen that as $h$ approaches $0$, we are left with $f'(a)={\color {Blue}2a}\,\!$. If we plug in $1$ for $a$:
$f'({\color {Red}1})=2({\color {Red}1})\Rightarrow {\color {Red}2}$
So our preliminary equation for the tangent line is $y={\color {Red}2}x+b$. By plugging in our tangent point $(1,1)$ to find $b$, we can arrive at our final equation:
${\color {Red}1}=2({\color {Red}1})+b\Rightarrow -1=b$
So our final equation is $y=2x-1\,\!$.

#### As a rate of change

The derivative of a function $f(x)$ at a number $a$ can be understood as the instantaneous rate of change of $f(x)$ when $x=a$.

## The derivative as a function

So far we have only examined the derivative of a function $f$ at a certain number $a$. If we move from the constant $a$ to the variable $x$, we can calculate the derivative of the function as a whole, and come up with an equation that represents the derivative of the function $f$ at any arbitrary $x$ value. For clarification, the derivative of $f$ at $a$ is a number, whereas the derivative of $f$ is a function.

### Notation

Likewise to the derivative of $f$ at $a$, the derivative of the function $f(x)$ is denoted $f'(x)\,\!$.

### Definition

The derivative of the function $f$ is defined by the following limit:
$f'(x)=\lim _{h\rightarrow 0}{\frac {f(x+h)-f(x)}{h}}$
Also,
$f'(x)=\lim _{h\rightarrow x}{\frac {f(x)-f(h)}{x-h}}$
or
$f'(x)=\lim _{h\rightarrow 0}{\frac {f(x+h)-f(x-h)}{2h}}$

## d(x^n)/dx

* Consider the sequences:
* $y=x^{2};\ y+\Delta y=(x+h)^{2}=x^{2}+2xh+h^{2}$
* $y=x^{3};\ y+\Delta y=(x+h)^{3}=x^{3}+3x^{2}h+3xh^{2}+h^{3}$
* $y=x^{4};\ y+\Delta y=(x+h)^{4}=x^{4}+4x^{3}h+6x^{2}h^{2}+4xh^{3}+h^{4}$
* $y=x^{5};\ y+\Delta y=(x+h)^{5}=x^{5}+5x^{4}h+10x^{3}h^{2}+10x^{2}h^{3}+5xh^{4}+h^{5}$
* $y=x^{6};\ y+\Delta y=(x+h)^{6}=x^{6}+6x^{5}h\ +$ many terms containing $h^{2}$
* $y=x^{n};\ y+\Delta y=(x+\Delta x)^{n}=x^{n}+nx^{n-1}\Delta x\ +$ many terms containing $(\Delta x)^{2}$
* $\Delta y=nx^{n-1}\Delta x\ +$ many terms containing $(\Delta x)^{2}$
* Therefore:
* ${\frac {\Delta y}{\Delta x}}=nx^{n-1}\ +$ many terms with each and every term containing $\Delta x$
* ${\frac {dy}{dx}}=\lim _{\Delta x\rightarrow 0}{\frac {\Delta y}{\Delta x}}$
* ${\frac {d(x^{n})}{dx}}=nx^{n-1}$ read as "derivative with respect to $x$ of $x$ to the power $n$."
* Later it will be shown that this is valid for all real $n$, positive or negative, integer or fraction.

### Examples

* ${\frac {d(x^{4})}{dx}}=4x^{(4-1)}=4x^{3}$
* ${\frac {d(7x^{5})}{dx}}=7{\frac {d(x^{5})}{dx}}=7(5x^{4})=35x^{4}$
* ${\frac {d(p^{3})}{dx}}={\frac {d(p^{3})}{dp}}$⋅${\frac {dp}{dx}}=3p^{2}$⋅${\frac {dp}{dx}}$
* ${\frac {d(2t^{2}-7T^{3}+x^{7})}{dx}}=4t$⋅${\frac {dt}{dx}}-7(3T^{2})$⋅${\frac {dT}{dx}}+7x^{6}$
* ${\frac {d(x^{\frac {1}{3}})}{dx}}={\frac {1}{3}}x^{{\frac {1}{3}}-1}={\frac {1}{3}}x^{-{\frac {2}{3}}}$

### Without Using Calculus
#### Derivative of cubic function

* Graph of cubic function illustrating use of associated quadratic.
* When $x==7.5,$ there is exactly 1 value of $x$ that gives $f(x)=f(7.5).$
* When $x==3,$ there are 3 values of $x$ that give $f(x)=f(3).$
* When $x==p,$ there are exactly 2 values of $x$ that give $f(x)=f(p).$
* Point $(p,f(p))$ is a stationary point.
* In the diagram there is a stationary point at $x=p.$
* When $x=p,$ there are exactly 2 values of $x$
* that produce $f(x)=f(p).$
* Aim of this section is to derive the condition that produces exactly 2 values of $x.$
* See Cubic function as
* product
* of linear function and quadratic.
* The associated quadratic when $x=p:$
* $A=a$
* $B=Ap+b=ap+b$
* $C=Bp+c=app+bp+c.$
* Divide $g(x)=ax^{2}+(ap+b)x+(ap^{2}+bp+c)$ by $(x-p).$
* This division gives a quotient of $ax+(2ap+b)$ and remainder of
* $h(p)=3ap^{2}+2bp+c.$
* Factor $(x-p)$ divides $g(x)$ exactly. Therefore, remainder
* $h(p)=0,$ the desired condition.
* When $x=p,\ h(x)=3ax^{2}+2bx+c,$ the derivative of $f(x).$

#### Derivative of quartic function

* $C_{11}Q^{11}+C_{10}Q^{10}+C_{9}Q^{9}+\ \cdots \ +C_{2}Q^{2}+C_{1}Q+C_{0}$ where:
* $C_{11}=(-65536aaaaaaaaaabb)$
* $C_{10}=(-131072aaaaaaaaaabd-229376aaaaaaaaabbc+94208aaaaaaaabbbb)$
* $\cdots \cdots$
* $C_{2}=(-8192aaaaaabdeeee+20480aaaaaacddeee\cdots -288aabbbccccddd+32aabbccccccdd)$
* $C_{1}=(-4096aaaaaaddeeee-4096aaaaabcdeeee\cdots +64aabbcccccdde-20aabbccccdddd)$
* C0 = (- 2048aaaaacddeeee + 768aaaaaddddeee + 1536aaaabcdddeee - 576aaaabdddddee
* + 1024aaaacccddeee - 1536aaaaccddddee + 648aaaacdddddde - 81aaaadddddddd
* - 1152aaabbccddeee + 480aaabbcddddee - 18aaabbdddddde + 640aaabcccdddee
* - 384aaabccddddde + 54aaabcddddddd - 128aaacccccddee + 80aaaccccdddde
* - 12aaacccdddddd + 216aabbbbcddeee - 81aabbbbddddee - 144aabbbccdddee
* + 86aabbbcddddde - 12aabbbddddddd + 32aabbccccddee - 20aabbcccdddde
* + 3aabbccdddddd)

## Product Rule

Let $y=u$⋅$v$ where $u=U(x);\ v=V(x)$
$y+\Delta y=(u+\Delta u)$⋅$(v+\Delta v)=u$⋅$v+u$⋅$\Delta v+v$⋅$\Delta u+\Delta u$⋅$\Delta v$
$\Delta y=u$⋅$\Delta v+v$⋅$\Delta u+\Delta u$⋅$\Delta v$
${\frac {\Delta y}{\Delta x}}=u$⋅${\frac {\Delta v}{\Delta x}}+v$⋅${\frac {\Delta u}{\Delta x}}+{\frac {(\Delta u)(\Delta v)}{\Delta x}}$
${\frac {dy}{dx}}=u$⋅${\frac {dv}{dx}}+v$⋅${\frac {du}{dx}}$

### Examples

* Let $y=x^{\frac {m}{n}}.$ Calculate ${\frac {dy}{dx}}$
* $y^{n}=x^{m}$
* Differentiate both sides.
* $ny^{n-1}\cdot {\frac {dy}{dx}}=mx^{m-1}$
* ${\frac {dy}{dx}}={\frac {mx^{m-1}}{ny^{n-1}}}$
* $={\frac {mx^{m-1}}{n(x^{\frac {m}{n}})^{n-1}}}$
* $={\frac {mx^{m-1}}{nx^{m-{\frac {m}{n}}}}}$
* $={\frac {m}{n}}\cdot x^{m-1-m+{\frac {m}{n}}}$
* $={\frac {m}{n}}\cdot x^{{\frac {m}{n}}-1}$
* This shows that ${\frac {d(x^{n})}{dx}}$ as above is valid when $n$ is a positive fraction.
* Let $y=x^{-n}={\frac {1}{x^{n}}}$. Calculate ${\frac {dy}{dx}}$.
* $yx^{n}=1$
* Differentiate both sides.
* $ynx^{n-1}+x^{n}{\frac {dy}{dx}}=0$
* ${\frac {dy}{dx}}=-{\frac {ynx^{n-1}}{x^{n}}}=-{\frac {nx^{n-1}}{x^{n}x^{n}}}=-nx^{n-1}x^{-2n}=-nx^{-n-1}$
* This shows that ${\frac {d(x^{n})}{dx}}$ as above is valid for negative $n$.
* Let $y=x^{-{\frac {m}{n}}}$. Calculate ${\frac {dy}{dx}}$.
* $y^{n}=x^{-m}$
* Differentiate both sides.
* $ny^{n-1}{\frac {dy}{dx}}=-mx^{-m-1}$
* ${\frac {dy}{dx}}=-{\frac {mx^{-m-1}}{ny^{n-1}}}=-{\frac {mx^{-m-1}}{n(x^{-{\frac {m}{n}}})^{n-1}}}$
* $=-{\frac {mx^{-m-1}}{nx^{-m+{\frac {m}{n}}}}}$
* $=-{\frac {m}{n}}x^{-m-1+m-{\frac {m}{n}}}$
* $=-{\frac {m}{n}}x^{-{\frac {m}{n}}-1}$
* This shows that ${\frac {d(x^{n})}{dx}}$ as above is valid when $n$ is a negative fraction.

## Quotient rule

Used where $y={\frac {U(x)}{V(x)}}$
$y={\frac {u}{v}}$
$yv=u$
$yv'+vy'=u'$
$vy'=u'-yv'=u'-{\frac {uv'}{v}}$
$y'={\frac {u'}{v}}-{\frac {uv'}{v^{2}}}={\frac {vu'}{v^{2}}}-{\frac {uv'}{v^{2}}}={\frac {vu'-uv'}{v^{2}}}$

## Derivatives of trigonometric functions
### sine(x)

$y=\sin(x)$
$y+\Delta y=\sin(x+\Delta x)=\sin(x)\cos(\Delta x)+\cos(x)\sin(\Delta x)$
$\Delta y=\sin(x)\cos(\Delta x)+\cos(x)\sin(\Delta x)-\sin(x)$
${\frac {\Delta y}{\Delta x}}=\sin(x)$⋅${\frac {\cos(\Delta x)-1}{\Delta x}}+\cos(x)$⋅${\frac {\sin(\Delta x)}{\Delta x}}$
The value ${\frac {\cos(\Delta x)-1}{\Delta x}}$:
>>> # python code
>>> [ (math.cos(Δx)-1)/Δx for Δx in (.1,.01,.001,.0001,.0000_1,.0000_01,.0000_001,.0000_0001,.0000_0000_1) ]
[-0.049958347219742905, -0.004999958333473664, -0.0004999999583255033,
-4.999999969612645e-05, -5.000000413701855e-06, -5.000444502911705e-07,
-4.9960036108132044e-08, 0.0, 0.0]
$\lim _{\Delta x\rightarrow 0}{\frac {\cos(\Delta x)-1}{\Delta x}}=\lim _{\Delta x\rightarrow 0}{\frac {-\sin(\Delta x)}{1}}=0$
by L'Hôpital's rule.
The value ${\frac {\sin(\Delta x)}{\Delta x}}$:
>>> # python code
>>> [ math.sin(Δx)/Δx for Δx in (.1,.01,.001,.0001,.0000_1,.0000_01,.0000_001,.0000_0001,.0000_0000_1) ]
[0.9983341664682815, 0.9999833334166665, 0.9999998333333416,
0.9999999983333334, 0.9999999999833332, 0.9999999999998334,
0.9999999999999983, 1.0, 1.0]
$\lim _{\Delta x\rightarrow 0}{\frac {\sin(\Delta x)}{\Delta x}}=\lim _{\Delta x\rightarrow 0}{\frac {\cos(\Delta x)}{1}}=1$
by L'Hôpital's rule.
${\frac {dy}{dx}}=\sin(x)$⋅$0+\cos(x)$⋅$1=\cos(x)$
Proof of 2 limits
Figure 1: $\lim _{\theta \rightarrow 0}{\frac {\sin(\theta )}{\theta }}:$
Area of sector $AOB\ \geq$ area of triangle $COB.$
Area of triangle $COB\ \geq$ area of sector $COD.$
$\lim _{\theta \rightarrow 0}{\frac {\sin(\theta )}{\theta }}:$
In the diagram $OA=OB=1.$ $OC=OD=\cos(\theta ).$ $CB=\sin(\theta ).$
Let $S$ be the area of a sector of a circle. Then ${\frac {S}{\pi r^{2}}}={\frac {\theta }{2\pi }}$
and $S={\frac {\theta r^{2}}{2}}.$
Area of sector $COD={\frac {\theta \cos ^{2}(\theta )}{2}}.$
Area of triangle $OCB={\frac {\sin(\theta )\cos(\theta )}{2}}.$
Area of sector $AOB={\frac {\theta \cdot 1^{2}}{2}}={\frac {\theta }{2}}.$
Therefore ${\frac {\theta }{2}}\ \geq \ {\frac {\sin(\theta )\cos(\theta )}{2}}\ \geq \ {\frac {\theta \cos ^{2}(\theta )}{2}}.$
$\theta \ \geq \ \sin(\theta )\cos(\theta )\ \geq \ \theta \cos ^{2}(\theta ).$
${\frac {\theta }{\theta \cos(\theta )}}\ \geq \ {\frac {\sin(\theta )\cos(\theta )}{\theta \cos(\theta )}}\ \geq \ {\frac {\theta \cos ^{2}(\theta )}{\theta \cos(\theta )}}$
${\frac {1}{\cos(\theta )}}\ \geq \ {\frac {\sin(\theta )}{\theta }}\ \geq \ \cos(\theta )$
$\lim _{\theta \rightarrow 0}{\frac {1}{\cos(\theta )}}\ \geq \ \lim _{\theta \rightarrow 0}{\frac {\sin(\theta )}{\theta }}\ \geq \ \lim _{\theta \rightarrow 0}\cos(\theta )$
$1\ \geq \ \lim _{\theta \rightarrow 0}{\frac {\sin(\theta )}{\theta }}\ \geq \ 1$
Therefore $\lim _{\theta \rightarrow 0}{\frac {\sin(\theta )}{\theta }}=1.$
$\lim _{\theta \rightarrow 0}{\frac {\cos(\theta )-1}{\theta }}:$
${\frac {\cos(\theta )-1}{\theta }}$
$=(-1)\cdot {\frac {1-\cos(\theta )}{\theta }}$
$=(-1)\cdot {\frac {1-\cos(\theta )}{\theta }}\cdot {\frac {1+\cos(\theta )}{1+\cos(\theta )}}$
$=(-1)\cdot {\frac {\sin(\theta )}{\theta }}\cdot {\frac {\sin(\theta )}{1+\cos(\theta )}}$
$\lim _{\theta \rightarrow 0}{\frac {\cos(\theta )-1}{\theta }}$
$=\lim _{\theta \rightarrow 0}(-1)\cdot {\frac {\sin(\theta )}{\theta }}\cdot {\frac {\sin(\theta )}{1+\cos(\theta )}}$
$=(-1)\cdot \lim _{\theta \rightarrow 0}{\frac {\sin(\theta )}{\theta }}\cdot \lim _{\theta \rightarrow 0}{\frac {\sin(\theta )}{1+\cos(\theta )}}$
$=(-1)\cdot 1\cdot {\frac {0}{1+1}}=0.$ :

### cosine(x)

$y=\cos(x)={\sqrt {1-\sin ^{2}(x)}}$
$y^{2}=1-\sin(x)$⋅$\sin(x)$
Differentiate both sides:
$2y$⋅${\frac {dy}{dx}}=-(2\sin(x)\cos(x))$
${\frac {dy}{dx}}=-{\frac {\sin(x)\cos(x)}{\cos(x)}}=-\sin(x).$

### tan(x)

$y=\tan(x)={\frac {\sin(x)}{\cos(x)}}$
$y\cos(x)=\sin(x)$
Differentiate both sides:
$y(-\sin(x))+\cos(x)$⋅${\frac {dy}{dx}}=\cos(x)$
$\cos(x)$⋅${\frac {dy}{dx}}=\cos(x)+y\sin(x)$
${\frac {dy}{dx}}={\frac {\cos(x)+\tan(x)\sin(x)}{\cos(x)}}=1+\tan ^{2}(x)=\sec ^{2}(x)$

## Derivatives of inverse trigonometric functions
### arcsine(x)

* Figure 2: Graph of $y=\arcsin(x)$ and associated curves.
* $y=\arcsin(x);\|x\|<=1$
* $x=\sin(y)$
* ${\frac {dx}{dy}}=\cos(y)$
* ${\frac {dy}{dx}}={\frac {1}{\cos(y)}}={\frac {1}{\sqrt {1-\sin ^{2}(y)}}}={\frac {1}{\sqrt {1-x^{2}}}}$
* In the figure to the right you can see that the curves $y=\arcsin(x),\ x=\sin(y)$ are
* the same curve. However curve $y=\arcsin(x)$ is limited to ${\frac {\pi }{2}}>=y>={\frac {-\pi }{2}}.$
* The derivative ${\frac {dy}{dx}}={\frac {1}{\sqrt {1-x^{2}}}}$ shows that the slope of $y=\arcsin(x)$
* is $1$ when $x=0$ and infinite when $x=\pm 1.$

### arccosine(x)

* Figure 3: Graph of $y=\arccos(x)$ and associated curves.
* $y=\arccos(x);\|x\|<=1$
* $x=\cos(y)$
* ${\frac {dx}{dy}}=-\sin(y)$
* ${\frac {dy}{dx}}={\frac {-1}{\sin(y)}}={\frac {-1}{\sqrt {1-\cos ^{2}(y)}}}={\frac {-1}{\sqrt {1-x^{2}}}}$
* In the figure to the right you can see that the curves $y=\arccos(x),\ x=\cos(y)$ are
* the same curve. However curve $y=\arccos(x)$ is limited to $\pi >=y>=0.$
* The derivative ${\frac {dy}{dx}}={\frac {-1}{\sqrt {1-x^{2}}}}$ shows that the slope of $y=\arccos(x)$
* is $-1$ when $x=0$ and infinite when $x=\pm 1.$

### arctan(x)

* Figure 4: Graph of $y=\arctan(x)$ and associated curves.
* $y=\arctan(x)$
* $x=\tan(y)$
* ${\frac {dx}{dy}}=\sec ^{2}(y)$
* ${\frac {dy}{dx}}={\frac {1}{\sec ^{2}(y)}}=\cos ^{2}(y)={\frac {1}{1+x^{2}}}$
* In the figure to the right you can see that the curves $y=\arctan(x),\ x=\tan(y)$ are
* the same curve. However curve $y=\arctan(x)$ is limited to ${\frac {\pi }{2}}>y>{\frac {-\pi }{2}}.$
* The derivative ${\frac {dy}{dx}}={\frac {1}{\sqrt {1+x^{2}}}}$ shows that the slope of $y=\arctan(x)$
* is $1$ when $x=0$ and $0$ when $x=\pm \infty$

## Derivatives of logarithmic functions
### a^x or $a^{x}$

* Figure 5: Graphs of ${\frac {a^{x}-1}{x}}$ for a = $2,\ 8,\ 32,\ 128$ .
* Figure 5 contains graphs of ${\frac {a^{x}-1}{x}}$ for $a=2,\ 8,\ 32,\ 128$ with
* graph of ${\frac {e^{x}-1}{x}}$ included for reference.
* All values of $x$ are valid for all curves except where $x=0.$
* This method for calculation of $\ln(a)$ supposes that function sqrt is available.
* Programming language python interprets expression a**b as $a^{b}.$
* Therefore, in python, $\ln(2)$ can be calculated in accordance with the basic definition above:
* # python code
* >>> getcontext.prec
* 101 # Precision of 101.
* >>> dx = Decimal('1E-50')
* >>> (2**dx - 1)/dx
* Decimal('0.69314718055994530941723212145817656807550013436026') # ln(2)
* >>> (2**(-dx) - 1)/(-dx)
* Decimal('0.693147180559945309417232121458176568075500134360253') # ln(2)

### ln(x)

$y=ln(x)$
$x=e^{y}$
${\frac {dx}{dy}}=e^{y}$
${\frac {dy}{dx}}={\frac {1}{e^{y}}}={\frac {1}{x}}$

#### Examples

* $y=\ln(ax)$
* ${\frac {dy}{dx}}={\frac {d}{dx}}\ln(ax)={\frac {d}{dx}}(\ln(a)+\ln(x))={\frac {d}{dx}}\ln(a)+{\frac {d}{dx}}\ln(x)={\frac {1}{x}}$
* $y=\ln(x^{a})$
* ${\frac {dy}{dx}}={\frac {d}{dx}}\ln(x^{a})={\frac {d}{dx}}(a\cdot \ln(x))=a\cdot {\frac {d}{dx}}\ln(x)={\frac {a}{x}}$
* $y=x^{\frac {m}{n}}$ Calculate ${\frac {dy}{dx}}$
* $y^{n}=x^{m}$
* $n\cdot \ln(y)=m\cdot \ln(x)$
* $n\cdot {\frac {1}{y}}\cdot {\frac {dy}{dx}}=m\cdot {\frac {1}{x}}$
* ${\frac {dy}{dx}}=m\cdot {\frac {1}{x}}\cdot {\frac {y}{n}}$
* $={\frac {m}{n}}\cdot {\frac {x^{\frac {m}{n}}}{x}}$
* $={\frac {m}{n}}\cdot x^{{\frac {m}{n}}-1}$
* Careful manipulation of logarithms converts exponents into simple constants.

## Chain rule

Used where $y=G(H(I(x)))$

### Examples

* $y=\cos(2x)$
* Let $y=\cos(u)$ where $u=2x$.
* ${\begin{aligned}{\frac {dy}{dx}}=&{\frac {dy}{du}}\cdot {\frac {du}{dx}}\\=&-\sin(u)\cdot 2\\=&-2\sin(2x)\\\end{aligned}}$
* $y=\sin ^{2}(\ln(5x))$
* Let $y=u^{2}$ where $u=\sin(v);\ v=\ln(w);\ w=5x$.
* ${\begin{aligned}{\frac {dy}{dx}}=&{\frac {dy}{du}}\cdot {\frac {du}{dv}}\cdot {\frac {dv}{dw}}\cdot {\frac {dw}{dx}}\\=&2u\cdot \cos(v)\cdot {\frac {1}{w}}\cdot 5\\=&2\sin(v)\cdot \cos(\ln(w))\cdot {\frac {1}{5x}}\cdot 5\\=&2\sin(\ln(w))\cdot \cos(\ln(5x))\cdot {\frac {1}{x}}\\=&2\sin(\ln(5x))\cdot \cos(\ln(5x))\cdot {\frac {1}{x}}\\\end{aligned}}$

## Applications of the Derivative
### Shape of curves

The first derivative of $f(x)=y'$ or $f'(x).$ As shown above, $f'(x)$ at any point $x_{1}$ gives the slope of $f(x)$ at point $x_{1}.$
$f'(x_{1})$ is the slope of $f(x)$ when $x=x_{1}.$
* Figure 1: Diagram illustrating relationship between $f(x)=x^{2}-x-2$and $f'(x)=2x-1.$ When $x=0.5,$ both $f'(x)$ and slope of $f(x)=0.$ When $x=0,$ both $f'(x)$ and slope of $f(x)=-1.$ When $x=1,$ both $f'(x)$ and slope of $f(x)=1.$ Point $(0.5,-2.25)$ is absolute minimum.
* In the example to the right, $y=f(x)=x^{2}-x-2$ and $y'=f'(x)=2x-1.$
* Of special interest is the point at which $f'(x)$ or slope of $f(x)=0.$
* When $f'(x)=0,\ x=0.5$ and $f(x)=0.5^{2}-0.5-2=-2.25.$
* The point $(0.5,-2.25)$ is called a critical point or stationary point of $f(x).$
* Because $y'$ has exactly one solution for $y'=0,\ f(x)$ has exactly one critical point.
* The value of $y$ at point $(0.5,-2.25)$ is less than $y$ at both
* $(0,-2),\ (1,-2).$ Therefore the critical point $(0.5,-2.25)$ is a minimum of $f(x).$
* In this curve $y=x^{2}-x-2,$ the point $(0.5,-2.25)$ is both local minimum and absolute minimum.
* Figure 1: Diagram illustrating relationship between $f(x)={\frac {2x^{3}+3x^{2}-12x-8}{8}}$ and $f'(x)={\frac {6x^{2}+6x-12}{8}}.$
* When $x=-2$ or $x=1,$ both $f'(x)$ and slope of $f(x)=0.$
* When $x=-3,$ both $f'(x)$ and slope of $f(x)=3.$
* When $x=-1,$ both $f'(x)$ and slope of $f(x)=-1.5.$
* When $x=2,$ both $f'(x)$ and slope of $f(x)=3.$
* Point $(-2,1.5)$ is local maximum.
* Point $(1,-1{\frac {7}{8}})$ is local minimum.
* In the example to the right, $y=f(x)={\frac {2x^{3}+3x^{2}-12x-8}{8}}$ and $y'=f'(x)={\frac {6x^{2}+6x-12}{8}}.$
* Of special interest are the points at which $f'(x)$ or slope of $f(x)=0.$
* When $f'(x)=0,\ x=-2$ and $f(x)=1.5$ or
* When $f'(x)=0,\ x=1$ and $f(x)=-1{\frac {7}{8}}.$
* The points $(-2,1.5),\ (1,-1{\frac {7}{8}})$ are critical or stationary points of $f(x).$
* Because $y'$ has exactly two real solutions for $y'=0,\ f(x)$ has exactly two critical points.
* Slope of $f(x)$ to the left of $(-2,1.5)$ is positive and
* adjacent slope of $f(x)$ to the right of $(-2,1.5)$ is negative.
* Therefore point $(-2,1.5)$ is local maximum. Point $(-2,1.5)$ is not absolute maximum.
* Adjacent slope of $f(x)$ to the left of $(1,-1{\frac {7}{8}})$ is negative and
* slope of $f(x)$ to the right of $(1,-1{\frac {7}{8}})$ is positive.
* Therefore point $(1,-1{\frac {7}{8}})$ is local minimum. Point $(1,-1{\frac {7}{8}})$ is not absolute minimum.

### Maxima and Minima
#### Electric water heater

* Figure 1(a): Graph of $V=f(r)$ and ${\frac {dV}{dr}}$ for $S=100$
* with $y$ axis compressed.
* For maximum $V,\ r={\sqrt {\frac {S}{3\pi }}}=3.257\dots$ and
* $V=108.578\dots$
* A cylindrical water heater is standing on its base on a hard rubber pad that is a perfect thermal insulator.
* The vertical curved surface and the top are exposed to the free air. The design of the cylinder requires that the volume of the cylinder
* should be maximum for a given surface area exposed to the free air. What is the shape of the cylinder?
* Let the height of the cylinder be $h$ and let $h=Kr$ where $r$
* is the radius and $K$ is a constant.
* Surface of cylinder $=S=\pi r^{2}+2\pi rh=\pi r^{2}+2\pi r(Kr)=\pi r^{2}+2\pi r^{2}K$
* Volume of cylinder $=V=\pi r^{2}h=\pi r^{2}(Kr)=\pi r^{3}K$
* $K={\frac {S-\pi r^{2}}{2\pi r^{2}}}$
* $V=\pi r^{3}\cdot {\frac {S-\pi r^{2}}{2\pi r^{2}}}={\frac {r(S-\pi r^{2})}{2}}={\frac {rS-\pi r^{3}}{2}}$
* ${\frac {dV}{dr}}={\frac {S-3\pi r^{2}}{2}}$
* For maximum volume, ${\frac {dV}{dr}}=0$
* Therefore $S-3\pi r^{2}=0$
* $S=3\pi r^{2};\ \pi r^{2}(1+2K)=3\pi r^{2};\ 1+2K=3;\ K=1.$
* The height of the cylinder equals the radius.

#### Square and triangle

* Figure 1(b): Graph of parabola $A=f(s)$
* with $y$
* axis compressed.
* A square of side $h$ has perimeter $P_{s}=4h$ and area
* $A_{s}=h^{2}.$
* An equilateral triangle of side $s$ has perimeter $P_{t}=3s$
* and area $A_{t}={\frac {\sqrt {3}}{4}}s^{2}.$
* $P_{s}+P_{t}=50.$
* Total area $A=A_{s}+A_{t}$ and $A$ must be minimum. What is the value of
* $s$?
* $4h+3s=50$
* $h={\frac {50-3s}{4}}$
* $A_{s}=h^{2}=({\frac {50-3s}{4}})^{2}$
* $={\frac {2500-300s+9s^{2}}{16}}$
* $A=A_{s}+A_{t}$
* $={\frac {2500-300s+9s^{2}}{16}}+{\frac {\sqrt {3}}{4}}s^{2}$
* $={\frac {1}{16}}(2500-300s+9s^{2}+4{\sqrt {3}}s^{2})$
* For minimum $A,\ {\frac {dA}{ds}}=0.$
* $-300+2(9+4{\sqrt {3}})s=0$
* $(9+4{\sqrt {3}})s=150$
* $s={\frac {150}{9+4{\sqrt {3}}}}$
* $=9.417\dots$

#### County Road

* Figure 1(c): Plan of county road between Town A and Town B to be constructed so that cost is minimum.
* Town B is 40 miles East and 50 miles North of Town A. The county is going to construct a road from Town A to Town B.
* Adjacent to Town A the cost to build a road is $500k/mile.
* Adjacent to Town B the cost to build a road is $200k/mile.
* The dividing line runs East-West 30 miles North of Town A.
* Calculate the position of point C so that the cost of the road from Town A to Town B is minimum.
* Let point $C=(x,30).$
* Then distance from Town A to point $C={\sqrt {x^{2}+30^{2}}}={\sqrt {x^{2}+900}}.$
* Distance from Town B to point $C={\sqrt {(40-x)^{2}+20^{2}}}$
* $={\sqrt {1600-80x+x^{2}+400}}$
* $={\sqrt {2000-80x+x^{2}}}.$
* Figure 1(d): Graphs showing cost of county road $(f(x))$ and $f'(x).$
* Curve showing $(f(x))$ is actually ${\frac {f(x)}{10}}$.
* Cost is minimum where $x=10.523\dots$
* Cost $=5{\sqrt {x^{2}+900}}+2{\sqrt {2000-80x+x^{2}}}$ in units of $100k.
* For minimum cost $f'(x)=0.$
* $5\cdot {\frac {1}{2}}\cdot {\frac {2x}{\sqrt {x^{2}+900}}}+2\cdot {\frac {1}{2}}\cdot {\frac {-80+2x}{\sqrt {2000-80x+x^{2}}}}=0$
* ${\frac {5x}{\sqrt {x^{2}+900}}}+{\frac {-80+2x}{\sqrt {2000-80x+x^{2}}}}=0$
* $5x{\sqrt {2000-80x+x^{2}}}+(-80+2x){\sqrt {x^{2}+900}}=0$

#### Cardboard box

* Figure 1(e): Sheet of cardboard to be cut and folded to make box of maximum possible volume.
* Cut on purple lines, fold on red lines.
* Design of box includes top.
* A piece of cardboard of length $4\ ft$ and width $3\ ft$
* will be used to make a box with a top. Some waste will be cut out of the piece of cardboard
* and the remaining cardboard will be folded to make a box so that the volume of the box is maximum.
* What is the height of the box?
* Figure 1(f): Curves associated with design of cardboard box.
* ${\frac {dV}{dh}}=0$ and
* $V$ is maximum when $h={\frac {7-{\sqrt {13}}}{6}}$
* $2h+l=3$
* $2w+2h=4;\ w+h=2$
* $V=lwh=(3-2h)(2-h)h=2h^{3}-7h^{2}+6h$
* For maximum volume ${\frac {dV}{dh}}=6h^{2}-14h+6=0.$
* $3h^{2}-7h+3=0$
* $h={\frac {7-{\sqrt {13}}}{6}}=6.788\dots$ inches.

#### Solving ellipse at origin

* Let $c=\cos(\theta )$ and $s=\sin(\theta ).$
* Then
* $x=t\cos(\theta )=tc,$ and
* $y=t\sin(\theta )=ts.$
* Substitute these values in $(1):$
* $Attcc+Bttcs+Cttss+F=0\ \dots \ (2)$
* Calculate $t'={\frac {dt}{d\theta }}$
* $A(tt(-2cs)+cc2tt')+B(tt(cc-ss)+cs2tt')+C(tt(2sc)+ss2tt')=0$
* $Att(-2cs)+Acc2tt'+Btt(cc-ss)+Bcs2tt'+Ctt(2sc)+Css2tt'=0$
* $-2Attcs+Acc2tt'+Bttcc-Bttss+Bcs2tt'+2Cttsc+2Csstt'=0$
* $+Acc2tt'+2Bcstt'+2Csstt'-2Attcs+Bttcc-Bttss+2Cttsc=0$
* $+t'(Acc2t+2Bcst+2Csst)=+2Attcs-Bttcc+Bttss-2Cttsc$
* $t'={\frac {+2Attcs-Bttcc+Bttss-2Cttsc}{(Acc2t+2Bcst+2Csst)}}$
* For maximum or minimum $t:$
* $2Attcs-Bttcc+Bttss-2Cttsc=0$
* $2Acs-Bcc+Bss-2Csc=0$
* $2Acs-2Csc=Bcc-Bss$
* Square both sides, substitute $1-ss$ for $cc$ and result is:
* $aS^{2}+bS+c=0\ \dots \ (3)$ where:
* $S=\sin ^{2}(\theta )$
* $a=(+4AA-8AC+4BB+4CC)$
* $b=-a$
* $c=BB$

### Rates of Change
#### The car jack

* Figure 2: Photo of car jack illustrating horizontal $(BC)$ and vertical $(CA)$ rates of change.
* In triangle $ABC$ to the right:
* length $AB=10$ inches,
* length $BC=x$ inches and is horizontal,
* length $CA=y$ inches and is vertical,
* $\angle ABC=\theta .$
* Point $B$ is moving towards point $C$ at the rate of $5$ inches$/$minute.

#### On the clock

* Calculating ${\frac {d\theta }{dt}}:$
* Angular velocity of minute hand $={\frac {2\pi }{1}}$ radians/hour.
* Angular velocity of hour hand $={\frac {2\pi }{12}}={\frac {\pi }{6}}$ radians/hour.
* ${\frac {d\theta }{dt}}=$ angular velocity of minute hand relative to hour hand $=2\pi -{\frac {\pi }{6}}={\frac {11\pi }{6}}$ radians/hour.
* Calculating ${\frac {da}{d\theta }}:$
* $a^{2}=3^{2}+4^{2}-2\cdot 3\cdot 4\cdot \cos \theta =25-24\cos \theta .$
* $2a\cdot {\frac {da}{d\theta }}=24\sin \theta .$
* ${\frac {da}{d\theta }}={\frac {24\sin \theta }{2a}}={\frac {24\sin 90^{\circ }}{2\cdot 5}}={\frac {24}{10}}=2.4.$

#### Radar Speed Trap

* Figure 6: Multi-lane highway oriented East-West.
* $AB=c=200$ feet.
* $BC=a=50$ feet.
* $AC=b$.
* ${\frac {dc}{dt}}=60$ mph.
* A multi-lane highway is oriented East-West. A vehicle is moving in the inside lane from West to East.
* A law-enforcement officer with a radar gun is in position 50 feet South of the center of the inside lane.
* When the vehicle is 200 feet from the radar gun, it shows the vehicle's speed to be 60 mph.
* What is the actual speed of the vehicle?
* Let length $AC=b.$
* ${\frac {db}{dt}}={\frac {db}{dc}}\cdot {\frac {dc}{dt}}$ where ${\frac {dc}{dt}}=60$ mph.
* The derivative ${\frac {db}{dc}}:$
* ${\begin{aligned}\ \ \ \ &b^{2}=c^{2}-a^{2};\ b={\sqrt {c^{2}-a^{2}}}\\&2b\cdot {\frac {db}{dc}}=2c\\&{\frac {db}{dc}}={\frac {2c}{2b}}={\frac {c}{\sqrt {c^{2}-a^{2}}}}\end{aligned}}$
* ${\frac {db}{dt}}={\frac {200}{\sqrt {200^{2}-50^{2}}}}\cdot 60=61.967\dots$ mph.

#### On the Water

* Figure 1: Diagram indicating position, course and speed of ship relative to lighthouse.
* $\angle BCA=\angle \theta .$
* Calculating ${\frac {dc}{da}}:$
* $c^{2}=a^{2}+b^{2}-2ab\cos \theta$
* $2c\cdot {\frac {dc}{da}}=2a-2b\cos \theta$
* ${\frac {dc}{da}}={\frac {a-b\cos \theta }{c}}=-0.291161615782696$
* The $-$ sign indicates that, when $a$ is increasing,
* $c$ is decreasing.

#### Reciprocating engine

* Figure 1: Diagram illustrating mathematical relationship between piston, connecting rod and crankshaft in reciprocating engine.
* The diagram illustrates the piston, connecting rod and crankshaft
* of an internal combustion reciprocating engine.
* The connecting rod $a$ is connected to piston on $y$ axis,
* and to crankshaft at end of $c$ on $x$ axis.
* This section analyzes the motion of the piston as the crankshaft rotates through angle
* $x$ and the piston moves up and down on the $y$ axis.

### Simple laws of motion

* Let a body move in accordance with the following function of $t,\ f(t)$ where $t$ means time:
* $p_{t}=f(t)=at^{2}+bt+c$ where $p_{t}$ is position at time $t.$
* $p_{t}$ has the dimension of length. Therefore, each component of $f(t)$ must have the dimension of length.
* For $bt$ to have the dimension of length, $b$ must have the dimensions of ${\frac {length}{time}}$
* or velocity.
* For $at^{2}$ to have the dimension of length, $a$ must have the dimensions of ${\frac {length}{time^{2}}}$
* or acceleration.
* If $t==0,\ p_{0}=c$ and $p_{t}=f(t)=at^{2}+bt+p_{0}.$
* The derivatives enable us to assign specific values to $a,\ b.$
* ${\frac {d(p_{t})}{dt}}=f'(t)=v_{t}=2at+b$ where $v_{t}$ is velocity at time $t.$
* If $t==0,\ v_{0}=b$ and $p_{t}=f(t)=at^{2}+v_{0}t+p_{0}.$
* ${\frac {d(v_{t})}{dt}}=f''(t)=2a,$ a constant equal to the acceleration to which the body is subjected.
* For convenience let us say that $p_{t}={\frac {1}{2}}at^{2}+v_{0}t+p_{0}$ where $a$ is the
* (constant) acceleration to which the body is subjected.
* Then $v_{t}={\frac {1}{2}}\cdot 2at+v_{0}=at+v_{0}$ and ${\frac {d(v_{t})}{dt}}=a.$