how do you calculate a derivative with respect to another derivative I just learned some basics principles in Lagrangian mechanics and theres this equation
$$\frac{d}{dt}\left(\frac{dL}{d(\frac{dx}{dt})}\right)=\frac{dl}{dx}$$
where $l$ is kinetic energy-potential energy and therefore is a function of $x$ and $t$.
What I don't get is how you solve and simplify the
$\frac{d}{d(\frac{dx}{dt})}$ part because  it has a derivative at the bottom instead of a variable. When doing some expamples for the lagrangian equation I came across some examples that said that  $\frac{d{x}}{d(\frac{dx}{dt})}=0$. Shouldn't that equal to $0$ only if $x$ is independant of$\frac{dx}{dt}$? I feel like I'm missing something significant here... so any help would be much appreciated. Thanks in advance
 A: The Lagrangian is just a function of two variables (or more depending on how general you want to be). For example, $L:\Bbb{R}^2\to\Bbb{R}$, defined as say $L(\xi,\eta)=\frac{m}{2}\eta^2-\frac{k}{2}\xi^2$, where $m,k>0$ are given constants. Then, we have $\frac{\partial L}{\partial \xi}\bigg|_{(\xi,\eta)}=-k\xi$ and $\frac{\partial L}{\partial \eta}\bigg|_{(\xi,\eta)}=m\eta$. Hopefully this is all clear so far. A-priori, the function $L$ is just that: a function. It has a domain, it has a target space, and it has a rule.
In physics, the significance of $L$ is that if you choose it appropriately, then it encodes the dynamics (equations of motion) of the system, via the Euler-Lagrange equations. So, the goal is to find a curve $x:\Bbb{R}\to\Bbb{R}$ (the target space might be $\Bbb{R}^n$ if you consider more complex situations) such that for all $t\in \Bbb{R}$, we have
\begin{align}
\frac{d}{dt}\left(\frac{\partial L}{\partial \eta}\bigg|_{(x(t),\dot{x}(t))}\right)&=\frac{\partial L}{\partial \xi}\bigg|_{(x(t),\dot{x}(t))}.\tag{$*$}
\end{align}
In our specific case, by the previous computations, this simplifies to
\begin{align}
\frac{d}{dt}\bigg(m\dot{x}(t)\bigg)&=-kx(t),
\end{align}
or equivalently, $m\ddot{x}(t)=-kx(t)$ for all $t\in\Bbb{R}$. So, we are given $L:\Bbb{R}^2\to\Bbb{R}$, and our goal is to find a curve $x:\Bbb{R}\to\Bbb{R}$ which satisfies the ELE $(*)$. In this specific example, this is the equation of motion for a point particle of mass $m$ under the influence of an ideal spring (i.e obeying Hooke's law) with spring constant $k$. Once again: given $L$, we create a differential equation, and we try to find $x:\Bbb{R}\to\Bbb{R}$ which solve the ODE (given appropriate boundary conditions of course).

In usual physics treatments, you'll see this written as $L(x,\dot{x})=\frac{m}{2}\dot{x}^2-\frac{k}{2}x^2$, and the ELE written as
\begin{align}
\frac{d}{dt}\left(\frac{\partial L}{\partial\dot{x}}\right)&=\frac{\partial L}{\partial x},
\end{align}
where they say to treat $x$ and $\dot{x}$ as independent, and then obtain $m\ddot{x}=-kx$ as the ODE. Well, this is just them being sloppy with notation and lazy to explain things fully. This becomes infinitely clearer if you just think of $L$ as a function of two variables $(\xi,\eta)$ (or call the inputs whatever you like; e.g $(u,v)$ or $(\alpha,\beta)$ or $(a,b)$... math doesn't care about your favorite letters). It is only AFTER you calculate the partial derivatives that you plug in $x(t),\dot{x}(t)$. This is how we get the ODE (as in the first half of the answer).
