An alternating voltage E = E0 sin ωt is applied to a circuit containing a resistor R connected in series with a black box. The current in the circuit is found to be I = I0 sin (ωt + \(\frac{\pi}{4}\)).

(i) State whether the element in the black box is a capacitor or inductor.
(ii) Draw the corresponding phasor diagram and find the impedance in terms of R.