Shape of a string/chain/cable/rope/wire?

The height of a string in a gravitational field in 2-dimensions is bounded by $h(x_0)=h(x_l)=0$ (nails in the wall) and also $\int_0^l ds= l$. ($h(0)=h(l)=0$, if you take $h$ as a function of arc length) .

What shape does it take?

My try so far: minimise potential energy of the whole string, $$J(x,h, \dot{h})=\int_0^l gh(x) \rho \frac{ds}{l}=\frac{g \rho }{l}\int_0^l h(x) \sqrt{1+\dot{h}^2} dx$$

With the constraint $$\int_0^l \sqrt{1+\dot{h}^2} dx- l=0$$ If it helps, it's evident that $\dot{h}(\frac{l}{2})=0$.

Generally, this kind of equation is a case of a constrained variational problem, meaning that the integrand in $$\int_0^l \frac{g \rho }{l}h(x) \sqrt{1+\dot{h}^2} +\lambda(\int_0^l \sqrt{1+\dot{h}^2} dx- l)dx$$

Must satisfy the Euler Lagrange equation. The constraint must also be satisfied.

But, in truth, by this point I am clueless. $\lambda$ is worked through $\nabla J = \lambda \nabla(\int_0^l \sqrt{1+\dot{h}^2} dx- l)$. I have tried this , but get nonsensical answers.

Is this method the best? If so, in what ways am I going about it wrongly thusfar?

-
The shape is a catenary. There must be a thousand derivations out there in Googleland. Just Google for "catenary". – John Rennie Jan 17 '13 at 18:35
It seems like you are on the right track, just apply the Euler Lagrange equations. where are you getting stuck at? Also note that the way you have written the functional, you are considering the string in a region of space where the gravitational field strength is constant (is that what you want?). So when you say 2-dimensions it doesn't really matter, and qualitatively the behavior is the same as in 3-d, and we know what the shape is: a catenary. – nervxxx Jan 17 '13 at 18:37
You don't really need to know what $\lambda$ is, and also you shouldn't be using the arc-length parameterization (you don't know what it is apriori). but the action you have is still ok as long as the integral runs from $x = 0$ to $x = x_l$, not $0$ to $l$. Applying the EL eqns on your action should still give you the equation of the catenary. Here's how it's done: planetmath.org/encyclopedia/… – nervxxx Jan 22 '13 at 18:03