In this study, novel analytical solutions are presented for predicting and optimizing energy (heat and power) extraction from an idealized single hot-dry rock (HDR) or hot-wet rock (HWR) through a multistage hydraulically fractured horizontal well doublet (MHFWD). The solutions are based on a two-dimensional analytical model that accounts for heat transfer mechanisms through an MHFWD completed in a homogeneous nearly impermeable matrix of the HDR/HWR system. The method of Laplace transformation is used to obtain the solutions. The solutions are inverted numerically and analytically to compute the fracture water outlet temperature and the temperature inside the matrix in the real-time domain. The analytical solutions presented in the study have not been presented elsewhere. The fluid outlet and matrix temperature distributions computed from the analytical model were validated against the results of a commercial simulator. The derived analytical solutions were integrated to convert thermal energy to electric power, and a sensitivity study was performed to investigate the effect of certain parameters, such as fracture height, number, half spacing, injection rate, and injection temperature. In addition, the study provides insights and guidelines to predict, design, and optimize heat recovery and electricity production from an EGS system stimulated by an MHFWD.