When to Use the Chain Rule
When one function is inside another, usually brackets with an exponent is a good sign to use it:
How to Apply the Chain Rule
The chain rule is sometimes given the name Outside/Inside Rule, we take the derivative of the outside function and then multiply it by the inside function:
dy/dx = (Outside Derivative)*(Inside Derivative) = 4(5x+2)3 * (5)
In the above case we took the outside derivative, which moved the 4 to the front of the brackets and then multiplied it by the inside derivative, which is the 5.
Chain Rule in Python 3
Import sympy as sym x = sym.Symbol('x') sym.diff((5x+2)**4,x) # Derivative of x
The above will output the solution: 20(5x + 2)**3. Depending on your interpreter you may have to wrap it in a print function to get this.