Wikipedia credits this to Maxwell. This derivation can be found in Maxwell's Treatise on Electricity and Magnetism vol. 2, part 4, ch. 2 (§§502-527). I went through the derivation and found two self cancelling mistakes made by Maxwell. Those mistakes were corrected by J.J. Thomson in his edition of Maxwell's treatise.
The fact that Maxwell made some mistakes and that the final result is unaffected is itself an indication that someone else before Maxwell originally made that derivation and Maxwell simply took this derivation from someone else (although he doesn't mention in his treatise from where he took this derivation).
So was it really Maxwell who originally made this derivation of general force law equation or was it someone else?
EDIT: (@Geremia)
Ampere derived in 1820s the force between current elements. He made an assumption that it was along the line joining the two elements. A few scientists after Ampere pointed out that current elements have direction as well and hence there is not a solid reason on why force between current elements would be like other forces in nature. In 1845, Hermann Grassmann derived another force law (which is taught today in schools). The force law of Grassmann doesn't obey Newton's third law even in the weak form.
In the year 1873, Maxwell published his treatise. In that treatise, there is a derivation (Vol 2, Article 502-527) of general force law equation. The general force law equation says there can be infinite valid force laws as far as source circuit is closed. The general force law equation is:
$$d^{2}\vec{F}=kII'dsds'\left[\left(\frac {1}{r^{2}}\left({\frac {\partial r}{\partial s}}{\frac {\partial r}{\partial s'}}-2r{\frac {\partial ^{2}r}{\partial s\partial s'}}\right) +r{\frac {\partial ^{2}Q}{\partial s\partial s'}}\right)(\hat{r})-{\frac {\partial Q}{\partial s'}}(\hat{s})+{\frac {\partial Q}{\partial s}}(\hat{s'})\right]$$
where:
$\hat{r}$ is a unit vector pointing from $s$ to $s'$ (field circuit to source circuit)
$Q$ is any function of $r$. But we must be careful while assuming the value of $Q$ because we should give same form for $Q$ in $r$ and $s'$ coordinates.
This general force law equation can be found in article 525 of Maxwell's treatise. Thus I am only asking who originally made this "general force law equation" (and not Ampere's original force law).
Wikipedia call's it Maxwell's 1873 derivation. As explained in my original post, it doesn't seem to me that it was Maxwell who originally wrote it down.
Please tell if it was really Maxwell or someone else?