AC Source Connected to a Resistor
When a resistor is connected in an ac circuit, the instantaneous value of the current is given by the instantaneous value of the potential difference across the resistor divided by the resistance.

V = Vm cos ωt
I = V/R
I = (Vm cos ωt)/R
The quantity Vm/R has units of volt per ohm (ampere). It represents the maximum value of the current in the circuit. The current changes direction with time, and positive and negative values of the current represent the two possible current directions.
Im = Vm/R
I = Im cos ωt
The potential difference and current are in phase. The peaks and valleys occur at the same time.
Average Power
The average power (I2R) developed in the resistor is not zero, because square of instantaneous value of current is always positive.
Pav = Irms2R
Irms = Im/√2 = 0.707 Im