Usually f^2(x)=f(f(x)) means the composition of f by itself.
However, for some special functions, it is much more common that we want to square it than we want to composite it.
For and the trigonometrical functions, that’s the case, so:
sin^2 (x)=(sin(x))^2=sin(x)⋅sin(x)
log^2 (x)=(log(x))^2=log(x)⋅log(x)
But exp²(x)=exp(exp(x))