Derivative of a Function

Published by DQian2001 in

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 at the point where 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.
  • Assume that b will be a positive integer.
  • m can be any integer, both positive and negative.
  • The return type for this function is an integer.
Watch a quick demo on how Edabit works.