The Motivation:
I am learning the basics of Lagrangian mechanics. The usual example of using Lagrangian mechanics is to find the equation of motion of a pendulum. Since this forum is about math and not physics, I will simply write down the expression which is confusing me.
The Lagrangian ($\mathcal{L}$) is
$$\mathcal{L} = \frac{m}{2}\left(l\frac{d{\theta}}{dt}\right)^2 - mgl(1-\cos(\theta))$$
(Where $m$ is the mass of the bob and $l$ is the length of the string.) The issue is when I try to find the quantity $\frac{\delta\mathcal{L}}{\delta \theta}$: the solution simply means treating $\dot{\theta}$ as a variable independent of $\theta$, even though since they are both functions of $t$ we can write down a relationship between the two.
The Problem:
So there's no point in making the algebra messy, so let's use an easier example. Let's pretend $\mathcal{L} = \dot{x}^2 - x$ and furthermore, let's pretend $x=e^t$.
This is a problem! Obviously, in this special case, $x=\dot{x}$, so wouldn't $\frac{\delta\mathcal{L}}{\delta\dot{x}}=2\dot{x}-1$? Apparently, $\frac{\delta\mathcal{L}}{\delta\dot{x}}$ is actually $2\dot{x}$.
We could also give a different example. Now, let's use the same $\mathcal{L}$, but let $x=e^{7t}$. In this slightly different case, $x=\frac{1}{7}\dot{x}$, so shouldn't $\frac{\delta\mathcal{L}}{\delta\dot{x}}=2\dot{x}-\frac{1}{7}$? Once again, apparently, $\frac{\delta\mathcal{L}}{\delta\dot{x}}$ is actually $2\dot{x}$.
The Question:
The reason I brought up the motivation for this problem is just in case the math is special for the case of Lagrangian mechanics (which I wouldn't expect).
Otherwise, why is it that when we take the partial of $\mathcal{L}$ with respect to $\dot{x}$, we can, with impunity, ignore the implicit relation between $\dot{x}$ and $x$ and just treat $\dot{x}$ as a variable completely independent of $x$?