Can someone explain why absolute is needed in power or energy signal? I know the power signal and energy signal's equation.

$$
P=\displaystyle\lim_{T\to\infty}\frac{1}{T}\int_{-T/2}^{T/2}|x(t)|^2dt
$$

$$
E=\displaystyle\lim_{T\to\infty}\int_{-T/2}^{T/2}|x(t)|^2dt
$$

I am wondering whether $(x(t))^2$, instead of $|x(t)|^2$, is fine or not.

I think $(x(t))^2$ and $|x(t)|^2$ are same, aren't they?

Actually, I'm just guessing because of imaginary number, but I didn't learn or study that part, so I cannot make sure. Please let me understand. Thank you very much for reading my post.
Power and energy are real-valued quantities, so for a complex-valued signal $x(t)$ you need to use $|x(t)|^2$. For real-valued signals, you don't need the magnitude because $x^2(t)=|x(t)|^2$ holds. Note that this equality is not satisfied for general complex-valued signals.