\myheading{What is derivative?}

\leveldown{}

\renewcommand{\CURPATH}{calculus/derivative}

\myheading{Square}

You draw two squares, one has side=10 (units), another has side=11, and can you compare their areas?

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= square10 = Tuples[Range[0, 10], 2];

In[]:= square11 = Tuples[Range[0, 11], 2];

In[]:= new = Complement[square11, square10];

In[]:= ListPlot[{square11, new}, PlotStyle -> Evaluate[{PointSize[0.04], #} & /@ {Blue, Red}]]
\end{lstlisting}

\begin{figure}[H]
\centering
\frame{\includegraphics[scale=0.7]{\CURPATH/square.png}}
\end{figure}

Red dots are the dots been \emph{added} during growth of the square from 10 to 11.
There are ~2x of them (or ~22 if x=11), and this is exactly the first derivative of $x^2$:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= D[x^2, x]
Out[]= 2x
\end{lstlisting}

Now to get amount of \emph{new dots} that will be \emph{added} if the square growed from 100 to 101, you just calculate $2 \cdot 101-1$.

\myheading{Cube}

Now let's see what's with cube.

When it grows, 3 \emph{planes} are added at 3 sides after each \emph{iteration}.
Each plane is essentially a square with side of x.
Hence, $\approx 3x^2$ "dots" are "added" at each iteration.

And this is indeed the derivative of $x^3$:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= D[x^3, x]
Out[]= 3*x^2
\end{lstlisting}

And what is with tesseract?
4 3D-cubes are \emph{added} at each \emph{iteration}:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= D[x^4, x]
Out[]= 4*x^3
\end{lstlisting}

\myheading{Line}

What if your figurine is just a one-dimensional line?
It grows by 1 at each iteration:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= D[x, x]
Out[]= 1
\end{lstlisting}

\myheading{Circle}

Here I'm generating dots inside of two circles, using Pythagorean theorem.
There are circles we have with r=15 and r=16:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= coords = Tuples[Range[-20, 20], 2];

In[]:= incircle15[coord_] := Abs[coord[[1]]]^2 + Abs[coord[[2]]]^2 <= 15^2

In[]:= circle15 = Select[coords, incircle15];

In[]:= incircle16[coord_] := Abs[coord[[1]]]^2 + Abs[coord[[2]]]^2 <= 16^2

In[]:= circle16 = Select[coords, incircle16];
\end{lstlisting}

How many dots are added when a circle grows from r=15 to r=16?

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= new = Complement[circle16, circle15];

In[]:= Length[circle15]
Out[]= 709

In[]:= Length[new]
Out[]= 88

In[]:= ListPlot[{circle15, new}, AspectRatio -> 1, 
 PlotStyle -> Evaluate[{PointSize[0.02], #} & /@ {Blue, Red}]]
\end{lstlisting}

\begin{figure}[H]
\centering
\frame{\includegraphics[scale=0.7]{\CURPATH/circle.png}}
\end{figure}

You see, these new dots are like circle circumference in fact.

Indeed, the first derivative of the circle area function is actually its circumference:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= D[Pi*r^2, r]
Out[]= 2*Pi*r
\end{lstlisting}

Let's check:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= Pi*15^2 // N
Out[]= 706.858

In[]:= 2*Pi*15 // N
Out[]= 94.2478
\end{lstlisting}

Almost equal to amount of dots we generated.

\myheading{Cylinder}

Cylinder is easy.
You can say that at each iteration, a new circle is just added at top (or bottom) of it.
Indeed, the derivative of cylinder's volume function is just an area of circle with the same radius:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= D[Pi*r^2*h, h]
Out[]= Pi * r^2
\end{lstlisting}

\myheading{Sphere}

When a 3D-sphere grows, you can say that 4 disks with the \emph{new} radius are added into it:

\begin{lstlisting}[caption=Wolfram Mathematica]
In[]:= D[4/3 (Pi*r^3), r]
Out[]= 4 * Pi * r^2
\end{lstlisting}

I can show this graphically.
Imagine you have a ball and you want to make it bigger.
Naive approach is to cut it using knife in 3 planes and insert 3 disks (with the \emph{new} radius) in between, like:

\begin{figure}[H]
\centering
\frame{\includegraphics[scale=0.7]{\CURPATH/sphere.png}}
\end{figure}

( I got this screenshot from this 
\href{https://www.wolframcloud.com/objects/demonstrations/MultiplePlanesThroughSurfaces}{demonstration} )

But each disk must have thickness of 4/3 of one \emph{unit}.
Because $\frac{4}{3}3=4$.

Sure, new \emph{dots} when added during \emph{growth} are distributed across the whole sphere,
but most of them can be placed into these \emph{new} 3 planes.

\myheading{Conclusion}

In other words, derivative is a function that can determine what is added to a function's result,
when its input gets incremented by 1.

\levelup{}

