I've becomes a bit confused with the average power formulas. These formulas can be found on Wikipedia here and here. Let's suppose V(t) = 1V (DC) and we have a square wave for the current that switches from -1A to 1A. If I look at the first equation, I'd get that \$P_\mathrm{ave}=0\$W because the average value of a square wave is 0; however, if I look at the second equation, I'd find that \$P_\mathrm{ave}=1\$W because the RMS voltage is 1V and the RMS current is 1A.
I don't understand which equation is correct. They seem to be calculating different averages. If someone asks for the average power, which do they mean? What am I missing?
$$ P_\mathrm{ave} = \frac{1}{T_2 - T_1} \int_{T_1}^{T_2} V(t) I(t) \, \mathrm{d}t $$ $$ P_\mathrm{ave} = V_\mathrm{rms} I_\mathrm{rms} = \sqrt{\frac{1}{T_2 - T_1} \int_{T_1}^{T_2} V^2(t) \, \mathrm{d}t} \sqrt{\frac{1}{T_2 - T_1} \int_{T_1}^{T_2} I^2(t) \, \mathrm{d}t} $$