Let us take a function $f(x)$ and another function $g(f(x))$. Suppose we are interested in finding $\frac{d(g(f(x)))}{d(f(x))}$. What we high schoolers are taught is suppose $f(x)=u$ and then find $\frac{d(g(u))}{du}$ that is we treat $f(x)$ as a normal independent variable like $x$. But i want to know what actually goes in the inside,why is it justifiable to treat a dependent function $f(x)$ as an independent variable which can take any value it wants. For example, if we wish to figure out $\frac{d(x^2)}{dx}$. We would take a slight nudge $x+dx$ and find the corresponding $(x+dx)^2$ and then calculate. We visualize this derivative via graph as slopes easily since $x$ can take any value on the number line. But what about other functions? For example if $f(x)$ is $\sin x$ and $g(f(x))=\sin^2 x$,we cannot visualize this via graph since we cannot plot $\sin x$ on the $x$ axis as we did in case of $x$ since it cannot take any value it wants. So if we can't visualize such composite functions as slopes,what happens mathematically here? If we think about taking a slight nudge of $\sin x$ by $\sin x+d(\sin x)$ what will $d(\sin x)$ mean in this case as $\sin x$ is dependent on $x$,can we really take however small $d(\sin x)$ as we want? *What would happen in case of other functions which are not continuous?$d(f(x))$ wouldn't be even defined in such a case since the next point of the function isn't anywhere near it. Please enlighten me.
3 Answers
There's a few misconceptions that we need to address before I provide a proof of the chain rule.
First of all, the distinction between "dependent" and "independent" variables is really insubstantial. In your example, $\sin ^2 x$ can be plotted against $\sin x$ and it will look like a parabola. The only difference is that since the sine function is bounded between $-1$ and $1$, the graph will only plot between those two numbers. You will not be able to see the parabola past $1$ or before $-1$. It is the same situation as if you considered an independent variable $u$ bounded between between $-1$ and $1$ and graphed the function $u^2$. The only "actual" difference is that since you're passing through the sine function, as you vary $x$ you will oscillate back and forth on the horizontal axis. If you made a different choice you'd get a different movement, but it would still trace out a parabola on the graph.
Secondly, a function that is not continuous at a point cannot have a derivative at that point. This is because having a derivative implies continuity for functions of one variable. Consider the following: $$ \lim_{h \to 0} \frac{f(x + h) - f(x)}{h} = f'(x).$$ Now consider this gimmicky equality: $$ \lim_{h \to 0} f(x + h) - f(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h} \cdot h. $$ Which means $$ \lim_{h \to 0} f(x + h) - f(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h} \cdot \lim_{h \to 0} h = f'(x) \cdot 0 = 0 $$ or, in other words, we get an equivalent formulation of continuity: $$ \lim_{h \to 0} f(x + h) - f(x) = 0, $$ which is of course equivalent to $$ \lim_{h \to 0} f(x + h) = f(x).$$
Now on to the proof of the chain rule. Consider two differentiable functions $f, g$, and they can be combined as $g(f(x))$ (that is, $f(x)$ is in the domain of $g$ for any $x$). Now: $$ \frac{d}{dx} g(f(x)) = \lim_{h \to 0} \frac{g(f(x+h)) - g(f(x))}{h}.$$ Using the same trick as before we write: $$ \frac{d}{dx} g(f(x)) = \lim_{h \to 0} \frac{g(f(x+h)) - g(f(x))}{h} \cdot \frac{f(x+h)-f(x)}{f(x+h)-f(x)}.$$ We can rewrite this as $$ \frac{d}{dx} g(f(x)) = \lim_{h \to 0} \frac{g(f(x+h)) - g(f(x))}{f(x+h)-f(x)} \cdot \frac{f(x+h)-f(x)}{h}.$$ Now define $k = f(x+h) - f(x)$. Notice that as $h$ goes to zero, $k$ also goes to zero (we proved this earlier with continuity). Now by rearranging the definition of $k$ we get $f(x+h) = f(x) + k$. Therefore: $$ \frac{d}{dx} g(f(x)) = \lim_{h \to 0} \frac{g(f(x)+k) - g(f(x))}{k} \cdot \frac{f(x+h)-f(x)}{h}$$ Then again we split the limits, and we are allowed to change the first limit to a limit in $k$ (we're allowed to change it into whatever we want as long as it's consistent, meaning that as long as $h\to 0$ implies $a \to l$, we're allowed to change the $h$ limit into an $a$ limit): $$ \frac{d}{dx} g(f(x)) = \lim_{k \to 0} \frac{g(f(x)+k) - g(f(x))}{k} \cdot \lim_{h \to 0}\frac{f(x+h)-f(x)}{h},$$ which we recognise as the final form of the chain rule: $$ \frac{d}{dx} g(f(x)) = g'(f(x)) \cdot f'(x)$$
EDIT: Addendum to the proof, as pointed out by FShrike the trick doesn't work if $f$ is constant. However, in that case $g(f(x))$ is also a constant function no matter what $g$ is, therefore its derivative is zero. Since $f'$ is also zero, the equation is still true (plugging everything in we get $0=0$) but it is a special case.
- 1,708
What you have just described hinges on the Chain Rule. I believe a look at the proof of chain rule would help clear most your doubts. It is as follows:
Theorem: Suppose y=f(g(x)), where g(x) is continuous in some domain, D and f continuous at g(x). Then $y'=f'(g(x))g'(x)$.
Proof: Using the difference quotient definition of the derivative: $$\frac{dy}{dx}=\lim_{h\to0}\frac{f(h+x)-f(x)}{h}$$
we have that: $$\frac{dy}{dx}=\lim_{h\to0}\frac{f(g(x+h))-f(g(x))}{h}$$
Let $g(x)=u$ then $g(x+h)=u+k $ *[this is that small "nudge" you mentioned before; notice also the u-substitution that lets me bring the above limit into a form that is tethered to the limit definition of derivative; that is the substitution you normally use in applied problems] so $$\frac{dy}{dx}={\lim}_{k\to0}\frac{f(u+k)-f(u)}{k}\cdot \lim_{h\to0}\frac{k}{h}$$ $$\frac{dy}{dx}=\lim_{k\to0}\frac{f(u+k)-f(u)}{k}\cdot\frac{g(x+h)-g(x)}{h}=f'(u)g'(x)=f'(g(x))g'(x)$$ $ Q.E.D $
- 6,642
- 145
-
1Thanks for replying. Actually my concern was the $k$ you introduced. If the function $g(x)$ is irregular,then the $k$ which is exceedingly small,shouldn't even exist since there is no $g(x')$ that close to $g(x)$. – madness Jul 16 '22 at 05:54
-
1Another question if you don't mind,like we draw the graph of $y=x^2$ vs $x$,is it possible to draw the graph of $y=\sin^2 x$ vs $\sin x$? If yes,could you please show a picture? – madness Jul 16 '22 at 05:55
-
1Welcome F.N. This really isn’t a proof – FShrike Jul 16 '22 at 07:05
-
@madness think of the k introduced as just a means to separate out the two parts in the limit. It is only then do we use the limit to shrink it down. Not BEFORE. As for y=$sin^2x$ vs sin x, your best bet would be to use parametric curves: sin x=t and y=$t^2$ that way you get exactly what you seek. – F.N. Jul 16 '22 at 15:09
$\newcommand{\d}{\mathrm{d}}$The question you raise is an important one - if $f$ doesn’t change at all, is a constant, then this “derivative” isn’t even defined... I think the intuition here should not talk about slope, but about a related rate of change. As you comment, drawing a graph of $g\circ f$ against $f$ would typically be a meaningless task.
We can make this task less meaningless if the graph is to be drawn where $f$ is locally invertible. So, $\sin(x^2)$ against $\sin(x)$ cannot be drawn, but if you restrict to the interval $x\in(-\pi/2,\pi/2)$ we can plot $\sin(\arcsin(u)^2)$ against $u$ on any graphing software, where $u$ is a dummy variable for clarity to represent $\sin(x)$. This makes sense because there is a one-to-one correspondence with $x$ and $\sin x$ here.
You’re also told at school to find it like this: $$\frac{\d g(f(x))}{\d f(x)}=\frac{\d g(f(x))}{\d x}\cdot\frac{1}{\d f(x)/\d x}$$This isn’t defined if $\d f/\d x=0$ at a particular point - this brings us now to the inverse function theorem. This will not be covered in detail in high school, if at all, but it is interesting and can directly address your concerns. If $f$ is continuously differentiable - this covers all the functions you’d be asked to differentiate, probably - (on some “open set” containing $x_0$) and if $f’(x_0)\neq0$, then $f$ is locally invertible at “near” $x_0$ and the image of $f$ (on the original open set containing $x_0$) is “open”. What that means for us here is if you want to consider some “nudge” $f(x_0)+h$, if $h$ is sufficiently small there is then $x’$ (close to $x$) with $f(x’)=f(x_0)+h$, which I believe was one of your concerns. In this case, $\d g(f)/\d f$ will behave as you want it to - but in general, you’re right, this idea comes with problems. The intuition isn’t necessarily the same, and the expression might not be well defined (e.g. $f$ might have a stationary point at $x_0$ and you’d get a division by zero).
- 40,125
-
"If the function doesn't change at all, the derivative isn't even defined" this is quite imprecise, I believe. The derivative of a constant function is well defined, and it is equal to zero. You can show this is the case just by assuming (or showing through the definition) the derivative is linear with respect to scalar multiplication plus the Leibniz rule: take $f$ to be the constant map equal to $1$, you get $f' = (f^2)' = 2 f'f$ which implies $f' = 0$. Then every other constant map can be obtained by multiplying $f$. I don't understand why it should be undefined. – Niki Di Giano Jul 16 '22 at 15:45
-
1@NikiDiGiano Obviously the derivative of a constant function exists and is zero. However, if the denominator function is constant you get, as your difference quotient: $$\frac{g(f(x+h))-g(f(x))}{f(x+h)-f(x)}=\frac{g(f(x))-g(f(x))}{f(x)-f(x)}=\frac{0}{0}=?$$For all $h$. The notion of related rates, through the definition the OP wants to use, is meaningless in that situation – FShrike Jul 16 '22 at 17:29
-
I understand now, and it actually provides a counterexample to the proof I showed that I haven't covered. In the case $f$ is constant, then $g \circ f$ is also constant, so the derivative is still $0$. Thank you! – Niki Di Giano Jul 16 '22 at 17:53