Spoiler
Form the wire (of length L and resistance R) into a closed loop. If the sliding contact is at a distance d from the fixed contact, the resistance will be the equivalent parallel resistance from segments of length d and L-d, which should be:
R_eff = [R(d/L)*R((L-d)/L)]/[R(d/L)+R((L-d)/L)] = Rd(L-d)/(L^2),
and as d increases from 0, d(L-d) increases smoothly from 0 till d=L/2 (where R_eff is at its maximal value of R/4) and decreases smoothly to 0 after that (this part maps onto the common puzzle of maximizing the area of a rectangle of given perimeter, but if you don't like that, then the first derivative is L-2d, and the second is -2).