Use the law of cosines. Let [tex]x[/tex] be the distance between the docks, which forms a third leg of a triangle for which the angle opposite it has measure 45 degrees. The other two legs have lengths 400 ft and 500 ft. So
[tex]x^2=400^2+500^2-2\cdot400\cdot500\cos45^\circ[/tex]
[tex]\implies x\approx356.59\,\mathrm{ft}[/tex]