# a small doubt with partial derivative

This is is pretty straightforward. I have a function, say $$X = X(q)$$. And $$q=q_1+q_2(q_1)$$. So X is a function of q, and q is a function of $$q_1,q_2$$. But $$q_2$$ is also a function of $$q_1$$. Now calculate

$$\frac{\partial X}{\partial q_1}$$

I proceed like:

$$\frac{\partial X}{\partial q_1} = \frac{\partial X}{\partial q} \cdot \frac{\partial q}{\partial q_1}= \frac{\partial X}{\partial q} \cdot (1+\frac{\partial q_2}{\partial q_1})$$

Is this correct? Any insight or any more detailed expression that i am missing will be useful.

• Looks correct to me ... – Matti P. Mar 13 at 11:01

$$X(q)$$, $$X(q_1)$$ and $$X(q_1,q_2)$$ are three different functions which happen to have the same name. Let me expand on that (I am going to assume that $$q_1$$, $$q_2$$ and the $$X$$s all take real values) ...

$$X(q_1,q_2)$$ is a function from $$\mathbb{R}^2$$ to $$\mathbb{R}$$. It is defined for any pair of values $$(q_1, q_2)$$ in $$\mathbb{R}^2$$ (or, possibly, in some region $$U \subset \mathbb{R}^2$$). As such, its has partial derivatives $$\frac{\partial X}{\partial q_1}$$ and $$\frac{\partial X}{\partial q_2}$$ at each point $$P \in \mathbb{R}^2$$ (provided $$X$$ is continuous and is defined in some open region around $$P$$).

If we now introduce $$q$$ then $$X(q)$$ is a function from $$\mathbb{R}$$ to $$\mathbb{R}$$. As such it has a derivative $$\frac{dX}{dq}$$ (subject to the usual assumptions about continuity etc.) at each point $$p \in \mathbb{R}$$. If we further say that $$q=q_1+q_2$$ then we have defined a function $$q(q_1,q_2)=q_1+q_2$$ from $$\mathbb{R}^2$$ to $$\mathbb{R}$$, and we can define an implicit function $$Y(q_1,q_2) = (X \circ q)(q_1,q_2) = X(q_1+q_2)$$. The connection between the derivative of $$X$$ and the partial derivatives of $$Y$$ is

$$\frac{\partial Y}{\partial q_1} = \frac{dX}{dq}\frac{\partial q}{\partial q_1}\\ \frac{\partial Y}{\partial q_2} = \frac{dX}{dq}\frac{\partial q}{\partial q_2}\\$$

If we then say that $$q_2$$ is a function $$Q_2: \mathbb{R} \to \mathbb{R}$$ of $$q_1$$ then we are restricting our attention to the curve $$q_2=Q_2(q_1)$$ in $$\mathbb{R}^2$$ which we are paramterising by the value $$q_1$$ (which now serves double duty both as a co-ordinate in $$\mathbb{R}^2$$ and as a parameter of the curve). We now have yet another implicit function $$Z:\mathbb{R} \to \mathbb{R}$$ defined by $$Z(q_1) = Y(q_1, Q_2(q_1)) = X(q_1+Q_2(q_1))$$ and

$$\frac{dZ}{dq_1} = \frac{\partial Y}{\partial q_1} + \frac{\partial Y}{\partial Q_2}\frac{dQ_2}{dq_1} = \frac{dX}{dq}\left(\frac{\partial q}{\partial q_1}+ \frac{\partial q}{\partial Q_2}\frac{dQ_2}{dq_1} \right)$$

which tells us how $$X(q)$$ varies along the curve $$q_2=Q_2(q_1)$$.

By convention we often rename $$Y(q_1,q_2)$$ as $$X(q_1,q_2)$$ and $$Z(q_1)$$ as $$X(q_1)$$ and we depend on context to tell us which $$X$$ is meant on each occassion that we use the name, but this can be confusing (as you have found).

This is a problem you encounter early and often in calculus of variations and Lagrangian mechanics. Here is how it is resolved there:

1. You can consider $$X$$ as a function of the single variable $$q$$. In that case, you can ask about $$\frac{dX}{dq}=X'(q)$$
2. You can consider $$X$$ as a function of the two (independent) variables $$q_1,q_2$$, and in that case, you can ask about $$\frac{\partial X}{\partial q_1}$$ and $$\frac{\partial X}{\partial q_2}$$, both of which happen to be equal to $$X'(q_1+q_2)$$.
3. You can consider $$X$$ as a function of the single variable $$q_1$$, and in that case you can ask about $$\frac{dX}{dq_1}=\frac{\partial X}{\partial q_1}\cdot\frac{dq_1}{dq_1}+\frac{\partial X}{\partial q_2}\cdot \frac{dq_2}{dq_1}\\=X'(q_1+q_2(q_1))\cdot \left(1+q_2'(q_1)\right)$$

It is easy to mix cases 2 and 3, but that makes no sense. It's one or the other.

Partial differentiation depends on the explicit form of the expression. Consider applying chain rule to compute a full derivative of an example function

$$\frac{df(x, y)}{dt} = \frac{\partial f}{\partial x} \frac{dx}{dt} + \frac{\partial f}{\partial y} \frac{dy}{dt} + \frac{\partial f}{\partial t}$$

If we were forced to explicitly rewrite $$x$$ and $$y$$ in terms of $$t$$, there would be no difference between a full and a partial derivative.

I would argue that, in your example, the calculation might not be correct, in case $$q_2$$ is an implicit function of $$q_1$$. Please have a look at the example from fluid dynamics to get the feeling for the difference between these two types of derivatives

There are only functions of a single variable here, so partial derivatives are irrelevant. By the ordinary chain rule,

$$\frac{dX}{dq_1}=\frac{dX}{dq}\frac{dq}{dq_1}=X'\left(1+\frac{dq_2}{dq_1}\right)=X'(1+q_2').$$

The $$'$$ denotes differentiation with respect to the argument.

Technically, you can consider that $$q=q_1+q_2$$ is a function of two variables and write

$$dq=\frac{\partial q}{\partial q_1}dq_1+\frac{\partial q}{\partial q_2}dq_2=dq_1+dq_2,$$ which justifies

$$\frac{dq}{dq_1}=1+\frac{dq_2}{dq_1},$$

but this is the only place where partials can be used, and in a contrived way.

It seems correct to me but you can remove the partial sign of $$\frac{\partial q_2}{\partial q_1}$$ becasuse $$q_2$$ depends on the single variable $$q_1$$,

$$\frac{\partial X}{\partial q_1}=\frac{\partial X}{\partial q}(1+\frac{d q_2}{d q_1})$$

• I believe that, given the broader answers given to the question, this answer may be misleading – Aleksejs Fomins Mar 13 at 13:01