Electromagnetic induction problem in two- or three-dimensional heterogeneous media needs numerical solutions. In particular, for magnetotelluric problem, we need both horizontal electric and magnetic fields at the surface. If we use finite element method and solve for electric fields, electric field will be obtained with reasonable accuracy, but the magnetic field at the ground surface is estimated using rotation of electric field using a cell below the ground surface. Normally, we use a linear functions as a shape function, which gives an interpolation function within the element. This conventional approach underestimates the magnitude of magnetic field, where derivative is replaced by a finite difference. This problem can be demonstrated using a simple one-dimensional problem, the accuracy of the magnetic field calculation is dependent on the thickness of the first cell under the ground. To overcome this difficulty, usually, we use fine grid cells near the ground surface, which will lead to a large number of unknowns in the finite element solution. We have introduced a new type of shape function which exactly describes the solution within the uniform element cell. Using this shape functions, the magnetic field at the ground surface can be by far more accurately obtained, even with cells with large sizes. We will demonstrate this merit on calculation using two-dimensional resistivity structure for TM mode.