Remark: This is not a homework question...It is pure out of theoretical interest. I asked this the mathematics-community a couple days ago and got no answer, so I figured I'd try here.
Most standard physics textbooks compute the force two infinite wires exert on each other, but they remain silent about the case where the wires are finite. Let's say we have two parallel wires carrying a current of equal magnitude in the same direction, both of which have a length $d$ and also seperated by a distance $d$. I now want to find out the force one wire exerts on another, using the Biot-Savart Law.
Let the left wire be positioned at the origin of the $xy$-plane, going along the $y$-axis, and let the other wire be a distance $d$ to the right. We assume the currents are flowing in the positive $y$-direction. Then we first choose a source element (on the left wire) of infinitesimal length $dy$ described by the position vector $\mathbf{r_0} = y_0 \hat{j}$. This constitutes a current source of $I d\vec{l} = (Idy) \hat{j}$.
We then pick an arbitrary field point $P$ on the other wire with position vector $\mathbf{r_p} = x\hat{i} + y \hat{j}$. Then the position vector $\mathbf{r}$ pointing from the source point to the field point is given as \begin{align*} \mathbf{r} = \mathbf{r_p} - \mathbf{r_0} = x\hat{i} + (y - y_0) \hat{j}, \end{align*} with $\sqrt{x^2 + (y-y_0)^2}$ being the length of this vector. If we now calculate the crossproduct $d\vec{l} \times \mathbf{r}$, we can write it as \begin{align*} dy \hat{j} \times (x\hat{i} + (y - y_0)\hat{j}) = -dy x \hat{k} \end{align*} Now comes the tricky part. I think I need to setup a double integral, because we are working with infinitesimal force elements $d\mathbf{F}$, each which is given as $d\mathbf{F} = I d\vec{l} \times \mathbf{B}$. But we also have that \begin{align*} d\mathbf{B} = \frac{\mu_0 I}{4 \pi} \frac{d \vec{l} \times \hat{r}}{r^2} = \frac{\mu_0 I}{4 \pi} \frac{d \vec{l} \times \mathbf{r}}{r^3} = -\frac{\mu_0 I}{4 \pi} \frac{dyx}{\sqrt{x^2 + (y-y_0)^2}} \hat{k} \end{align*} Hence I need to somehow integrate over $d\mathbf{F}$ and $d\mathbf{B}$. Does anyone have an idea how to do this?