The product rule is used when two functions of x are multiplied by each other, hence, product. So this can be used to differnetiatate 3x2* x+1 or more complex functions like sinxcosx.
The chain rule is used anytime you see a function inside another function. So in our previous example our two functions were 3x2 and x+1. It would be necessary to use the chain rule if it were 3(x+1)2. This is a function inside a function as the x+1 term has repleced the x term in 3x2. As this is only a sqaured turn, using binomial expansion one could expand the brackets getting 3x2 + 6x + 1 and then differentiate, but using the chain rule is much quicker and avoids misktakes, especally when dealing with bigger indicies.