I've used the chain rule several times, but the following has appeared in a mathematical text (Loring Tu's Introduction to Manifolds):
Let $f$ be a function on an open subset $U$ of $\mathbb{R}^n$ star shaped with respect to a point $p = (p^1,p^2, \ldots p^n)$ in $U$.
Then as $U$ is star shaped w.r.t. $p$, for any $x$ in $U$ the line segment $p+t(x-p)$, $0 \leq t \leq 1$ lies in $U$. So $f(p + t(x-p))$ is defined for this range of $t$. Here's what I don't understand. By the chain rule:
$\frac{d}{dt}f(p + t(x-p)) = \sum (x^i -p^i)\frac{\partial f}{\partial x^i}(p + t(x-p))$.
Now the chain rule states that if $f$ is a function of say two variables $u$ and $v$, themselves functions of $t$ then
$\frac{df}{dt} = \frac{\partial f}{du}\frac{du}{dt} + \frac{\partial f}{dv}\frac{dv}{dt}$.
Now looking at the form of the equation given I'm guessing that $f(x^1, x^2, \ldots x^n)$, each $x^i$ itself a function of $t$. So perhaps this would then mean that the term $(x^i - p^i)(p+ t(x-p))$ has arisen as a result of calculating $\frac{dx^i}{dt} = \frac{dx^i}{du}\frac{du}{dt}$, where $ u = p + t(x-p)$. But then this does not seem to help. I'm mixing up the variables?