Consider

In this case, the x term(s) appear in the base, and the exponent is a constant. For this, you use the rule where you subtract one from the exponent and multiply the whole thing by the derivative of the base.

Now consider

In this case, the x term(s) appear in the exponent, and the base is constant. This uses an entirely separate rule. For this, you should copy the expression down (without subtracting 1 from the exponent), and multiply it by the derivative of the exponent, and multiply that by the natural log of the base.

Your friend's answer is correct. Can you figure out how he got it now?