It all really comes down to HOW the functions are constructed.
Consider the following problem:
A man is 1.5m tall walking towards a street light that is 10m high. The man is walking
at a speed of 2.2m/s. How fast is his shadow shrinking when the man is 10m away from the street light?
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/1bVSi.jpg)
Let y = the length of the man's shadow
First of all let's just sort out everything we know.
His speed is 2.2m/s. This there is a similar triangle property here because all is contained within a triangle with the same angles and thus the ratios of the sides should remain the same.
Therefore, the ratio of the sides of the top triangle is the same as the triangle created behind the man.
$\frac{(10-1.5)}{10} = \frac{1.5}{y}$
$y = \frac{(1.5\times 10)}{8.5}$ (Rearranged)
$y = 1.7647m$ (Solved)
Ok, now let's create a function of $y$ (a generic one). Here is where the interesting part comes. We can create, more than one function to find y here, it just depends on how we think about it.
Well, let's try creating a function of $y$ with respect to the distance walked by the man. Pay attention closely to what I just said... "with respect to the distance walked by the man". Ok, now let's write it down.
Let the distance walked by the man be $x$. So the distance between him and the street light is $10-x$.
Therefore, using the same general equation we used earlier, we get.
$\frac{8.5}{10-x} = \frac{1.5}{y}$
$y = \frac{(1.5)(10-x)}{8.5}$ (rearranged for y)
$y = \frac{15-1.5x}{8.5}$ (simplified)
To find how fast his shadow is shrinking, we need to take the derivative. But wait, here is the big question...
"We take the derivate with respect to what?"
Well, let's think, this function is currently $y$ with respect to $x$, so as $x$ changes, we can find $y$. As for the derivative, we were asked to find how fast the shadow was shrinking, and therefore we need to find speed, which is distance, with respect to time.
So let's take the derivative of this function with respect to time.
$\frac{d}{dt}(y) = \frac{d}{dt}(\frac{15-1.5x}{8.5})$
$\frac{dy}{dt} = \frac{d}{dt} \left ( \frac{ -1.5 (\frac{dx}{dt})}{8.5}\right )$ (it's hard to see, but that is $-1.5(\frac{dx}{dt})$ )
Here we have $\frac{dx}{dt}$. That's alright since we were told that the man was walking at a rate of 2.2m/s which is distance (remember $x$ represented our distance walked) with respect to time.
So we can sub in 2.2m/s for $\frac{dx}{dt}$ and solve for $\frac{dy}{dt}$.
$\frac{dy}{dt} = -0.176471m/s$
Therefore we can find that as time changes, $y$ will slowly be changing at a rate of -0.176471m per every second of time (since we found this using seconds to begin with).
Ok... problem solved... but, wait, there is a second solution to this problem and it only has to do with a different way of looking at the problem. Remember in the beginning how I said that it all has to do with how the functions are constructed, well recall the first function of $y$ we made.
$\frac{8.5}{10-x} = \frac{1.5}{y}$ Where $x$ was the distance the man has walked.
Since we used $x$ in this equation and solved for $y$, then $y$ was with respect to $x$ (distance the man has walked).
Let's try to make a function of $y$ with respect to something else... like time. So let's think about it and from the logic we will write an equation.
"The ratio of the top triangle side over the distance between the man and the lamp post is equal to the height of the man divided by his shadow"
"The distance between the light post is 10 - the distance the man walked, but it is also equal to 10 - the man's speed times the number of seconds that have passed... (10-2.2$t$)"
Thus we can write
$\frac{8.5}{10-2.2t} = \frac{1.5}{y}$
$y = \frac{1.5(10-2.2t)}{8.5}$ (rearranged)
$y = \frac{15 - 3.3t}{8.5}$ (simplified)
Now, we have a function of $y$ that is with respect to time. Let's see what happens when we take the derivative of $y$ with respect to time.
$\frac{d}{dt}(y) = \frac{d}{dt} \left( \frac{15-3.3t}{8.5} \right )$
$\frac{dy}{dt} = \frac{-3.3(\frac{dt}{dt})}{8.5}$ (incase you can't see, that is $-3.3(\frac{dt}{dt})$)
$\frac{dt}{dt} = 1$ since the change of time divided by the change of time is the a constant 1.
Thus, we have the same answer as before...
$\frac{dy}{dt} = \frac{-3.3}{8.5}$ (note: that is $-3.3m/s$)
For me the hardest part about derivatives was understanding how we got something with respect to something else. So, this is how I finally understood the concept, I hope this helps other people looking to understand derivatives.