Problem 6.38 from David Morin (classical mechanics) This problem is from Introduction to Classical Mechanics by David Morin.

This is my solution:

The solution is weird. Is it incorrect?
if yes then can someone give me any hint on how to solve the problem?
thank you.
 A: I would like to propose two different ways to tackle this problem(both give the same result)
Approach I: (does not involve Lagrange formalism)
Let us consider some pointwise body moving in plane. Due to first law of Newton we know that if no force acts on it, this body will keep moving along straight line with constant velocity.  We can summarize this in the following way:
$$\vec{V} = \vec{\text{const}}$$
Now we can change $\vec{V}$ by either changing its direction or its magnitude. First one is done by $a_n$ - normal acceleration, the other one by $a_{\tau}$ - tangent acceleration.
If we have both we will obtain following picture:

note that instant velocity of body is always tangent wrt its trajectory. Also $a_{n}$ is directed along instant radius of curvature. So at any moment we can say that total value of force acting on the body moving along given trajectory is given by:
   $$F_{\text{tot}} = \sqrt{(m\cdot a_{n})^2 + (m\cdot a_{\tau})^2}$$ 
Now for trajectory given by $y = f(x)$ we will use following definitions:
$$a_{\tau} = \dot{V} \equiv \frac{dV}{dt}$$
 $$a_{n} = \frac{V^2}{R} \quad R =\frac{[1+(f'_x)^2]^{3/2}}{f''_{xx}}$$
Once put together we get the answer: 
$$\frac{F^2_{\text{tot}}}{m^2} = \frac{\dot{V}^2 \cdot(1+(f'_x)^2)^3 +V^4 \cdot (f''_{xx})^2}{(1+(f'_x)^2)^3}$$
Approach II:(by means of Lagrange formalism)
The way I propose is straightforward yet quite cumbersome.(There may possibly be more elegant one and I would like to see it myself). 
 I will provide main leads. It is a good exercise to arrive to the final result. 
Lagrange function for a point particle of mass m in the presence  of potential $U(x,y)$ is given by 
 $$L = \frac{m\dot{x}^2}{2}+ \frac{m\dot{y}^2}{2} -U(x,y)$$ 
  Lagrange-Euler equations are given by: 
$$F_x = - \frac{\partial U}{\partial x} = m \ddot{x} \quad F_y = - \frac{\partial U}{\partial y} = m \ddot{y}$$
 $$F_{\text{tot}} = \sqrt{F^2_x + F^2_y}$$
The constraints of our problem are: 
$$ y=f(x) \quad \dot{x}^2 + \dot{y}^2 = V^2 $$
Now we need to rewrite $\ddot{x}$ and  $\ddot{y}$ in terms of  $\text{  } f(x)$ and $V$. There are some hints how to do this:
 $$\dot{y} = f'_x \cdot \dot{x} \quad \ddot{y} = f''_{xx} \cdot (\dot{x})^2 +f'_x \cdot \ddot{x}$$
 Here we used chain rule for function $y = f(x(t))$. If you do everything carefully you should arrive(after considerable amount of work) to the same result as was mentioned above. 
