How to calculate retarded potential (for magnetic field calculation) for a group of current carrying loops where the magnitude of current is changing? For constant current, the magnetic field seems to be easy to calculate because of Biot-Savart Law. For a loop having varying magnitude of current (simplifying an electromagnet), however, it seems that you need to figure out retarded potentials from the current density vector and then the fields from the retarded potentials. Am I wrong in saying this? If incorrect, what should I do instead?
If I'm correct, I would like to know how to define parts of the integral $$\mathbf{A}(\mathbf{r},t) = \frac{\mu}{4\pi}\int{\frac{\mathbf{J}(\mathbf{r},t)}{\mathbf{r'}}}d\tau,$$ i.e. vector potential formula used for non-static sources, for a loop carrying a sine dependent current (simplifying the electromagnet, and assuming that each loop is infinitely thin). These are the problems I'm getting:

*

*The current density vector is: $$\mathbf{\vec{J}} = I_o \sin{(2\pi ft)}(R \cos{(2\pi f_2t)} \hat i +R\sin{(2\pi f_2t)}\hat j +f_2t \hat k)$$ having magnitude of $I_o\sin{(2\pi ft)}$ where f is dependent on input current. f2 here depends on the drift velocity of electrons in the conductor. Since I'm defining a magnitude and a direction for the vector, it makes sense right? Should I not have a time dependent position vector for J? Component of z axis represents completion of one loop at time period of flow.

*How do I define the τ that is supposed to represent the length of the loop? My first response was a simple repetition of $R \cos{\theta}\hat i + R \sin{\theta}\hat j$. But something does not seem right. I will have squared R in my answer, and the complete expression looks a little strange to me.

*I still have not touched upon the effect on expression due to retarded time. That is because I do not know what kind of effect it has in this case, since in each loop, all loop elements are at the same distance from the point of calculation. Some clarification would be helpful.

As I am writing this down, I think this looks like a complete mess. I am essentially alone in learning and solving problems such as these, due to various circumstances. Hence, any knowledgeable help to solve the problems I mentioned will be greatly appreciated.
Note:
As a reminder, my goal is to find an expression of vector potential that will be used to figure magnetic (and induced electric) field of an electromagnet due to a sine current flowing through its conductors. I am simplifying it to a group of loops for ease of calculation.
 A: This answer is for a single loop due to symetry making it easier.
Define my variables , due to foresight , I'm going to use spherical polar coordinates.
$R = rsin(\theta)sin(\phi) \hat i + sin(\theta)cos(\phi) \hat j +rcos(\theta) \hat k $
For a current loop in the xy plane.
$r'= kcos(\theta) \hat I + ksin(\theta) \hat j$
Where theta goes from 0 to 2$\pi$
K is radius of my loop
here I have modelled my loop as an infinitely thin wire, Thus using the modified version of the retarded potential where
$J(r', t_{r}) dv =  I(r',t_{r}) dl$
Where dl is the differential displacement vector of r'
and "I" is scalar current
For your Magnetic vector potential you have simply put r'
this can get confusing so I'd stick with the variables
|r-r'| Where this is the absolute magnitude of the distance between r and r'
Now onto your main question
$J(r',t)$ is for magnetostatics,$ J(r',t_{r})$ is electrodynamics
Changing this to be a scalar current$ I(r',t_{r})$
The scalar current in an oscillating wire$ I(r',t)$
Would be$ I_{0} sin(\omega t)$
The retarded version of this, is replacing T with$ t_{r}$
$T_{r}= t - \frac{|r-r'|}{c}$
what does the retarded time physically mean? the retarded time like the name suggests  is evaluating the current density in the past  by the amount of time it would take light to reach that point .  |r-r'|/c is the amount of time it would take light to travel from r' to r, so let's say something is 1 light second away from the source r',when t = 1, the retarded time would be 0  meaning contributions to A would be from the current evaluated at time 0
replacing t with the retarded time
$I_{0} sin(\omega ( t - \frac{|r-r'|}{c}))$
This seems deceptively easy, but it's not that simple.
There is also a restriction on the retarded time being greater than 0 as obviously I cannot add the contributions to Current density evaluatesd in negative time. so when the retarded time is negative. that contribution is defined to be zero.
which is why almost any problem you see on this would be "evaluating the field at then center of the ring" as each contribution is the same distance away  so you can simply do a quick and easy domain restriction that applies to all contributions.
If your source is different distances away from the point r, then each contribution has a different domain restriction and it gets quite complicated.( I can't do this yet)
