The chain rule is used to find the derivative of an expression in the form h(f(x)) where you have a function in terms of a function of x for example:
h(f(x)) = 2(3x+1)^3 where f(x) = 3x+1
In order to use the chain rule we first differentiate h(f(x)) with respect to f(x), in our example this gives 6(3x+1)^2. We then multiply this by the derivative of f(x) with respect to x. This gives a final derivative of 3*6(3x+1)^2.