### The Chain Rule

The chain rule is the process of finding the differential coefficient of complex functions, often when the function in question is raised to higher powers.

Before learning the the chain rule, it is important to learn the differential coefficients of some well-known function. They are as follows:

y = sin(x) => dy/dx = cos(x)
y = cos(x) => dy/dx = -sin(x)
y = tan(x) => dy/dx = sec2(x)
y = ex => dy/dx = ex
y = ln(x) => dy/dx = 1/x

The chain rule is revolving around the main significant functions like the above. Why do we need the chain rule in the first place?

Suppose, y = (2x + 3)2
Then, in order to differentiate it, we need to expand the brackets first.
y = 4x2 + 12x + 9
dy/dx = 8x + 12
If, say, y = (2x + 3)7, then we have a problem in expanding this, even if we use the binomial expansion.
This is when the chain rule comes to our aid; instead of expanding, let's let u = 2x + 3
It means, y = u7
Now, dy/du = 7u6
Since, u = 2x + 3 => du/dx = 2
We need dy/dx, though.
dy/dx = dy/du X du/dx
dy/dx = 7u6 X 2
dy/dx = 14u6
dy/dx = 14(2x + 3)6
We can easily find the differential coefficient of a function by this method. This is the chain rule.

E.g.1

If y = sin2(x), find dy/dx.
Let u = sin(x)
It means, y = u2
Now, dy/du = 2u1
Since, u = sin(x) => du/dx = cos(x)
dy/dx = dy/du X du/dx
dy/dx = 2u1 X cos(x)
dy/dx = 2sin(x)cos(x)

E.g.2

If y = cos3(x), find dy/dx.
Let u = cos(x)
It means, y = u3
Now, dy/du = 3u2
Since, u = cos(x) => du/dx = -sin(x)
dy/dx = dy/du X du/dx
dy/dx = 3u2 X (-)sin(x)
dy/dx = -3sin(x)cos2(x)

E.g.3

If y = e3x, find dy/dx.
Let u = 3x
It means, y = eu
Now, dy/du = eu
Since, u = 3x => du/dx = 3
dy/dx = dy/du X du/dx
dy/dx = eu X 3
dy/dx = 3e3x

E.g.4

If y = esin(x), find dy/dx.
Let u = sin(x)
It means, y = eu
Now, dy/du = eu
Since, u = sin(x) => du/dx = cos(x)
dy/dx = dy/du X du/dx
dy/dx = eu X cos(x)
dy/dx = esin(x)cos(x)

E.g.5

If y = (3x - 5)5, find dy/dx.
Let u = (3x - 5)
It means, y = u5
Now, dy/du = 5u4
Since, u = 3x - 5 => du/dx = 3
dy/dx = dy/du X du/dx
dy/dx = 5u4 X 3
dy/dx = 15(3x - 5)4

E.g.6

If y = √(9x + 5), find dy/dx.
Let u = (9x - 5)
It means, y = u1/2
Now, dy/du = 1/2u-1/2
Since, u = 9x + 5 => du/dx = 9
dy/dx = dy/du X du/dx
dy/dx = 1/2u-1/2 X 9
dy/dx = 9/2(9x + 5)-1/2

E.g.7

If y = sin(x2 + 5x - 3), find dy/dx.
Let u = (x2 + 5x - 3)
It means, y = sin(u)
Now, dy/du = cos(u)
Since, u = (x2 + 5x - 3) => du/dx = 2x + 5
dy/dx = dy/du X du/dx
dy/dx = cos(u) X (2x + 5)
dy/dx = cos(x2 + 5x - 3)( 2x + 5)

E.g.8

If y = ln(5x - 3), find dy/dx.
Let u = (5x - 3)
It means, y = ln(u)
Now, dy/du = 1/u
Since, u = (5x - 3) => du/dx = 5
dy/dx = dy/du X du/dx
dy/dx = 1/u X 5
dy/dx = 5/(5x - 3)

E.g.9

If y = tan(7x + 5), find dy/dx.
Let u = (7x + 5)
It means, y = tan(u)
Now, dy/du = sec2(u)
Since, u = (7x + 5) => du/dx = 7
dy/dx = dy/du X du/dx
dy/dx = sec2(u) X 7
dy/dx = 7sec2(7x + 5)

E.g.10

If y = 1/(9x - 5), find dy/dx.
Let u = (9x - 5)
It means, y = 1/u
Now, dy/du = -u-2
Since, u = (9x - 5) => du/dx = 9
dy/dx = dy/du X du/dx
dy/dx = -u-2(u) X 9
dy/dx = -9/(9x - 5)2

#### The Chain Rule - fast track: the Onion Peeling Method

In this method, we mimic peeling off an onion, while applying the chain rule; we start from the outermost layer, and then go inwards one layer at a time, until we can't do it any more.

Suppose y = esin3(3x - 8)
This is not easy to differentiate using extra variables such as u.
Let's use the onion peeling method.
First of all, recognize the layers, starting from the outermost: e => power 3 => sin => cos => 3x - 8
Now, differentiate a layer at a time.
dy/dx = esin3(3x - 8) X 3sin2(3x - 8) X cos(3x - 8) X 3
dy/dx = 9esin3(3x - 8) sin2(3x - 8) cos(3x - 8)

E.g.

If y = 1/(3x - 5), find dy/dx.
y = (3x - 5)-1
dy/dx = -1(3x - 5)-2(3)
dy/dx = -3(3x - 5)-2

In order to master this method, please practise the above examples, 1 to 10, using the Onion Peeling Method.