Complex impedance method for AC circuits