In Analytic Mechanics, the Lagrangian is taken to be a function of $x$ and $\dot{x}$, where $x$ stands for position and is a function of time and $\dot{x}$ is its derivative wrt time.
To set my question, lets consider motion of a particle along a line:
$$x: \mathbb{R} \to \mathbb{R} ~~as~~ t \mapsto x(t)$$
and take the Lagrangian to be:
$$L(x, \dot{x}) := \frac{1}{2}m\dot{x}^2 - V(x)$$
By applying the Euler-Lagrange equations:
$$ \frac{d}{dt}\left(\frac{\partial{L}}{\partial\dot{x}}\right) = \frac{\partial{L}}{\partial x}$$
we get back Newton's law of motion.
This follows formally where we consider $x$ and $\dot{x}$ as independent, but if we consider $\dot{x}$ as velocity, then it is indeed a function of position so when we partially differentiate $L$ wrt $x$ the $\dot{x}$-terms shouldn't vanish and this messes up the derivation. What am I misunderstanding?
edit
I am beginning to think that this is a non-question as some people seem to have suggested and I am being confused by the hand-wavy math in basic physics textbooks.
In the above example, let just consider $C$ to be the configuration space of the particle. Locally $C$ is given by the co-ordinate function $x: U \to \mathbb{R}$, the tangent bundle $\pi: TC \to C$ being locally trivial has as co-ordinate functions above $U$: $(x\circ \pi) \oplus dx: TU \to \mathbb{R^2}$.
We take the Lagrangian to be simply a functional: $TC \to \mathbb{R}$, which when written locally is in terms of $x$ and $\frac{\partial}{\partial x}$.
But, what about the dot in $\dot{x}$?
Say the particle traces out $\gamma: I \to C$, where interval $I$ is time. Let $\gamma(0) = p \in C$. Locally in terms of $x$, since we have $\gamma_{\ast}(\frac{d}{dt}\rvert_0)$ in $T_{p}C$, we get $dx(\gamma_{\ast}(\frac{d}{dt}\rvert_0)) = \dot{x \circ \gamma}(0)$, which we can abuse notation and write as $\dot{x}(p)$, so the corresponding point on the bundle looks like $(x(p), \dot{x}(p))$.
Does this make sense or have is there something I am still missing?