In working with Lagrangians, when we write $L = T - V$. Then we use an equation of this sort (considering only one dimension for simplicity):
$$ \dfrac{d}{dt}\left(\dfrac{\partial L}{\partial \dot x}\right) = \dfrac{\partial L}{\partial x} $$
Now, for simplicity, write the Lagrangian of a mass $m$ attached to a spring of constant $k$. So, we have: $L = 0.5m{\dot x}^2 - 0.5kx^2$.
We then write $\dfrac{\partial L}{\partial \dot x} = m\dot x$, taking $\dfrac{\partial (0.5kx^2)}{\partial \dot x} = 0$.
My question is, how is that valid? Isn't it like saying that $x$ and $\dot x$ are independent? But that doesn't make sense intuitively. Velocity can be thought of as a function of the displacement. So, what's going on?
It's just a confusing notation. In one dimension the Lagrangian is a function $L:\mathbb{R}^2\to\mathbb{R}$ (I'm assuming no explicit time dependency for brevity), say $L=L(y,z)$ (or maybe you would only call $L(y,z)\big|_{(y,z)=(x,\dot{x})}$ the Lagrangian, but whatever). Then what $\displaystyle\frac{\partial L}{\partial\dot{x}}$ really means is $\displaystyle \frac{\partial L\,(y,z)}{\partial z}\big|_{(y,z)=(x,\dot{x})}\,.$ So you see we aren't in any way treating $x,\dot{x}$ as independent.