# Partial derivative help

I need to take the partial derivatives w.r.t. $x^*$ and $y^*$ of the following equation $L(x^*,y^*;x_0,y_0)$:

$$L(x^*,y^*;x_0,y_0)=\int_{x_0}^{x^*}\frac{\partial f}{\partial x}\mathrm{d}x+\int_{y_0}^{y^*}\frac{\partial f}{\partial x}\frac{\partial x}{\partial y}\mathrm{d}y.$$

The result I'm getting for the partial derivative of $L$ w.r.t. $x^*$ doesn't seem right. First let me expand things a little:

$$L(x^*,y^*;x_0,y_0)=f(x^*)-f(x_0)+\frac{\partial f}{\partial x}(x(y^*)-x(y_0))$$

(Important to note that $x^=x(y^)$).

I think up to here it's ok. But now when I take the partial derivative...

$$\frac{\partial L}{\partial x^*}=\frac{\partial f}{\partial x^*}+\frac{\partial^2 f}{\partial x^{2}}(x^*-x(y_0))+\frac{\partial f}{\partial x}$$

I'm confused as to whether the second term $\frac{\partial^2 f}{\partial x^{2}}(x^*-x(y_0))$ should be included in there since, strictly speaking, it is a derivative w.r.t. $x$ and not $x^*$. Or does the fact that $x^*=x(y^*)$ imply that this is a derivitive w.r.t. $x^*$? The last term, on the other hand, is indeed a derivative w.r.t. $x^*$ no matter how you slice it, but then what to do with $\frac{\partial f}{\partial x}$ which might be evaluated at x=anything and thus is effectively a random number thrown into the equation?

My intuition tells me that I should just treat $\frac{\partial^2 f}{\partial x^{2}}$ and $\frac{\partial f}{\partial x}$ here as evaluated at $x^*$, but looking at the actual equations I can't see the justification.

Appreciate any advice in this regard.

-
Do you mean $\displaystyle L(x^*,y^*;x_0,y_0)=\int_{x_0}^{x^*}\frac{\partial f}{\partial x}\;\mathrm{d} x+\int_{y_0}^{y^*}\frac{\partial f}{\partial x}\frac{\partial x}{\partial y}\;\mathrm{d} y$? Otherwise, I don't understand the notation. Also, is $y$ a function of $x$? –  robjohn Oct 9 '11 at 17:45
Yes that's what I mean. And x is a function of y. $x=x(y)$ If it helps, think of x as being a manufactured good the quantity of which depends on the quantity of the input y. –  ben Oct 9 '11 at 17:59
Is it also true that $x_0=x(y_0)$? –  robjohn Oct 9 '11 at 18:21
Let's say yes, although it is also conceivable that $x_0=x(y_0)+\overline{x}$ where $\overline{x}$ is some pre-existing quantity of x. But I think this is a trivial extension. –  ben Oct 9 '11 at 18:46
If $x=x(y)$ and $f=f(x)$, why are you writing their derivatives as partial derivatives? –  joriki Oct 9 '11 at 22:15

If I understand correctly despite the somewhat confusing notation, then the second displayed equation is wrong -- the second term should be

$$\int_{y_0}^{y^*}\frac{\mathrm df}{\mathrm dx}\frac{\mathrm dx}{\mathrm dy}\mathrm dy=\int_{x(y_0)}^{x(y^*)}\frac{\mathrm df}{\mathrm dx}\mathrm dx=f(x(y^*))-f(x(y_0))\;.$$

Quite apart from the details, the most direct way to take the partial derivatives would be to note that $x^*$ and $y^*$ occur only in the upper integration limits, so the derivatives with respect to them are just the respective function values:

\begin{align} \frac{\partial L}{\partial x^*}&=\frac{\mathrm d f}{\mathrm d x}(x^*)\;,\\ \frac{\partial L}{\partial y^*}&=\frac{\mathrm d f}{\mathrm d x}\frac{\mathrm d x}{\mathrm d y}(y^*)\;.\\ \end{align}

-
Just want to clear up a notational issue: I assume that by $\frac{\mathrm{d}f }{\mathrm{d} x}(x^*)$ you mean "the derivative of $f$ w.r.t. $x$ evaluated at $x^*$" ? As opposed to the derivative "multiplied by $x^*$" ? Thanks. Also, I am somewhat new to this forum. Is there a "thanks" button somewhere that I can click, or how do I show my appreciation for the help received? –  ben Oct 9 '11 at 23:03
@ben: Yes, that's what I meant. For instance, in your second displayed equation, it's not clear where $\partial f/\partial x$ is to be evaluated, since $x$ (which would be the default assumption if the argument isn't specified) doesn't occur as a variable in that equation. Yes, you have two ways of showing appreciation. One is to accept one of the answers by clicking on the checkmark to the left of it under the vote tally, but you can only do that for one answer; the other is to upvote it with the up-arrow above the vote tally; you need $15$ points yourself to do that (which you have). –  joriki Oct 9 '11 at 23:18
@ben: and it is quite alright to both upvote and accept an answer. ;) –  Guess who it is. Oct 10 '11 at 2:05
Good to know. Both answers are pretty good, but you got to it first so it goes to you. –  ben Oct 10 '11 at 5:33

Since it seems that $f$ is a function of $x$ and $x$ is a function of $y$, there is no reason to use partial derivatives in the integrals

Simply looking at your integrals, in the first, the only free variables are $x^*$ and $x_0$, so $$\begin{array}{} \frac{\partial}{\partial x^*}\int_{x_0}^{x^*}\frac{\mathrm{d} f}{\mathrm{d} x}\mathrm{d}x=\frac{\mathrm{d} f}{\mathrm{d} x}(x^*)&\text{and}&\frac{\partial}{\partial x_0}\int_{x_0}^{x^*}\frac{\mathrm{d} f}{\mathrm{d} x}\mathrm{d}x=-\frac{\mathrm{d} f}{\mathrm{d} x}(x_0) \end{array}$$ in the second, the only free variables are $y^*$ and $y_0$, so assuming $x^*=x(y^*)$ and $x_0=x(y_0)$ $$\begin{array}{} \frac{\partial}{\partial y^*}\int_{y_0}^{y^*}\frac{\mathrm{d} f}{\mathrm{d} x}\frac{\mathrm{d} x}{\mathrm{d} y}\;\mathrm{d}y=\frac{\mathrm{d} f}{\mathrm{d} x}(x^*)\frac{\mathrm{d} x}{\mathrm{d} y}(y^*)&\text{and}&\frac{\partial}{\partial y_0}\int_{y_0}^{y^*}\frac{\mathrm{d} f}{\mathrm{d} x}\frac{\mathrm{d} x}{\mathrm{d} y}\;\mathrm{d}y=-\frac{\mathrm{d} f}{\mathrm{d} x}(x_0)\frac{\mathrm{d} x}{\mathrm{d} y}(y_0) \end{array}$$ In either case, $$\int_{x_0}^{x^*}\frac{\mathrm{d} f}{\mathrm{d} x}\mathrm{d}x=f(x^*)-f(x_0)$$ and assuming $x^*=x(y^*)$ and $x_0=x(y_0)$ $$\int_{y_0}^{y^*}\frac{\mathrm{d} f}{\mathrm{d} x}\frac{\mathrm{d} x}{\mathrm{d} y}\;\mathrm{d}y=f(x(y^*))-f(x(y_0))=f(x^*)-f(x_0)$$

-
Aha I see what you guys are saying. Duh! But tell me, can't that last integral also be expressed as: $\int_{y_0}^{y^*}\frac{\mathrm{d} f}{\mathrm{d} x}\frac{\mathrm{d} x}{\mathrm{d} y}\;\mathrm{d}y=\frac{\mathrm{d} f}{\mathrm{d} x}\int_{y_0}^{y^*}\frac{\mathrm{d} x}{\mathrm{d} y}\;\mathrm{d}y=\frac{\mathrm{d} f}{\mathrm{d} x}(x(y^*)-x(y_0))$ ? The derivative of which would then be: $\frac{\mathrm{d}^2 f}{\mathrm{d} x^{*2}}(x(y^*)-x(y_0))+\frac{\mathrm{d} f}{\mathrm{d} x^*}$ (?) –  ben Oct 9 '11 at 23:20
No, you can't simply pull the $\frac{\mathrm{d}f}{\mathrm{d}x}$ outside the integral; it's still a function of $y$. –  robjohn Oct 9 '11 at 23:23
Oh yeah. Gosh I knew that looked pretty messed up the way I had it. Thanks. –  ben Oct 10 '11 at 0:11