Derivation with respect to a derivative Let's consider a following equation:
$$x''+x'+x=5$$
My question is: how should I differentiate it with respect to x'? I've read somewhere that you only differentiate x' and take both x and x'' as constants, but why? Intuition tells me that they somehow depend on x'.
EDIT: I need this to compute a lagrange equation, where you take the derivative of L with respect to q'.
 A: Note that, under suitable conditions, the chain rule applies with $\frac {df}{dt}=\frac {df}{dy}\cdot \frac {dy}{dt}$
Use this with $f=x, x', x''$ and $y=x'$.
A: For that you would need an actual Lagrange functional. Something like
$$
L[x]=\int_a^b\left(\frac12 \dot x(t)^2-V(x(t))\right)\,dt
$$
Then you apply it to a perturbed curve $x+δx$, or more precisely to a family $x+s·δx$ of perturbed curves, and compute the part linear in $δx$
$$
δL[x;δx]=\lim_{s\to0}\frac{L[x+δx]-L[x]}s
=
\int_a^b\left(\dot x(t)·δ\dot x(t)-V'(x(t))·δx(t)\right)\,dt
$$
Then apply partial integration to get rid of the derivative of $δx$ and set all coefficients of $δx(t)$ to zero. 
Only to summarize the form of the so-obtained Euler-Lagrange equations do you use derivatives by $\dot x$ as if it were an independent variable. 
A: Let $v = \frac{dx}{dt}$, then $$\frac{d^2x}{dt^2} = \frac{dv}{dt} = \frac{dx}{dt}\frac{dv}{dx} = \frac{v}{\frac{dx}{dv}}$$
Equation becomes
$$ \frac{v}{\frac{dx}{dv}} + v + x = 5 $$
Differentiating with respect to $v$
$$\frac{1}{\frac{dx}{dv}} - \frac{v}{\left(\frac{dx}{dv} \right)^2}\frac{d^2x}{dv^2} + 1 + \frac{dx}{dv} = 0$$
$$ \left(\frac{dx}{dv}\right)^3 + \left(\frac{dx}{dv}\right)^2 + \frac{dx}{dv} - v\frac{d^2x}{dv^2} = 0 $$
