## MA101.19 The Chain Rule – One Variable

Consider the function $f:\mathbb{R} \to \mathbb{R}$ given by $f(x) = \sin{x}$. We are used to wring such things as:

i) $f'$
ii) $f'(x)$
iii) $\displaystyle \frac{df}{dx}$.  For example we would write $f'(x) = \cos{x}$ for example.

Equally well, of course, it would be true to write $f'(u) = \cos{u}$.

The meaning of (i) and (ii) are mathematically precise. $f'$ means the derived function and $f'(x)$ means the value of $f'$ at x.

The meaning of $\displaystyle \frac{df}{dx}$ can be more devious.

It can simply be taken as synonymous with $f'(x)$. That is $\displaystyle \frac{df}{dx} = f'(x)$.

When such is the intention it would be indisputable that $\displaystyle \frac{df}{du}$ means $f'(u)$.

But there are other more shady uses as we will see.

Now consider substituting $x = u^2$ in $f(x) = \sin{x}$ to define a function F defined as $f(u) = \sin{u^2}$.

The chain rule says

\begin{aligned} \displaystyle \frac{dF}{du} &= \frac{df}{dx} \cdot \frac{dx}{du} \\&= \cos{x} \cdot 2u \\&= 2u\cos{u^2} \end{aligned}

where here $\frac{dF}{du}$ means $F'(u)$.

Note that F is not equal to f, but mathematicians frequently write the chain rule as,

$\displaystyle \frac{df}{du} = \frac{df}{dx} \cdot \frac{dx}{du}$.

Here $\frac{df}{du}$ does not mean $f'(u)$ which is after all $\cos{u}$.

To see the chain rule in a more precise and unambiguous form think of $x=u^2$ as defining a function g given by $g(u)=u^2$, then $F = f \circ g$ and we see the chain rule as saying

$(f \circ g)'(u) = f'(g(u)) \cdot g'(u)$

Of course the u here is an entirely dummy symbol.

## MA101.18 Partial Differentiation

Consider the curve in which the surface $z=f(x,y)$ meets the plane $y=c$ a constant.

In this plane $z=f(x,c)$, and $\displaystyle \frac{dz}{dx}$ would be a formula for the gradient of the tangent to the curve.

If we differentiate $f(x,y)$ with respect to x, treating the y as if it was a constant (some say holding y constant), the the derivative obtained is called the partial derivative of $f(x,y)$ with respect to x and we write $\displaystyle \frac{\partial f}{\partial x}$ or $f_x$ or $D_x f$. Similarily we have $\displaystyle \frac{\partial f}{\partial y}$.

With functions of more than two variables one differentiates with respect to one of the variables by holding all the other variables constant.

##### Examples

$\displaystyle \frac{\partial}{\partial x} (x^2 y^2 + \tan{x}) = 2xy^2 + \sec{^2}{x}$.

$\displaystyle \frac{\partial}{\partial y}( x^2 y^2 + tan x) =2x^2 y$

$\displaystyle \frac{\partial}{\partial x} (2x+\sin{xy}) = 2 + y \cos{xy}$

$\displaystyle \frac{\partial}{\partial y} (2x+\sin{xy}) = x \cos{xy}$

In the obvious way we can have higher order partial derivatives.

\displaystyle \begin{aligned} f(x,y) &= x^2 y + \sin{x} \\ \frac{\partial ^2 f}{\partial x^2} &= \frac{\partial}{\partial x}\bigg[\frac{\partial}{\partial x}(x^2y + \sin{x})\bigg] \\ &= \frac{\partial}{\partial x}\bigg[2xy+\cos{x}\bigg] \\ &= 2y - \sin{x}\end{aligned}

\displaystyle \begin{aligned} \frac{\partial ^2 f}{\partial y \partial x} &= f_{yx} \\ &= \frac{\partial}{\partial y}\bigg[\frac{\partial}{\partial x}(x^2y + \sin{x})\bigg] \\ &= 2x \end{aligned}

\displaystyle \begin{aligned} \frac{\partial ^2 f}{\partial x \partial y} &= f_{xy} \\ &= \frac{\partial}{\partial x}\bigg[\frac{\partial}{\partial y}(x^2y + \sin{x})\bigg] \\ &= 2x \end{aligned}

\displaystyle \begin{aligned} \frac{\partial ^2 f}{\partial y^2} &= 0 \end{aligned}

Similarly for $V = \pi r^2 h$ we have:

$\displaystyle \frac{\partial ^2 V}{\partial r^2} = V_{rr} = 2 \pi h$

$\displaystyle \frac{\partial ^2 V}{\partial r \partial h} = V_{rh} = 2 \pi r$

$\displaystyle \frac{\partial ^2 V}{\partial h \partial r} = V_{hr} = 2 \pi r$

$\displaystyle \frac{\partial ^2 V}{\partial h^2} = V_{hh} = 0$

For commonly encountered functions $f_{xy}$ we have that

$\displaystyle \frac{\partial ^2 f}{\partial x \partial y} = \frac{\partial ^2 f}{\partial y \partial x}$

From here on we may assume that all the mixed derivatives are equal.

Note, the normal rules (sum, product, quotient, function of a function) of differentiation apply to partial differentiation.

## MA101.14 The hyperbolic functions

We define:

$\sinh{x}=\frac{1}{2}(e^x-e^{-x})$

$\cosh{x}=\frac{1}{2}(e^x+e^{-x})$

Note that:

$\sinh{-x}=\frac{1}{2}(e^{-x}-e^x)=-\sinh{x}$ – so an odd function.

$\cosh{-x}=\frac{1}{2}(e^{-x}+e^x)=\cosh{x}$ – so an even function.

Also: $\cosh{x}-\sinh{x}=e^{-x}\rightarrow 0$ as $x \to \infty$.

We also define:

\begin{aligned} \tanh{x}&=\frac{\sinh{x}}{\cosh{x}} \\ \coth{x}&=\frac{\cosh{x}}{\sinh{x}}, x\neq 0 \\ \mbox{sech }x &=\frac{1}{\cosh{x}} \\ \mbox{cosech }x &=\frac{1}{\sinh{x}}, x\neq 0 \end{aligned}

Note:

\begin{aligned} \tanh{x} &= \frac{e^x-e^{-x}}{e^x+e^{-x}} \\&= \frac{1-e^{-2x}}{1+e^{-2x}} \rightarrow 1 \;\mbox{from below as} x\to\infty \\ &= \frac{e^{2x}-1}{e^{2x}+1} \rightarrow -1 \;\mbox{from above as} x\to -\infty \end{aligned}

##### Derivative of sinh and cosh

$\frac{d(\sinh{x}}{dx}=\frac{1}{2}(e^x+e^{-x})=\cosh{x}$

$\frac{d(\cosh{x}}{dx}=\frac{1}{2}(e^x-e^{-x})=\sinh{x}$

Exercise
Find derivatives of tanh, coth, sech,cosech.

##### Inverse functions

sinh is an injection and so we have an inverse function denoted by $\sinh^{-1}{x}$.

Domain $\sinh^{-1}{x}$ = range of $\sinh{x} = \mathbb{R}$
Range $\sinh^{-1}{x}$ = domain of $\sinh{x} = \mathbb{R}$

$\sinh^{-1}{x}$ means the real number whose $\sinh{x}$ is x.

tanh is an injection and so we have an inverse function denoted by $\tanh^{-1}{x}$.

Domain $\tanh^{-1}{x}$ = range of $\tanh{x} = (-1,1)$
Range $\tanh^{-1}{x}$ = domain of $\tanh{x} = \mathbb{R}$

$\tanh^{-1}{x}$ means the real number whose $\tanh{x}$ is x.

Note that $\cosh{x}$ is not an injection, so we need a cut down domain to non-negative x’s ($x \geq 0$) to make it one.

$\cosh^{-1}{x}$ means the non-negative real number whose $\cosh{x}$ is x.

##### Derivatives of the inverse hyperbolic functions

\begin{aligned} y &= \cosh^{-1}{x} \\ x &= \cosh{y} \\ \frac{dx}{dy}&=\sinh{y} \\ \frac{dy}{dx} &= \frac{1}{\sinh{y}} \\ &= \frac{1}{\sqrt{x^1-1}} \end{aligned}

$\mbox{Note: }\forall x: \cosh{^2}{x}-\sinh{^2}{x}=1$.

\begin{aligned} y &= \sinh^{-1}{x} \\ x & = \sinh{y} \\ \frac{dx}{dy} &= \cosh{y} \\ \frac{dy}{dx} &= \frac{1}{\cosh{y}} \\&= \frac{1}{\sqrt{1+x^2}} \end{aligned}

## MA101.12 The exponential functions

We define

$\exp{x} = 1 +x+\frac{x^2}{2!}+\frac{x^3}{3!}+...+\frac{x^n}{n!}+...$ which in fact converges $\forall x \in \mathbb{R}$.

\begin{aligned} \exp{x} \cdot \exp{y} &= (1 +x+\frac{x^2}{2!}+...)(1 +y+\frac{y^2}{2!}+...) \\&= 1 +x+y+\frac{x^2}{2!}+xy+\frac{y^2}{2!}+...+\frac{x^n}{n!}+\frac{x^{n-1}y}{n-1!}+\frac{x^{n-2}y^2}{(n-2)!2!}+...+\frac{y^2}{2!}+... \\&= 1 +(x+y)+\frac{(x+y)^2}{2!}+...+\frac{(x+y)^n}{n!}+... \\&= \exp{(x+y)} \end{aligned}

We have assumed that we can multiply infinite series as if they were finite algebraic expressions. This is not always true, but it is for convergent power series.

The relationship $\exp{x}\cdot\exp{y} = \exp{(x+y)}$ leads us to write $\exp{x}=e^x$ so that $e^x\cdot e^y = e^{x+y}$.

Note, $\exp{1} = e^1 = e = 1+1+\frac{1}{2!}+\frac{1}{3!}+...$

On the assumption that a power series can be differentiated term by term $\frac{d e^x}{dx} = 0 + 1 +\frac{x^2}{2!}+...=e^x$.

##### Properties of exp

The graph of $y=e^x$ is as shown, (with series definition this is not easy to see), but there is some evidence from the property $e^{x_1}\cdot e^{x_2}=e^{x_1+x_2}$

Observe from the graph the properties:

1. $\displaystyle \lim_{x\to\infty}e^x=\infty$.
2. $\displaystyle \lim_{x\to-\infty}e^x=0$.
3. $\forall x, e^x >0$.
4. $e^x$ is continuous everywhere.
5. $D(e^x)=\mathbb{R}$.
6. $e^x$ is an injection (or one to one).
ie. $x_1 \neq x_2 \Rightarrow f(x_1) \neq f(x_2)$.

This means there will be an inverse function. We call it the log function. We have $\log{y}$ equal to the unique x such that $y=e^x$.

$y=e^x$ and $x=\ln{y}$ mean of course the same thing. The graph of $y=\ln{x}$ will be a reflection of $y=e^x$ in the line $y=x$.

Note that the domain of ln = range of exp = $\mathbb{R}^+$.

##### Properties of ln
1. If $y=\ln{x}$ then $x=e^y$, so $\frac{dx}{dy} = e^y$.
Therefore, $\frac{dy}{dx} = \frac{1}{\frac{dx}{dy}} = \frac{1}{e^y} = \frac{1}{x}$.
2. $\ln{x}$ is an injection.
Proof:
Let $\ln{x}=\ln{y}$.
Put $\ln{x}=p$ and $\ln{y}=p$.
So, $e^p=x$ and $e^p=y$.
Whence $x=y$.
3. $\forall x, x=e^{\ln{x}}$.
Proof:
Let $y=e^{ln{x}}$.
Then $\ln{y} = \ln{x}$.
Whence $x=y$ by 2.
So, $x=e^{\ln{x}}$.
4. $\ln{xy}=\ln{x}+\ln{y}$.
Proof:
\begin{aligned} \ln{xy}&=\ln{e^{\ln{x}}\cdot e^{\ln{y}}} \\&= \ln{e^{\ln{x}+\ln{y}}} \\ xy &= e^{ln{x}+\ln{y}} \\ \mbox{Hence}\; \ln{x}+\ln{y} &= \ln{xy} \end{aligned}.
5. $\forall a \in \mathbb{R}^+$
(i) if  m in an integer then $a^m = m\ln{a}$.
(ii) if $\frac{m}{n}$ is in $\mathbb{Q}$, then equally we have $\ln{a\frac{m}{n}}=\frac{m}{n}\ln{a}$. ($a^{\frac{m}{n}} \mbox{ means } \sqrt[n]{a^m}$.
##### Definition

For $a \in \mathbb{R}^+$ and $x \in \mathbb{R}$ we define $a^x = e^{x\ln{a}}$.

For example $3^{\sqrt{2}}=e^{\sqrt{2}\ln{3}}$.

Note that this definition fits in with the usual one when x is rational.

For fixed $a \in \mathbb{R}^+, a^x$ is a function.

Note: $\frac{d(a^x)}{dx} = \frac{d(e^{\ln{a^x}}}{dx} = \frac{d(e^{x\ln{a}})}{dx} = \ln{a(e^{x\ln{a}})} = a^x\ln{a}$.