this might be the right place to ask: can you differentiate a recursively defined function?
pow x 0 = 1
pow x n = x * pow x (n-1)
ergo
pow' x 0 = 0
pow' x n = pow x (n-1) + x * pow' x (n-1)
ergo
pow' x 1 = pow x 0 + x * pow' x 0
= 1 + x * 0
= 1
pow' x 2 = pow x 1 + x * pow' x 1
= x + x
= 2 * x
pow' x 3 = pow x 2 + x * pow' x 2
= x * x + 2 * x * x
= 3 * x * x