# Chain rule for linear equations (Derivatives)

I am having a hard time understanding why the chain rule works. When going over a theorm, or feature of the maths in general, one starts of with the easiest examples to get to grips with said concept.

So, now I am studying the chain rule for derivatives, where:

$$f(g(x)) = f´(g(x) g´(x).$$

Right then, so the most simple example out there are linear functions, I mean there their own derivatives. Ok, so lets set $f(x)$ and $g(x)$:

$$f(x) = 2x$$

$$g(x) = 3x$$

Well you don't even need the chain rule, it's obviously $6x$, though I wanted to test its legitimacy, so I obtain, via the chain rule, the following:

$$f´(g(x) = 2 (3x) = 6x.$$

$$g'(x) = 3.$$

So $(6x)3 = 18x$. And whilst this IS true, this is not what we get if we take $f(g(x))$, which = $6x$, and if this wasn't a linear equation, then of course, $f(g(x))$ would not be it's own derivative, but since we are, then we know that either

a) I made a mistake, or

b) The chain rule does work.

I doubt it's case (b), I really don't question the validity of the chain rule, as I've seen it applied to non-linear functions, and I am myself have worked with the chain rule for non-linears. However, why is it that in the most simplistic example, the chain rule does not appear to be working? Maybe it's only valid for certain types of functions?

I cannot eliminate the possibility of case (a). That I am wrong, as to be honest it's likely that, but I have taken the liberty of showing that I am capable of applying the chain rule to some non-linear equations: So, hopefully this adds competence to my question, as it seems to work with powers of x greater than one, yet there seems to be some issues when x is linear.

Edit So, because of the (very appreciated) replies given, my main concern now that I cannot see how how f´(g(x)) could equal 2. My understanding was that f´ = 2, and is being multiplied by g(x) = 3x.

As in the f(x) = x^2, g(x) = x^3 example, I was drawing upon the parallel that f´(x) = 2x, as this is just applying the power rule, where x is x^3 (because g(x) = x^3), so this is just 2x^3.

Anyway, from that, I gathered that if f(x) now equals 2x, then ´f(x) = 2, which then is multiplied by g(x) = 3x, to derive 6x.

• $f'(x) = 2$ not $2x$. – user251257 Jul 17 '15 at 10:53
• I know, did I make a mistake? – Jim Jam Jul 17 '15 at 10:56
• you wrote $f'(g(x)) = 2\cdot 3x$, but it is just $2$. – user251257 Jul 17 '15 at 11:05
• If you want to take the viewpoint that the derivative is a linear transformation, then the chain rule says that $D (f \circ g)(x) = Df (g (x))\circ Dg (x)$. However, it's unusual to take this viewpoint in single variable calculus. – littleO Jul 17 '15 at 11:08
• Oh... that would explain why it would be 6x, as 2*3x = 6x. Though.. if g(x) returns 3x, and f´ = 2, isn't it 2*3x? – Jim Jam Jul 17 '15 at 11:09

$f(g(x))$ = $6x$ where $f(x)$ = $2x$ and $g(x)$ = $3x$ then $f'(g(x))$ = 6. Similarly let $3x$ = $u$ in which case $f(g(x))$ = $2(u)$. Following the chain rule: $d/dx$ $f(g(x))$ = $f´(g(x))$ * $g´(x)$ where $f'(g(x))$ = 2 and $g'(x)$ = $u'$ = 3. Thus 2*3 = 6.

Maybe a problem you're encountering is that above $f(x)$ = $x^2$ and $g(x)$ = $x^3$. So $f'(x) = 2x$ and $g'(x)$ = $3x^2$ But $f(g(x))$ = $x^6$ and $f'(g(x)$ = $6x^5$. Similarly $f'(g(x))$ = $2(x^3)*3*x^2$ = 6x^5.

I hope I understood what you were confused about. Hopefully that helped.

• Hello Brianaguirre, thanks very much for your answer. The thing I really don't understand, at least now, is how f´ (g(x)) could equal 2. My understand was that f´ = 2, and is being multiplied by g(x) = 3x. – Jim Jam Jul 17 '15 at 11:31
• @user108262 Did you took a look at my answer? I believe I understand your conceptual problem and I tried to address it by adopting a different notation. It helped me when I was struggling with this very problem. – Lurco Jul 17 '15 at 11:49
• Ah, I see the confusion. Sorry, I should have used another variable to take the place. You're right about f'(x) = 2 and g(x) = 3x. Take a look the composition of f(x) and g(x) such that f(g(x)) = 2*(3x) = 6x, then I think it's clear that f'(g(x)) = 6. But something I probably forgot to mention was that since we are talking about the derivative of a linear function, for any given input the derivative of f'(g(x)) anywhere on the graph of g(x) = 3x will always be 2, no matter what the input is. Thus f'(g(x))*g'(x) = f'(3x)*3 = 2*3 = 6. Does that make sense? – brianaguirre Jul 17 '15 at 12:00
• Yes... I think I see. The thing that did if for me was that you mentioned that d/dx f(g(x)) will always map g(x) accordingly, as well as seeing this visually for myself. So, f(g(x)), where x is 2, is f(g(6)), which is 12, which is 2*6, but in general, TWO x. But man, is that hard to come to terms with. Anyway, thanks very much for your help! You helped give me a little push towards mathematical enlightenment :) – Jim Jam Jul 17 '15 at 12:27

The chain rule works like this: $f'(g(x)) = f'(s)g'(x)$, where the number $s$ is equal to the value of $g$ at point $x$: $s = g(x)$. So $f'(s) = 2$, and subsequently $f'(g(x)) = f'(s) \cdot g'(x) = 2\cdot 3$, as it should without using the chain rule.

A good alternative way to look at the chain rule is through Leibniz notation:

$\frac{df(g(x))}{dx} = \frac{d(f(g(x))}{d g(x)} \cdot \frac{d g(x)}{d x} = \frac{d f(z)}{dz} \cdot \frac{d g(x)}{d x}$

In this notation the chain rule seems trivial. You can actually rigorously prove the chain rule using this approach for $\frac{\Delta f(g(x))}{\Delta x}$ and taking the limit $\Delta x \rightarrow 0$ (so just using the standard definition of the derivative).

• This is exactly the way I think derivatives should be introduced. – user21820 Jul 17 '15 at 11:17