# The Chain Rule and the Theory

I FOUND THIS ACCOUNT OF THE CHAIN RULE FROM SAM SHAH
https://samjshah.com/2018/02/08/there-might-be-light-at-the-end-of-the-chain-rule-tunnel-maybe/

The partial text is as follows:

Find two points close to each other, like (x,g(f(x)) and (x+0.001,g(f(x+0.001)).
Find the slope between those two points: {g(f(x+0.001)-g(f(x))}/{(x+0.001)-x}.
There we go. An approximation for the derivative! (We can use limits to write the exact expression for the derivative if we want.)

But that doesn’t help us understand that {d/dx}[g(f(x)]=g'(f(x))f'(x) on any level. They seem disconnected!

But I’m on my way there. I’m following things in this way: x >>> f >>> g

Check out this thing I whipped up after school today. The diagram on top does x >>> f and the diagram on the bottom does f >>> g. The diagram on the right does both. It shows how two initial inputs (in this case, 3 and 3.001) change as they go through the functions f and g.
At the very bottom, you see the heart of this.

It has {δg}/{δf} times {δf}/{δx}={δg}/{δx}

(END OF SAM SHAH’S BIT)

Proof of the chain rule.
We can be more exact and use the derivatives, and show that the formula is true for Y = G(F(X)) with F(X) = X N and G(F) = F M
The direct solution for Y’ is the derivative of X MN, that is MNX MN – 1
The formula solution is MF M – 1 times NX N – 1, giving MNX N(M-1) times X N-1
and finally MNX MN – 1

SOME DEFINITIONS:
A function is a process which converts an input into a corresponding output.
In symbols, input –> f –> output

Examples:
The input is transformed (converted) into the output,
usually by a formula or an expression using the values of the input:
output = 2(input) + 5
or you can write this as output = 2 times input + 5

The input and the output are both expressions, which can be
a: a number, or
b: a single variable, x or y or z … , or
c: a more complicated expression

The commonest form for the input-output relationship for a function f
is, as an example, f(x) = 3x + 4, where x is an input
and the corresponding output is 3x + 4
f is the label of the function,
and f(x) is the expression whose value is 3x + 4
f(x) = 3x + 4 is then an equation
The equation can be seen for example as f(8) = 3 x 8 + 4,
or f(y) =3y + 4 using y as the input,
or f(z2 + 5z + 7) = 3(z2 + 5z + 7) + 4 using an expression.

In its most simple formulation the input is not present and the equation is simply f = 3y +4, where the input
is identified as the ‘y’.
Now if an equation has a single variable on the left and an expression on the right then
a) it can be interpreted as a function (functional form) with f(y) = 3y + 4, and
b) the expression on the right can be substituted for the variable on the left.

Example
Let g(A) = A + 2 be a function g with output A + 2
Then it can be identified with the equation g = A + 2
Let g have the input x2 – 4x + 3
Then the output is (x + 2)2 – 4(x + 2)x + 3
which is x2 – 1 (surprise, surprise)