13
$\begingroup$

Yesterday a student in my calculus class attempted something like this:

Problem statement: Find the derivative of $3^{(5x+1)}$ with respect to $x$.

Proposed solution:

  • Let the inner function be given by $g(x)=3,$ and the outer by $f(z)=z^{(5x+1)}$, so that $$f(g(x))=3^{(5x+1)}.$$
  • $f'(z)=(5x+1)\cdot z^{(5x)}$ and $g'(x)=0$, so by the chain rule, $$\frac{d\left(3^{(5x+1)}\right)}{dx} = f'(g(x))g'(x)=0.$$

I had difficulties explaining what's wrong with this, and basically just told the student "the" right way to do it. Although I now have a rough idea of what's wrong, I'd like to hear from others:

  1. Have you seen similar attempts?
  2. How would you explain to a beginning calculus student what's wrong with this specific solution?
$\endgroup$
2

11 Answers 11

8
$\begingroup$

$$ \frac{d (3^{5x+1})}{dx} = f'(g(x))g'(x)= \frac{d \left(3^{5x+1}\right)}{d(3)} \times \frac{d (3)}{dx}. $$

However $\dfrac{d (3^{5x+1})}{d(3)}$ is undefined.

$\endgroup$
16
  • 3
    $\begingroup$ Hence by definition, any substitution 𝑔(𝑥)=constant will blow up and fail for the same reason. (and that's before we get to the other issue with the substitution which the other answers point out: namely that we didn't really do a substitution, because there are still dangling references to x, as well as z) $\endgroup$
    – smci
    Commented Mar 23, 2019 at 15:05
  • 1
    $\begingroup$ @smci Yes, but this explanation also works in the example of $x^x$, which appears in a very similar question. There a student attempted to use $x$ as inner function (i.e. not a constant). $\endgroup$ Commented Mar 23, 2019 at 15:19
  • 6
    $\begingroup$ This is not a valid explanation. Surely, the the chain rule notation works when $u=g(x)$ is a constant! $\endgroup$
    – user52817
    Commented Mar 23, 2019 at 16:01
  • 2
    $\begingroup$ @MichaelBächtold: It's ironic that you picked the totally wrong explanation on Math Educators SE. If you read a proper rigorous statement of the chain rule, it can be applied only under certain conditions, one of which is that the 'component' derivatives exist... $\endgroup$
    – user21820
    Commented Mar 24, 2019 at 7:50
  • 2
    $\begingroup$ @user21820 You just wrote 1/0 in a mathematical argument and the world didn't implode. But more seriously: Taemyr wrote $d(3^{5x+1})/d3$ in order to point out to the student that it was undefined. I don't understand all the fuzz you are trying to make. $\endgroup$ Commented Mar 26, 2019 at 8:29
30
$\begingroup$

The root of the difficulty is that $x$ appears free in $f(z)$, but we are trying to "capture" it with $g(x)$, which is illegal. When we substitute $g(x)$ into $f(g(x))$, we have a variable clash: $$ f(g(\color{red} x)) = 3^{5\color{blue}x + 1} $$

The red (first) $x$ is a different variable from the blue (second) $x$. This is clearer if we rename the bound variable: $$ f(g(\color{red} y)) = 3^{5\color{blue}x + 1} $$

The original expression had $x$ bound to the $\mathrm d x$, so by unbinding it, we have changed the meaning of the expression: $$ \frac{\mathrm d}{\mathrm d \color{blue} x} f(g(\color{red}y)) \ne \frac{\mathrm d}{\mathrm d \color{red}y} f(g(\color{red}y)) $$

(Incidentally, this is one reason I dislike the notation $f'(x)$, because it hides the variable of differentiation. Students must still be taught it, unfortunately, because Leibniz's notation is verbose in some contexts, but it should only be used as shorthand. Students should understand that it is a shorthand, and that there is still a variable of differentiation, even if it is not shown.)

$\endgroup$
10
  • 2
    $\begingroup$ I like this answer, and agree with it in essence. But to make it precise one needs to be a bit more careful. For instance: the variabel $x$ is not really bound in the equation $h(x)=3^{5x+1}$. It would be bound if we wrote $\forall x\in \mathbb{R}\colon h(x)=3^{5x+1}$, and then one might argue that variable capture happens in the composition. Alternatively we use mathematicians lambda calculus notation $h=(x\mapsto 3^{5x+1})$ and declare that $x$ is bound therein. Also: the matter of whether $dx$ binds $x$ is not so simple as you might think and (cont.) $\endgroup$ Commented Mar 22, 2019 at 8:36
  • 2
    $\begingroup$ (cont.) I don't quite understand what you don't like about $f'$, since in fact it needs to hide the name of the variable, since it is bound in $f$. $\endgroup$ Commented Mar 22, 2019 at 8:38
  • 2
    $\begingroup$ @Michael In common usage, $h(x) = 3^{5x+1}$ really does mean $h = (x\mapsto 3^{5x+1})$ most of the time, doesn’t it? It’s just the same widespread abuse of notation as writing “the function $h(x)$” when you really mean “the function $h$”, only milder. (Alternatively, you could say that it’s a different widespread abuse of notation, omitting universal quantification over apparently-unbound variables.) $\endgroup$ Commented Mar 22, 2019 at 13:42
  • $\begingroup$ @AlexShpilkin I guess you are right. Still, I wouldn't explicitly encourage people to think that $\exp(x)=e^x$ literally means the same as $\exp=(x\mapsto e^x)$, unless we also want them to conclude that $\exp(0)=1$ means the same as $\exp=(0\mapsto 1)$. $\endgroup$ Commented Mar 22, 2019 at 16:34
  • $\begingroup$ @MichaelBächtold: I have no objection to $f'$, and in principle it ought to be OK to write $f'(x)$ if you can write $f'$. But $f'(x)$ is prone to the kind of error that your student made, unless you are also proposing to spend the extra class time to explain the difference between $f$ and $f(x)$ (because by default, your students will have no idea there is a difference). I would not recommend that at the introductory calculus level, however. It will likely shed more heat than light, and possibly leave your students more confused than they were to begin with. $\endgroup$
    – Kevin
    Commented Mar 22, 2019 at 16:43
13
$\begingroup$

f is not a function of (only) z - f here is a function of x as well as z. I think this explanation is intelligible to a calc 1 student, and gets at the heart of the matter.

$\endgroup$
6
  • 2
    $\begingroup$ Hmm, so the student should reply: as soon as $f(x)$ contains parameters other than $x$ I am not allowed to apply the chain rule? $\endgroup$ Commented Mar 21, 2019 at 16:37
  • 3
    $\begingroup$ @MichaelBächtold: The student should know that if f(x) contains variables other than x then the chain rule doesn't apply. (This might be an opportunity to mention that there is a variant of the chain rule to be learned later for covering such situations.) I decline to get into a pedantic discussion of the distinction between f and f(z). $\endgroup$ Commented Mar 21, 2019 at 18:14
  • 1
    $\begingroup$ I'm quite sure you use the chain rule to derive things that contain more than just $x$ in your calculus class, like $\sqrt{x^2+k}$. You might say: that's ok if we treat $k$ as a constant and not as a variable. But then student might then ask: why am I not allowed to treat $x$ as a constant in the definition of $f$? (And a mathematician might add: what's the difference between a variable and a constant?). Apologies if my pedantry offends you. $\endgroup$ Commented Mar 21, 2019 at 18:49
  • 6
    $\begingroup$ @MichaelBächtold: In general, the difference between a variable and a constant is contextual and tricky to make precise, but for purposes of the chain rule in this case, x is a variable because we're taking the derivative with respect to it. I find that students don't usually have difficulty with this point (for instance, one could imagine students getting confused about the difference between the derivative of f(x)=c and f(x)=x, but that's not a particularly common issue), because it's a clean syntactic rule and it's backed up by the notion (x and z are conventionally variables, k isn't). $\endgroup$ Commented Mar 21, 2019 at 19:28
  • 1
    $\begingroup$ @MichaelBächtold: Another way to think of it: In the student's proposed solution, $x$ is a free variable within $f$, but the expression was originally $h(x) = 3^{5x+1}$, i.e. $x$ was originally a bound variable. You can't transform a bound variable into a free variable. $\endgroup$
    – Kevin
    Commented Mar 21, 2019 at 20:59
6
$\begingroup$

This is a VERY VERY typical problem. In fact, it's a problem even for $\frac{d}{dx}3^x$, much less your example.

The way I try to deal with this is one of two ways.

  1. What has to happen first? To evaluate $3^{5x+1}$, you have to evaluate $5x+1$ first. So that is the inside function in the chain rule, just like in $\sin(x^2)$ you have $x^2$ to evaluate first, so it is the inside function.

  2. You could rethink how we notate or talk about exponential functions. In particular, Excel has $e^x$ written as exp(x) (I think as an option). So one can ask what the "input" is here.

However, on the plus side the student does seem to have the chain rule down; it's just the exponential notation that is causing trouble. So there is definitely hope here. And again, you should not be surprised at encountering this, so it is worth your time to come up with several possible responses for it in the long run. Good luck!

$\endgroup$
5
$\begingroup$

The other answers have completely missed the mistake. $ \def\rr{\mathbb{R}} $

Your student's error has nothing to do with exponentiatiation. Consider the following based on exactly the same error:

$\color{red}{\text{Let (???)}}$ $f(y) = x$ and $g(x) = 1$.

Then $1 = \frac{dx}{dx} = (f∘g)'(x) = f'(g(x))·g'(x) = f'(1)·0 = 0$.

The error lies in the very first line! It is extremely obvious once you actually attempt to make it rigorous. Recall that to define a function you must provide a domain as well as a rule that specifies the output for each input in the domain. And of course the rule has to be meaningful in the context where you want to define the function. So see what you get:

$\color{red}{\text{Let (???)}}$ $f : \rr→\rr$ such that $f(y) = x$ for each $y∈\rr$.

Let $g : \rr→\rr$ such that $g(x) = 1$ for every $x∈\rr$.

The definition of $g$ is fine. The definition of $f$ is not fine! What on earth is $x$? The rule has to specify the output for each input $y∈\rr$, so where did $x$ pop up from?

As explained above, the error has nothing to do with differentiation. Rather, it is in the illegal definition of the function!

$\endgroup$
31
  • 1
    $\begingroup$ If it makes you feel better: I admit to my mistakes. (Even if I don't know which ones you mean.) And what I wrote was true sarcasm. $\endgroup$ Commented Mar 24, 2019 at 10:42
  • 1
    $\begingroup$ I upvoted your answer, because it contributes something mathematically to the discussion, even if it completely lacks any tact. I would be curious to know in what sense you think my answer "completely misses the mark": it points out the same error as yours while being slightly more generous to the student (assuming that they were actually defining a function of two variables, rather than just writing something completely meaningless as you suppose). It then shows how the mistake (under this assumption) can be corrected through correct use of the multivariable chain rule. $\endgroup$ Commented Mar 24, 2019 at 14:24
  • 1
    $\begingroup$ @user21820 I can make the accepted answer of Taemyr perfectly rigorous, by interpreting variables like $x,y$ as scalar functions on a manifold and $dx, dy$ as differential forms. I can also make you're answer perfectly rigorous, but if I where your student and you told me "What on earth is $x$? The rule has to specify the output for each input $y\in\mathbb{R}$, so where did $x$ pop up from?" I'd answer $x$ is a real number and $f$ is a map that associates to every input the number $x$. Now, try to explain to me why this is wrong (cont.) $\endgroup$ Commented Mar 24, 2019 at 20:40
  • 2
    $\begingroup$ (cont.) without going into free/bound variables, $\alpha$-conversion and variable capture. That's what Kevin did. Not that I find it wrong to go into this stuff, but I don't think it's so useful for calculus students coming from engineering. Instead, telling them that $3^{5x+1}$ is not a function of $3$ and hence I cannot write $d3^{5x+1}/d3$ seems closer to what they'll need. It's a pity that a hundred years since Frege, logicians have not been able to properly formalise the surrounding notions of variables, constants, and functions of things. $\endgroup$ Commented Mar 24, 2019 at 20:45
  • 2
    $\begingroup$ @MichaelBächtold: I'll respond in chat. This is getting way too long for a comment thread. $\endgroup$
    – user21820
    Commented Mar 25, 2019 at 8:13
4
$\begingroup$

This idea is fine, and you can use the multivariable chain rule to do it this way.

Say we want to differentiate $h(x) = f(x)^{g(x)}$ with respect to $x$. Notice that we can write $h$ as the composite of $p: \mathbb{R} \to \mathbb{R}^2$ defined by $p(t) = (f(t),g(t))$ with the function $E: \mathbb{R}^2 \to \mathbb{R}$ defined by $E(u,v) = u^v$.

By the multivariable chain rule,

$$ \begin{align} Dh\big|_{x} &= DE\big|_{p(x)} \circ Dp\big|_{x}\\ &= \left.\begin{bmatrix} \frac{\partial E}{\partial u} & \frac{\partial E}{\partial v} \end{bmatrix} \right|_{(u,v) = (f(x),g(x))} \circ \left.\begin{bmatrix} \frac{\partial f}{\partial t} \\ \frac{\partial g}{\partial t}\end{bmatrix}\right|_{t = x}\\ &= \left.\begin{bmatrix} vu^{v-1} & \ln(u) u^v \end{bmatrix} \right|_{(u,v) = (f(x),g(x))} \circ \left.\begin{bmatrix} f'(t) \\ g'(t)\end{bmatrix}\right|_{t = x}\\ &= \begin{bmatrix} g(x)(f(x))^{g(x)-1} & \ln(f(x)) (f(x))^{g(x)} \end{bmatrix} \circ \begin{bmatrix} f'(x) \\ g'(x)\end{bmatrix}\\ &=f'(x)g(x)(f(x))^{g(x)-1}+g'(x)\ln(x)f(x)^{g(x)} \end{align} $$

Applying this to the problem in question, we see that $f'(x) =0$, so the first term disappears.

So, in a sense, the student was trying to apply the multivariable chain rule (using the two variables $z$ and $x$), but didn't know how to do that yet. So you could tell them it is a good approach, but they will learn how to properly execute that approach in calc 3.

$\endgroup$
3
$\begingroup$

I had a similar problem with a student last week and could not succinctly explain why she could not select $e$ as the 'inner' function here: $$f(x) = e^{8x +4}$$

The best explanation I have seen thus far, Paul's Notes, explains it in this way:

Recall that the 'outside' function is the last operation that we would perform in an evaluation. In this case if we were to evaluate this function the last operation would be the exponential. Therefore, the outside function is the exponential function and the inside function is its exponent.

$\endgroup$
3
  • $\begingroup$ Because 'e' is a constant? How would you explain it if instead of e, the base were '2'? $\endgroup$ Commented Mar 22, 2019 at 15:27
  • $\begingroup$ Yes this is because 'e' is a constant. Therefore, the explanation would also work when the base is '2'. $\endgroup$ Commented Mar 25, 2019 at 12:09
  • $\begingroup$ Agreed, that was what I was trying to suggest. The f(x) you shared has no ‘inner function’ . $\endgroup$ Commented Mar 25, 2019 at 12:21
2
$\begingroup$

Some users have expressed doubt at the validity of the accepted answer, so let me make it rigorous. To do that, we first need to make sense of the notation $\frac{dy}{dx}$. (Which is not a trivial task.)

We start by changing perspective: instead of thinking of variables $x$ and $y$ as numbers, we think of them as smooth real valued functions on some manifold $M$. So $x\colon M\to \mathbb{R}$ and $y\colon M\to \mathbb{R}$. You might rightly ask: why would we do that and which manifold $M$ are you talking about? The answer to the first question is: because I'd like to talk about the differentials $dy$, $dx$ and say everyday stuff like "$y$ is a constant" or "$y$ is a function of $x$". All of that is impossible inside first order logic + ZFC if we simply interpret $x$ and $y$ as elements of $\mathbb{R}$. Concerning the second question: think of $M$ as the physical state space underlying the problem we are trying to model and $x$ and $y$ as observables. If that sounds too unfamiliar: it's similar to how people in probability theory assume an underlying space of outcomes $\Omega$, in order to talk about random variables. (Which are the things we really care about and historically came before $\Omega$, just like $dx,dy$ historically came before manifolds, but I'm drifting of.)

So, having fixed the background manifold $M$, whenever you hear me say variable, what I mean is a thing of type $M\to \mathbb{R}$.

Definition. Given two variables $x$ and $y$, call $y$ a function of $x$ if $dx$ is not zero almost everywhere and there exists a variable $q\colon M \to \mathbb{R}$ such that $$ dy = q \cdot dx. $$

Intuitively, the equation $ dy = q \cdot dx $ says that the change of $y$ is determined by the change of $x$, i.e. that $y$ depends on $x$.

It's not hard to show that $q$ is uniquely determined by $x$ and $y$, hence we decide to denote it with $\frac{dy}{dx}$ and call it the derivative of $y$ wrt. $x$. It was originally called the differential coefficient, cause that's what it is.

According to this definition, $3^{5x+1}$ is a function of $x$ (assuming $x$ is a true variabel, i.e. $dx\neq 0$), but it's also a function of $5x+1$. On the other hand, $3^{5x+1}$ is not a function of $3$ since $d3=0$ (what we call a constant). In particular $\frac{d3^{5x+1}}{d3}$ is undefined, as user21820 has been pointing out emphatically.

We can now state the chain rule in Leibniz form

Theorem. If $z$ is a function of $y$ and $y$ is a function of $x$, then $z$ is also a function $x$ and their differential coefficients satisfy $$ \frac{dz}{dx}=\frac{dz}{dy}\cdot \frac{dy}{dx} $$

The proof of this is trivial.

From this perspective, what the student in my question was trying to do, was to let $z=3^{5x+1}$ and $y=3$. But the theorem does not apply, since $3^{5x+1}$ is not a function $3$. The same point of view can be used in the example discussed here, where a student attempted to differentiate $x^x$ by taking $x$ as inner function. Although that's allowed it just leads to $$ \frac{dx^x}{dx}=\frac{dx^x}{dx}\cdot \frac{dx}{dx} $$ which is of not much use.

This is not to say that I don't appreciate the other answers (also users 21820). Taemyr's is just one of the three perspectives that haven been proposed. It might seem like it needs a lot of background to make it rigorous. But consider that mathematicians understood this stuff for at least 200 years without requiring manifolds to formalize it. And consider that the other approaches also require quite some background to make them rigorous (like quantifiers, variable bindings, the idea of dummy/bound variables etc. or derivatives of functions of multiple variables). Each has it advantages and disadvantages and none seems more right than the others, methinks.

$\endgroup$
3
  • 1
    $\begingroup$ It seems you are finally agreeing with me that the accepted answer is not completely correct, because it literally wrote an equation involving what your answer states to be ill-defined. That from the beginning was my objection to it (see my first comment). I did not say that anything else was amiss with that answer, except that it fails to pinpoint the original student's error (regarding functions, not differentials). $\endgroup$
    – user21820
    Commented Mar 25, 2019 at 18:34
  • 2
    $\begingroup$ @user21820 You have a strange sense of humor. But thanks for making me laugh. Unfortunately you also made me give up my last hope of leading an honest conversation with you. $\endgroup$ Commented Mar 26, 2019 at 8:33
  • 1
    $\begingroup$ It's your choice, but you've been repeatedly misinterpreting whatever I say, and then blame me for it instead of considering that perhaps you are the one who is wrong. Your last comment insinuates that I am dishonest. That's false. $\endgroup$
    – user21820
    Commented Mar 26, 2019 at 9:05
1
$\begingroup$

Applying the naive approach of a non-mathematician, to me the expression $z^{(5x+1)}$ points to a bivariate function,

$$f(z,x) = z^{(5x+1)}$$

(because "I see two variables in here"), and with $g(x) = 3$ we have defined

$$f(g(x), x) = 3^{(5x+1)}$$

Then

$$\frac {df(g(x),x)}{dx} = \frac {\partial f(g(x),x)}{\partial g(x)}\cdot \frac {dg(x)}{dx} + \frac {\partial f(g(x),x)}{\partial x}\cdot \frac {dx}{dx}$$

$$=\frac {\partial f(g(x),x)}{\partial g(x)}\cdot 0 + \frac {\partial f(g(x),x)}{\partial x}\cdot 1 = \frac {\partial f(g(x),x)}{\partial x} $$

$$=\frac {\partial}{\partial x} \left(3^{(5x+1)}\right) $$

This appears to be correct, although not useful, since we ended up back in the beginning. Am I doing something wrong here?

$\endgroup$
20
  • 1
    $\begingroup$ @user21820: writing "$\left.\frac{\partial f(t,x)}{\partial t}\right|_{t:=g(x)}$" is actually as incorrect as writing "$\frac{\partial f(g(x),x)}{\partial g(x)} $", since the notation $\frac{\partial y}{\partial x}$ doesn't make explicit which variables are to be held constant. Jacobi understood this, but his suggestion for fixing this unfortunately caused even more confusion. I'm sure you understand this, since you gave a good answer here. $\endgroup$ Commented Mar 31, 2019 at 10:04
  • 1
    $\begingroup$ @user21820 I would still consider this wrong, since in practice we want to substitute mathematically equals (and not syntactically equals) for $y$ in $\partial {y}/\partial{x}$. In particular, your suggested use of the notation would either make $\partial {y}/\partial{x}$ undefined, or yield $\partial {y}/\partial{x}=0$ even if we had previously assumed something like $y=x^2$. $\endgroup$ Commented Mar 31, 2019 at 10:58
  • 1
    $\begingroup$ @user21820 Sorry, I don't see where variable shadowing happens in this example. Maybe you can tell me where exactly after I spell it out: "Let $x$ and $y$ be reals and assume $x^2=y$. Then $dy/dx=d(x^2)/dx$..." I wrote "$x^2=y$" instead of $y=x^2$ to emphasise that I don't think of it as variable assignment like most programming languages. I think of it as assuming an equality. Most programming languages would demand something like "$x=3$" before I'm even allowed to write "$y=x^2$". But under such a dogma of "all variables are constants" I see little chance of making sense of $dy/dx$. $\endgroup$ Commented Mar 31, 2019 at 17:08
  • 1
    $\begingroup$ @user21820 I never claimed you said "constant", but I was trying to guess where you might see a problem. You didn't answer where exactly shadowing happens in the sentence I wrote, but that's ok, let's leave it at that. $\endgroup$ Commented Mar 31, 2019 at 17:31
  • 1
    $\begingroup$ @user21820 since I don't know your framework, this discussion seems futile. Write it down somewhere so others can read and judge it. Until then have fun accusing people of making mistakes in your framework. $\endgroup$ Commented Mar 31, 2019 at 17:52
1
$\begingroup$

This answer may not be a lot different from the other answers, but here is how I would phrase it:

When we use the chain rule to compute $\tfrac{d}{dx} f(g(x))$, the dependence on $x$ should only be through the input $g$. In your function, $f(z) = z^{5x+1}$, the function $f$ depends on $x$ not only through $z$, but also through the $5x+1$ in the exponent. It would be clearer to write it as $f(x,z)$, so this issue would be clear. When you use the chain rule, your $g$ should be big enough to include everything that depends on $x$ inside it.

(Optional second paragraph) If you need to compute $\tfrac{d}{dx} f(x,g(x))$, there is a formula for that: $$\frac{d}{dx} f(x,g(x)) = \frac{\partial f}{\partial x} (x,g(x)) +\frac{dg}{dx}(x) \cdot \frac{\partial f}{\partial y} (x,g(x)).$$

$\endgroup$
0
$\begingroup$

In writing $f(z)=z^{5x+1}$, the student is (incorrectly) taking $x$ to be a constant.

Now, given also $g(z)=3$ (for all $z \in \mathbb R$), we have $f(g(z))=f(3)=3^{5x+1}$ (where again $x$ is a constant).

Observe that given a small change in $a$, $f(g(a))$ doesn't change. That is, $(fg)^\prime(a)=0$.

And this is indeed what we get when we apply the Chain Rule:

Since $f^\prime(z)=(5x+1)z^{5x}$ and $g^\prime(z)=0$, we have $$(fg)^\prime(z)=f^\prime(g(z))g^\prime(z)=(5x+1)[g(z)]^{5x}\times0=0.$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.