The general expression of the force between two circuits $1$ and $2$ with currents $i_1$ and $i_2$ and with line elements $\bf{dl_1}$ and $\bf{dl_2}$ (infinitesimal vectors pointing in the direction of current) is the following. The force exerted by $1$ on $2$ is :
$$\bf{F_{1,2}}= \mathrm{\frac{\mu_0 i_1 i_2}{4 \pi}} \oint_{1} \oint_{2} \frac{\hat{r_{1,2}} ( \bf{dl_1} \cdot \bf{dl_2})}{\mathrm{r^2_{1,2}}} \tag{1}$$
Where $\hat{r_{1,2}}$ is the unit vector going from $1$ to $2$ and $r_{1,2}$ is the distance between the two points of the circuits considered during integration.
I understand the formula, nevertheless I can't see how to use it to find the force per unit lenght between to parallel infinitly long wires with currents $i_1$ and $i_2$. The force exerted by $1$ on $2$ in that case is:
$$\frac{\bf{F_{1,2}}}{\mathit{l}}= \mathrm{\frac{\mu_0 i_1 i_2}{2 \pi \,\,\mathrm{r_{1,2}}}}\hat{r_{1,2}}\tag{2}$$
It is easy to find $(2)$ in other ways, but I would like to know how to use $(1)$ in this particular case.
There fore the question is: how to use $(1)$ to find $(2)$?
Attempt: here $\bf{dl_1} \cdot \bf{dl_2}= |dl_1|\,\,| dl_2|$ and both $\bf{\hat{r_{1,2}}}$ and $r_{1,2}$ are constant, so it should be just
$$\bf{F_{1,2}}= \mathrm{\frac{\mu_0 i_1 i_2}{4 \pi}} \frac{\hat{r_{1,2}} }{\mathrm{r^2_{1,2}}} \oint_{1} \mathrm{dl_1} \oint_{2} \mathrm{dl_2}= \mathrm{\frac{\mu_0 i_1 i_2}{4 \pi}} \frac{\hat{r_{1,2}} }{\mathrm{r^2_{1,2}}} \mathit{l^2} \tag{3}$$
Assuming that the lenght of the wire (approximated as infinitly long, is $l$). Nevertheless the result in $(3)$ is quite dirrenent from $(2)$ and I don't see where I'm wrong.