Chain rule is defined as: The composition fog of function f and g is the function whose value f[g(x)] are found for each x in the domain of g for which g(x) is in the domain of f.(f[g(x)]) is read as (f of g of x)

Theorem
if g is differentiable at point x and f is differentiable at point g(x) then composition function fog is differentiable at point x and \left(fog\right)'\left(x\right)=f'\left[g\left(x\right)\right].g'\left(x\right)
Proof:
Let y=\left(fog\right)\left(x\right)=f\left[g\left(x\right)\right]
Then \left(fog\right)'\left(x\right)=\left[f\left[g\left(x\right)\right]\right]'=\frac{dy}{dx}
\frac{dy}{dx}=f'\lbrack g\left(x\right)\rbrack.g'(x).....(1)
Let u=g(x)................(2)
Then y=f(u).............(3)
Differentiating eq(2) and eq(3) w.r.t x and u respectively
We have \frac{du}{dx}=\frac d{dx}\left[g\left(x\right)\right]=g'\left(x\right)
And \frac{dy}{du}=\frac d{du}\left[f\left(u\right)\right]=f'\left(x\right)
Thus eq(1) can be written in the following forms
\frac d{dx}\left[f\left(u\right)\right]=f'\left(u\right)\frac{du}{dx}
\boxed{\frac{dy}{dx}=\frac{dy}{du}.\frac{du}{dx}}
Example 1: [Chain rule of derivatives]
solve by chain rule y=(x^3+1)^9
y=(x^3+1)^9 and u=(x^3+1).
y=u^6
Now \frac{du}{dx}=3x^2\;and\;\frac{dy}{dx}=9u^8 (Power rule)
Now by using chain Rule\frac{dy}{dx}=\;\frac{dy}{du}.\frac{du}{dx}
we have \frac{dy}{dx}=9u^8\frac{du}{dx}
or \frac d{dx}\left(x^3+1\right)^9=9\left(x^3+1\right)^8\left(3x^2\right)
since u=x^3+1 and \frac{du}{dx}=3x^2
\frac d{dx}\left(x^3+1\right)^9=27\left(x^3+1\right)^8
Hence chain Rule is satisfied
Example 2 [Chain rule of derivatives ]
By using chain rule solve the equation
Let y=\left(3x^2-2x+1\right)^6
we takeu=3x^2-2x+7........(1)
Then y=u^6...........(2)
differentiate eq (2) w.r.t u
\frac{dy}{dx}=6u^{6-1}\frac{du}{du}
\frac{dy}{dx}=6u^{6-1}\left(1\right)
\boxed{\frac{dy}{dx}=6u^5}............(A)
differentiate eq (1) w.r.t x
\frac{du}{dx}=\frac d{dx}\left(3x^2-2x+7\right)
\frac{du}{dx}=\frac d{dx}3x^2-\frac{\displaystyle d}{\displaystyle dx}2x+\frac{\displaystyle d}{\displaystyle dx}7
\frac{du}{dx}=3\left(2\right)x-2\left(1\right)+0
\boxed{\frac{du}{dx}=6x-2}.........(B)
Now by using chain rule
\frac{dy}{dx}=\frac{dy}{du}.\frac{du}{dx}
\frac{dy}{dx}=\frac{dy}{du}.\frac{du}{dx}=6u^5.\left(6x-2\right)
\frac{dy}{dx}=6\left(3x^2-2x+7\right)\left(6x-2\right)
\boxed{\frac{dy}{dx}=12\left(3x^2-2x+7\right)\left(3x-1\right)}
Hence chain rule is satisfied.