We present nonlinear dynamic equations for nematic and smectic A liquid crystals in the presence of an alternating electric field and explain their derivation in detail. The local electric field acting in any liquid-crystalline system is expressed as a sum of external electric field, the fields originating from feedback of liquid crystal order parameter, and a field, created by charged impurities. The system tends to decrease the total electric field, because it lowers the energy density. This basically nonlinear problem is not a pure academic interest. In the realm of liquid crystals and their applications, utilized nowadays modern experimental techniques have progressed to the point where even small deviations from the linear behavior can be observed and measured with a high accuracy. We follow hydrodynamic approach which is the macroscopic description of condensed matter systems in the low frequency and long wavelength limit. Nonlinear hydrodynamic equations are well established to describe simple fluids. Similar approaches (with degrees of freedom related to the broken orientational or translational symmetry included) have been used also for liquid crystals. However to study behavior of strongly perturbed (well above the thresholds of various electro-hydrodynamic instabilities) liquid crystals, the nonlinear equations should include soft electromagnetic degrees of freedom as well. There are many examples of such instabilities, e.g., classical Carr-Helfrich instability triggered by the competitive electric and viscous torques, flexoelectric instability, and so one. Therefore the self-consistent derivation of the complete set of the nonlinear electro-hydrodynamic equations for liquid crystals became an actual task. The aim of our work is to present these equations, which is a mandatory step to handle any nonlinear phenomenon in liquid crystals.