Dynamic theory for the mesoscopic electric circuit