The 1D electric field and heat-conduction equations are solved for a slab where the dielectric properties vary spatially in the sample. Series solutions to the electric field are obtained for systems where the spatial variation in the dielectric properties can be expressed as polynomials. The series solution is used to obtain electric-field distributions for a binary oil-water system where the dielectric properties are assumed to vary linearly within the sample. Using the finite-element method temperature distributions are computed in a three-phase oil, water and rock system where the dielectric properties vary due to the changing oil saturation in the rock. Temperature distributions predicted using a linear variation in the dielectric properties are compared with those obtained using the exact nonlinear variation.