# I can't understand this differentiation ( Chain Rule, solving the variational problem)

What kind of chain rule is that? I know the chain rule when we have a fucntion of multiple variables and a curve, if the function is evaluated at the curve then I know how to calculate the chain rule ( By doing the dot product of the gradient of the function evaluated at the curve by the derivative of the curve ) In this case I do not see how that apllies at all, I can't even see how I would calculate the gradiant of this function since its coordinates are functions themselves ! I am lost guys, clarify this to me please.

Let $x_1=y+\alpha \eta$ and $x_2=y'+\alpha \eta'$. Then, we have

\begin{align} \frac{\partial f(y+\alpha \eta, y'+\alpha \eta',x)}{\partial \alpha}&=\frac{\partial f(x_1,x_2,x)}{\partial \alpha}\\\\ &=\frac{\partial f(x_1,x_2,x)}{\partial x_1}\frac{\partial x_1}{\partial \alpha}+\frac{\partial f(x_x,x_2,x)}{\partial x_2}\frac{\partial x_2}{\partial \alpha}+\frac{\partial f(x_1,x_2,x)}{\partial x}\frac{\partial x}{\partial \alpha}\\\\ &=\eta \,\frac{\partial f(x_1,x_2,x)}{\partial x_1}+\eta'\,\frac{\partial f(x_1,x_2,x)}{\partial x_2}\\\\ &=\eta \,\frac{\partial f(y+\alpha \eta,y'+\alpha \eta',x)}{\partial y}+\eta'\,\frac{\partial f(y+\alpha \eta,y'+\alpha \eta',x)}{\partial y'} \end{align}

• What did you do at your last step? Why x1 turned into y and x2 turned into y' o.o ( I understood very well all the rest of it, and thank u for that. ) – Victor Jul 27 '17 at 19:12
• We denoted $y+\alpha \eta$ by $x_1$ and denoted $y'+\alpha \eta'$ by $x_2$. So, taking the partial with respect to the first variable, call that $f_1$ is equivalent to $\frac{\partial f}{\partial x_1}=\frac{\partial f}{\partial y}$ since $x_1=y+\text{things independent of}\,y$. Similarly, taking the partial with respect to the second variable, call that $f_2$ is equivalent to $\frac{\partial f}{\partial x_2}=\frac{\partial f}{\partial y'}$ since $x_2=y'+\text{things independent of}\,y'$ – Mark Viola Jul 27 '17 at 19:16
• I understand why we want to take the partial derivative with respect to the first variable, what I recognize as being the first variable is "y+αη" , why taking the derivative with respect to y+αη is the same as taking the derivative with respect to y ?? I do not understand why y is more special than alpha or eta in any way... ( Thank you anyway you are helping me so much. ) – Victor Jul 27 '17 at 19:24
• Victor, $\alpha \eta$ does not depend on $y$. So, with respect to $y$, $\alpha \eta$ is a constant. So, taking a partial with respect to $y$ is the same as taking a partial with respect to $x_1=y+\alpha \eta$. – Mark Viola Jul 27 '17 at 19:25
• You say : " taking a partial with respect to y is the same as taking a partial with respect to x1=y+αη" and I get it, my doubt is: Is taking a partial derivative with respect to x1 the same as taking a partial derivative with respect to y? The way you say it makes me think that y also does not depends on alpha, so that taking the derivative with respect to x1 is the same as taking the derivative with respect to alpha.eta, i'm so confused haha I do not see why y gets to be the special boy here intead of alpha or eta.. – Victor Jul 27 '17 at 19:32

It is indeed the chain rule. $\partial f / \partial y$ on the right hand side meaning "the derivative w.r.t. the first variable", ...

For a function with only a one-dimensional argument, the chain rule can be stated as $$\frac{\partial f(x(t))}{\partial t} = x'(t)\cdot \frac{\partial f}{\partial x}(x(t)),$$ where $x'(t)$ is the inner derivative, and $\frac{\partial f}{\partial x}(x(t))$ is the outer derivative evaluated at $x(t)$. The outer derviative is computed without the knowledge of $x(t)$.

Example: $f(z) = z^2, x(t) = \sin(t)$. Then $$\frac{\partial f(x(t))}{\partial t} = \underbrace{(\sin(t))'}_{x(t)'}\cdot \underbrace{(2z)}_{f'}\underbrace{(z = \sin(t))}_{(*)},$$ where $(*)$ is simply filling in the argument function $x(t)$ into the derivative of $f$, which was taken without knowledge of $x(t)$.

In 2 dimensions, we have $$\frac{\partial f(x(t), y(t))}{\partial t} = x'(t)\cdot \frac{\partial f}{\partial x}(x(t), y(t)) + y'(t)\cdot \frac{\partial f}{\partial y}(x(t), y(t)),$$ where $\frac{\partial f}{\partial x}(x(t), y(t))$ again means: We evaluate the derivative of $f$ with respect to its first variable/'slot', and then insert the specific arguments (here: $(x(t), y(t))$). This scheme is easily generalized to higher dimensions.

• But the second variable is a function itself right? – Victor Jul 27 '17 at 19:02