Show worked solution
Worked solution
Write the function and spot the composition
There is a function inside another function, so the chain rule applies.
Substitute for the inner function
Let u be the inside; then y is a simple function of u.
State the chain rule
Differentiate the outer function, then multiply by the derivative of the inner function.
Differentiate the outer function
Differentiate y with respect to u.
Differentiate the inner function
Differentiate u with respect to x.
Apply the chain rule
Multiply the two derivatives and replace u by the inner function.
Simplify the derivative
Tidy the result into its simplest form.
Compare the result with the given options
Eliminate the options that do not match.
Evaluate the gradient at x=1 as a check
Substituting a value gives a quick numerical sanity check.
Evaluate the gradient at x=2 as a check
Substituting a value gives a quick numerical sanity check.
Evaluate the gradient at x=3 as a check
Substituting a value gives a quick numerical sanity check.
Evaluate the gradient at x=4 as a check
Substituting a value gives a quick numerical sanity check.
Evaluate the gradient at x=5 as a check
Substituting a value gives a quick numerical sanity check.
Evaluate the gradient at x=-1 as a check
Substituting a value gives a quick numerical sanity check.
Select the correct derivative
This matches the first option.