Let and let . Then
- .
So the derivative by the chain rule is
- (Equation 1)
Now, and so
- (Equation 2)
For , we again use the chain rule. Let and so we have that . Using the chain rule, we have that
- (Equation 3)
Notice that and thus
- (Equation 4)
Thus it suffices to find . Guess what we're going to use... the chain rule! Let and . Then, the chain rule states that
- (Equation 5)
Now, and so
- (Equation 6)
Here, the derivative of is actually doable! We have that
and hence by Equations 5 and 6, we have
- (Equation 7)
Combining Equations 1,2,3,4,6 and 7, we have
Phew!