Solution (source code)

= Solution

The <electromagnetic four-potential> is the field generated by the four-current $J^\mu$: every source volume element contributes with the inverse-distance Green-function factor. Electromagnetic influence propagates at speed $c$, so <causality> requires the source to be evaluated where its worldline intersects the field event's past light cone. Thus
$$
\boxed{
A^\mu(x,t)=\frac{\mu_0}{4\pi}
\int_{\mathbb R^3}
\frac{J^\mu(x',\,t-|x-x'|/c)}
{|x-x'|}\,d^3x'.}
$$
The source time is exactly the <retarded time> $t_{\rm ret}=t-|x-x'|/c$, rather than the observation time $t$.