# How do we input powers of indexed variables?

I have tried

(a[i])^2


and alternatively

(a^2)[i]


Apparently both seem to work, but I was wondering what was the right way to do it? This might sound like a silly question (apologies if it is). But I am doing some tedious calculations and I don't want a silly mistake to carry forward.

• With a[i] = 2 compare what (a[i])^2 evaluates versus what (a^2)[i] evaluates. Oct 8 '17 at 18:38
The universal answer for such kind of questions is to compare FullForms of the expessions. You will see their actual internal structure in a readable and (usually) easy-to-interpret form.