Right. The exponent only applies to the thing immediately preceding it. That's either a variable, or a function, or something in parentheses. Remember PEMDAS?
So, for the expression
which is, incidentally, incorrect, your problem is that you didn't to the operations in the correct order. You need to do the parentheses first, then the exponentiation, yielding