Because the power rule is proved for constant exponents. To differentiate something like, x^(cos(x)), simply use the inverse property of logarithms:
Use chain rule to differentiate.
Another way to use the same idea is if you have , then just take the natural log of both sides and use the fact that if y is a function of x. You can say in general I think that (there's some conditions on that of course). That's the way I liked doing this problems.