← Back to challenges

Derivative of a Function

PythonHardmathnumbers

Instructions

Create a function that takes numbers b and m as arguments and returns the derivative of the function f(x)=x^b with respect to x evaluated at x=m, where b and m are constants.

Examples

derivative(1, 4) ➞ 1

derivative(3, -2) ➞ 12

derivative(4, -3) ➞ -108

Notes

^ in the context of this challenge means "to the power of", also known as the "exponent" operator.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: How Many Rectangles?