In my Microeconomics course, we derive the theorem of Sufficiency of Consumer's First Order Conditions. We derive the following expression, where u(x,y) and the t just comes from the quasiconcavity of u. I attached the Exercice and solution as a picture. I understand everything but how they derive the total derivative.
The total derivative in the solution is:
$\frac{d(u\left((1-t)x+ty)\right)}{dt} = \sum_{i=1}^{n}\frac{\partial{u((1-t)x+ty})}{\partial{x_i}}(y_i-x_i) $
But I would have used the formula $\frac{du}{dt} = \frac{\partial{u}}{\partial{x}} \frac{dx}{dt} + \frac{\partial{u}}{\partial{y}} \frac{dy}{dt} $
Can someone please explain it to me?
To expand on the comment, let $x=(x_1,x_2,\ldots,x_n)$ and $y=(y_1,y_2,\ldots,y_n)$.
You are differentiating the following with respect to $t$:
$$u\left[(1-t)(x_1,x_2,\ldots,x_n)+t(y_1,y_2,\ldots,y_n)\right]$$
or
$$u\left[(1-t)x_1+ty_1,(1-t)x_2+ty_2,\ldots,(1-t)x_1+ty_n)\right).$$
A straightforward application of the chain rule gives the result. For example, for the first term, we differentiate $u$ with respect to the first coordinate (getting $u_1$) and then multiply by the derivative of the expression $(1-t)x_1+y_1$ with respect to $t$ (which gives $y_1-x_1)$ to get
$$u_1[(1-t)x+ty]\cdot(y_1-x_1).$$
Note that I have written the partial derivative of $u$ with respect to the $i$-th coordinate by $u_i$ instead of by $du/dx_i$. The latter notation could be a bit confusing given the use of $x_i$ and $y_i$ for cooordinates of two different vectors.