  Some extrasolar giant planets in close orbits---"hot Jupiters"---exhibit
larger radii than that of a passively cooling planet. The extreme irradiation
$L_{\rm eq}$ these hot Jupiters receive from their close in stars creates a
thick isothermal layer in their envelopes, which slows down their convective
cooling, allowing them to retain their inflated size for longer. This is yet
insufficient to explain the observed sizes of the most inflated planets. Some
models invoke an additional power source, deposited deep in the planet's
envelope. Here we present an analytical model for the cooling of such
irradiated, and internally heated gas giants. We show that a power source
$L_{\rm dep}$, deposited at an optical depth $\tau_{\rm dep}$, creates an
exterior convective region, between optical depths $L_{\rm eq}/L_{\rm dep}$ and
$\tau_{\rm dep}$, beyond which a thicker isothermal layer exists, which in
extreme cases may extend to the center of the planet. This convective layer,
which occurs only for $L_{\rm dep}\tau_{\rm dep}>L_{\rm eq}$, further delays
the cooling of the planet. Such a planet is equivalent to a planet irradiated
with $L_{\rm eq}\left(1+L_{\rm dep}\tau_{\rm dep}/L_{\rm eq}\right)^\beta$,
where $\beta\approx 0.35$ is an effective power-law index describing the
radiative energy density as function of the optical depth for a convective
planet $U\propto\tau^\beta$. Our simple analytical model reproduces the main
trends found in previous numerical works, and provides an intuitive
understanding. We derive scaling laws for the cooling rate of the planet, its
central temperature, and radius. These scaling laws can be used to estimate the
effects of tidal or Ohmic dissipation, wind shocks, or any other mechanism
involving energy deposition, on sizes of hot Jupiters.
