How do I derive the Lorenz gauge from the continuity equation? I was reading my old electromagnetics book (Elements of Electromagnetics, by Sadiku, 3rd edition) and after the author explained what the Lorenz gauge is mathematically and why it is useful in decoupling the scalar electrical potential from the vector magnetic potential to produce the wave equations, the author made a side comment below eq. (9.52) that the Lorenz gauge $$\nabla \cdot \vec A = -\mu\varepsilon  \dfrac{\partial V}{\partial t}$$ can be derived from the continuity equation.
I don't have a background in relativity. I am an electrical engineering student. So given these limitations, how would I go about deriving the Lorenz gauge from the continuity equation?
Note: I am sticking to the conventions of my book in writing equations.
 A: We are for simplicity going to use the special relativistic formulation of E&M. Hopefully OP can still understand enough to extract an answer to his question. 
Assume (-,+,+,+) signature and assume for simplicity units where $c=\varepsilon_0=\mu_0=1$. The continuity equation 
$$\tag{1} \partial_{\mu} j^{\mu}~=~0$$
is a consequence of Maxwell's equations 
$$ \tag{2} \partial_{\mu} F^{\mu\nu}~=~j^{\nu}$$
with sources $j^{\mu}=(\rho,\vec{J})$. The existence of a $4$-gauge potential $A^{\mu}=(V,\vec{A})$ renders the source-free Maxwell equations trivial.
The Lorenz gauge-fixing condition 
$$\tag{3}  \partial_{\mu} A^{\mu}~=~0$$
(or any other gauge-fixing condition: Coulomb, axial, temporal, etc, for that matter) can not be derived from Maxwell's equations or its consequences. The whole point of a gauge-fixing condition is to (at least partially) fix the gauge ambiguity 
$$\tag{4} A_{\mu}~\longrightarrow ~ A_{\mu}+\partial_{\mu}\Lambda.$$ 
Ref. 1 claims below eq. (9.52) that the Lorenz gauge-fixing condition (9.50) follows from the continuity eq. (1):  

[...] It can be shown that the Lorentz$^1$ condition can be obtained from the continuity equation; therefore, our choice of eq. (9.50) is not arbitrary. [...]

Ref. 1 uses the retarded $4$-potential 
$$\tag{5} A^{\mu}(\vec{x},t)~=~\iiint_V \frac{d^3y}{4\pi} \frac{j^{\mu}(\vec{y},t-R)}{R}, \qquad R~:=~|\vec{x}-\vec{y}|,
$$
for the gauge potential $A^{\mu}$, see Ref. 1 eqs. (9.53-55). Indeed, the Lorenz gauge-fixing condition (3) follows from the retarded formula (5) and the continuity eq. (1) via integration by part. In fact, Maxwell equations [in Lorenz gauge and with sources, aka. wave equations with sources, see Ref. 1 eqs. (9.51-52)]
$$\tag{6} \Box A^{\mu}~=~j^{\mu} , \qquad \Box ~:=~\partial_{\mu}\partial^{\mu}~=~ \partial^2_t - \Delta, \qquad \Delta ~:=~\vec{\nabla} \cdot\vec{\nabla},$$
follows from the retarded formula (5).
What Ref. 1 fails to state is, that the retarded formula (5) is itself a gauge-fixing choice, although admittedly a very natural choice.  
References: 


*

*M.N.O. Sadiku, Elements of Electromagnetics, 2009.


--
$^1$ Ref. 1 wrongly spells Lorenz with a "t", cf. the Wikipedia page.
