-
Notifications
You must be signed in to change notification settings - Fork 2
/
calculus--e2oc.tex
145 lines (116 loc) · 4.62 KB
/
calculus--e2oc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
\newcommand{\pzpx}{\frac{\partial z}{\partial x}}
\newcommand{\pzpy}{\frac{\partial z}{\partial y}}
\section{3blue1brown - Essence of Calculus}
\subsection{The paradox of the derivative}
\subsection{Derivatives formulas through geometry}
\subsection{Visualizing the chain rule and product rule}
More complex functions can be formed by addition, multiplication and
composition of simpler functions. How do we compute derivatives of such more
complex functions?
\subsection{Sum rule}
Suppose $f(x) = g(x) + h(x)$. Visualize an input parameter $x$ represented by
the x-axis, and the graphs of $g$ and $h$, and a third graph of $f$ whose
height at every point is the sum of the other two.
A horizontal nudge $\dx$ to the input causes vertical changes $\d g(x)$ and
$\d h(x)$. The resulting vertical change to $f(x)$ is
\begin{align*}
\d f(x) = \d g(x) + \d h(x),
\end{align*}
or equivalently
\begin{align*}
\frac{\d f(x)}{\dx} = \frac{\d g(x)}{\dx} + \frac{\d h(x)}{dx}.
\end{align*}
\newpage
\subsection{Product rule}
Suppose $f(x) = g(x) \cdot h(x)$. Consider an input parameter $x$ and visualize a
rectangle with one side length $g(x)$ and the other side length $h(x)$. $f(x)$
is the area of the rectangle.
A nudge $\dx$ to the input causes the sides to grow by $\d g(x)$ and $\d h(x)$
respectively. Therefore the change to the area is approximately
\begin{align*}
\d f(x) = h(x) \d g(x) + g(x) \d h(x),
\end{align*}
or equivalently
\begin{align*}
\frac{\d f(x)}{\dx} = h(x) \frac{\d g(x)}{dx} + g(x) \frac{\d h(x)}{dx}.
\end{align*}
\subsection{Integration by Parts}
TODO: graphical intuition (see wikipedia page)
\newpage
\subsection{Chain rule: function composition}
Suppose $f(x) = g(h(x))$. Visualize 3 real number lines: at the top the input
parameter $x$; in the middle $h(x)$ and at the bottom $g(h)$.
A nudge $\dx$ to the input causes a change $\d h = \frac{\d h}{\dx} \dx$, which in turn causes a
change $\dg = \frac{\dg}{\dh} \dh$. So we have
\begin{align*}
\df = \d g(h(x)) = \frac{\dg}{\dh} \frac{\dh}{\dx} \dx,
\end{align*}
or equivalently
\begin{align*}
\frac{\df}{\dx} = \frac{\d g(h(x))}{\dx} = \frac{\dg}{\dh} \frac{\dh}{\dx}.
\end{align*}
\subsubsection{Example}
$f(x) = \sin(x^2) = g(h(x))$. So the middle number line shows $h(x) = x^2$ and
the output number line at the bottom shows $g(h) = \sin(h)$.
We know that for the outer function, $\dg = \cos h \dh$, and for the inner
function $\dh = 2x \dx$, so
\begin{align*}
\d g(h(x)) = \cos (h) \cdot 2x \dx = \cos(x^2)\cdot 2x \dx.
\end{align*}
\newpage
\subsection{Implicit differentiation}
Consider the circle defined by $x^2 + y^2 = 5$. Here, on the face of it, we
don't have a function with input and an output; we just have a set of points in
2D defined by some condition which they satisfy (an implicit curve).
How do we find the tangent to the circle at the point $(3,4)$? We want $\dydx$.
Consider a related problem. A ladder of length 5 is leaned against a wall, with
initial height 4, and is slipping down at 1 m/s. Define $y(t)$ to be its height
at time $t$, so $\dydt = -1$. What is $\dxdt$?
Clearly the starting point is that $x(t)^2 + y(t)^2 = 5^2$. One solution is\\
\begin{mdframed}
\begin{align*}
x(t) &= \(5^2 - y(t)^2\)^{1/2}\\\\
\dxdt &= \frac{-2y\dydt}{2 \(5^2 - y(t)^2\)^{1/2}} = \frac{y}{x}.
\end{align*}
\end{mdframed}
Another solution is to note that the sum of the squares is constant:\\
\begin{mdframed}
\begin{align*}
\frac{\d \(x(t)^2 + y(t)^2\)}{\dt} &= 0\\\\
2x\dx + 2y\dy &= 0\\
\frac{\dx}{\dt} &= -\frac{y \dy}{x\dt} = \frac{y}{x}.
\end{align*}
\end{mdframed}
~\\
In the case of the ladder problem, it was clear what was going on since we
could differentiate $x(t)^2 + y(t)^2$ with respect to $t$.
Going back to the implicit curve $x^2 + y^2 = 5$, there is in fact a function
there: a function of two variables:
\begin{align*}
z(x, y) = x^2 + y^2
\end{align*}
We want $\dydx$. What is $\dydx$? It's a ratio of two nudges to the two input
variables. OK, but those nudges could be anything; the ratio is not
determined. But we have a condition: the two nudges must stay on a tangent line
to the circle. So,
\begin{align*}
(x + \dx)^2 + (y + \dy)^2 &= 5\\
x^2 + 2x\dx + y^2 + 2y\dy &= 5\\
2x\dx + 2y\dy &= 0\\
\dydx &= -\frac{x}{y}
\end{align*}
The derivative of $z$ in the direction of the vector
$\vec u = \cvecc{\dx}{\dy}$ is
\begin{align*}
\D_u z &= \pzpx \dx + \pzpy \dy\\
&= 2x \dx + 2y \dy.
\end{align*}
And the condition for staying on the tangent to the circle is that $z$ stays
constant:
\begin{align*}
\D_u z &= 2x \dx + 2y \dy = 0\\
\frac{\dy}{\dx} &= \frac{-x}{y}.
\end{align*}
\begin{align*}
y^2\sin x = x
\end{align*}