# Chain rule with partial derivatives and divergence

say you have a function f(x,y)
$\nabla$f= $\partial$f/$\partial$x + $\partial$f/$\partial$y
however when y is a function of x the situation is more complicated
first off $\partial$f/$\partial$x = $\partial$f/$\partial$x +($\partial$f/$\partial$y) ($\partial$y/$\partial$x)
( i wrote partial of y to x in case y was dependent on some other variable)
the $\partial$f/$\partial$x appears on both sides...what does this mean?do they can cancel? are their values equal?
my best guess is the partial with respect to x on the left side assumes non constant y, whereas the partial on the right wrt x assumes constant y.... how would you even show that in notation

now suppose we have a vector function F(x,y(x)), what is then the divergence of F, when we put in the operator $\nabla$ do we assume constant y or non constant y? and in which case does the divergence theorem hold?

thanks

When $y = y(x)$, what you're doing is calculating a total derivative instead of a partial. $\nabla f = \hat x \partial_x f + \hat y \partial_y f$ still, but $df/dx = \partial_x f + \partial_y f (dy/dx)$.

Generally, it's easier to deal with parameterized functions instead of $y = y(x)$. Say $x(t) = t$ and $y(t)$ is some arbitrary function. Really, though, $\nabla$ doesn't make a lot of sense when you're confining yourself to a curve (which is what you're doing when you say $y=y(x)$. Do you see why? You no longer have the freedom to go in any direction as the definition of the derivative would require.

arildno
Homework Helper
Gold Member
Dearly Missed
If you write:
F(x,t)=f(x,y(x,t)) (where I have used "t" as an additional variable),

Your doubt about whether to terms are "equal" and somehow cancels, is merely the result of sloppy notation.

thanks for the replies
i get the total derivative part
say you have function f(x,y,z) where z= g(x,y), how would you define div(f)? i've seen textbooks (griffiths specifically) say divf =$\partial$fx/$\partial$x + $\partial$fy/$\partial$y+$\partial$fz/$\partial$z or something like that. it doesnt make much sense to me.

bigerst

Like I said, I'm not sure divergence and curl make sense when you're considering a function confined to a surface. Doing that starts to get into a whole bunch of stuff about intrinsic/extrinsic geometry, projections of the derivative, differential geometry in general, and so on. At the least, I suspect that formalism may be more than you were bargaining for.

HallsofIvy
Homework Helper
thanks for the replies
i get the total derivative part
say you have function f(x,y,z) where z= g(x,y), how would you define div(f)? i've seen textbooks (griffiths specifically) say divf =$\partial$fx/$\partial$x + $\partial$fy/$\partial$y+$\partial$fz/$\partial$z or something like that. it doesnt make much sense to me.

bigerst
I've never seen any text book say such a thing. When f is a scalar function of x, y, and z, then
$$div f= \nabla f= \frac{\partial f}{\partial x}\vec{i}+ \frac{\partial f}{\partial y}\vec{j}+ \frac{\partial f}{\partial z}\vec{k}$$
Where in Griffiths is the formula you quote and, in particular, what do "fx", "fy", and "fz" mean there? Are they partial derivatives or components of a vector?

f$_{x}$ means the x compoenent of the vector function f
its on chapter 10 Q8, Griffiths, introduction to electrodynamics 3rd edition
part of problem asks to take the gradient of J(r',t$_{r}$)
∇'J(r',t$_{r}$)
where t$_{r}$ = t - abs(r-r')/c
so treating ∇' = <$\partial$/$\partial$x', $\partial$/$\partial$y', $\partial$/$\partial$z'>
where <> denotes a vector
hence using the chain rule
∇'J(r',t$_{r}$) = $\partial$Jx/$\partial$x' +$\partial$Jy/$\partial$y' +$\partial$Jz/$\partial$z' -(1/c)($\partial$J/$\partial$t$_{r}$)∇(abs(r-r'))
the answer, however is ∇'J(r',t$_{r}$)=-$\partial$p/$\partial$t -(1/c)($\partial$J/$\partial$t$_{r}$)∇(abs(r-r'))
where i believe the author makes use of the continuity equation that states
$\nabla$J= - $\partial$p/$\partial$t by arguing $\partial$Jx/$\partial$x' +$\partial$Jy/$\partial$y' +$\partial$Jz/$\partial$z' = ∇ J
this made no sense to me as i thought wasnt ∇'J(r',t$_{r}$) already the divergence?
hence i think either the definition of divergence is different somehow
perhaps the div(J) on the right side means taking the time to be constant while the div on the left side is more of a "absolute divergence?" then how would the divergence theorem hold in that case? define a new G(r',r,t)=J(r',t$_{r}$) ?
thanks

bigerst