Analysis of apparent resistivity in a multi-layer earth structure