We can turn this into a constrained optimization problem. Let's denote x the side of the parking lot that is perpendicular to the highway, and y the side that is parallel to the highway. We therefore need to minimize f(x,y) = 2x + y, where xy = 5000.
From the second relation we see that we can represent y as being 5000 / x. So the problem becomes the unconstrained minimization of f(x) = 2x + 5000/x.
We differentiate f(x) with respect to x and we obtain 2 - 5000/x^2. Setting this to 0 yields 5000/x^2 = 2, so x^2 = 2500.
This equation gives 2 solutions x = 50, and x = -50, but we are only interested in the positive value, because the length of a fence cannot be negative. Knowing that y = 5000/x, we get our final solution: x = 50, y = 100.