Applying the Chain Rule may be straightforward, but things are a bit different when you are in multiple dimensions and working with real matrix multiplies. If you think about how dot product works, it’s a bit more complicated than just an “elementwise” operation, right?
If you want to understand more about all this, it goes back to the math, which is beyond the scope of this course. Prof Ng has designed this course so that you don’t even need to know univariate calculus in order to use the material. But that means you just have to take his word for it when he gives you a formula.
If you have the math background and want to dig deeper, here is a thread that links to information on the web that covers all this. That thread is linked from the FAQ Thread which may also be worth a look just on general principles.