Given a constant $$c\in\mathbb{R}^n$$, and given $$n+1$$ constant vectors $$u_0,...,u_n\in\mathbb{R}^n$$ such that $$u_1-u_0,...,u_n-u_0$$ form a basis of $$\mathbb{R}^n$$ (ie they are affine-independant), let $$\Phi_{i,c}(\lambda_0,...,\lambda_n)=\|c-\lambda_0u_0-...-\lambda_{i-1}u_{i-1}-\lambda_{i+1}u_{i+1}-...-\lambda_nu_n\|^2$$ be a function of the $$n$$ variables $$\lambda_0,...,\lambda_n\in]0,1[$$ (where $$\lambda_i$$ does not appear) for any $$i\in[\![0,n]\!]$$.

How does one calculate the partial derivatives $$\frac{\partial\Phi_{i,c}}{\partial\lambda_j}$$ for any $$j\in[\![0,n]\!]\setminus\lbrace i\rbrace$$ ?

What I tried so far is to develop : (all sums do not contain the $$i$$-th term)

$$\Phi_{i,c}(\lambda_0,...,\lambda_n)=\|c\|^2+\|\lambda_0u_0+...+\lambda_nu_n\|^2-2\langle c|u_0\rangle\lambda_0-...-2\langle c|u_n\rangle\lambda_n$$

and use the fact that : $$\|tu+v\|^2=\|u\|^2t^2+\|v\|^2+2\langle u|v\rangle t\implies\frac{\text{d}}{\text{d}t}\left(\|tu+v\|^2\right)=2\|u\|^2t+2\langle u|v\rangle$$ to write :

$$\frac{\partial\Phi_{i,c}}{\partial\lambda_j}=-2\langle c|u_j\rangle+2\|u_j\|^2\lambda_j+2\langle u_j|\lambda_0u_0+...+\lambda_nu_n\rangle_{j\text{ omitted}}$$ which yields : $$\frac{\partial\Phi_{i,c}}{\partial\lambda_j}=2\left(\langle u_j|u_0\rangle\lambda_0+...+\langle u_j|u_n\rangle\lambda_n\right)-2\langle c|u_j\rangle$$

This finally gives : $$\frac{1}{2}\nabla\Phi_{i,c}=\begin{pmatrix}\langle u_0|u_0\rangle&\langle u_0|u_1\rangle&\dots&\langle u_0|u_n\rangle\\\langle u_0|u_1\rangle&\langle u_1|u_1\rangle&\dots&\langle u_1|u_n\rangle\\\vdots&\vdots&\ddots&\vdots\\\langle u_0|u_n\rangle&\langle u_1|u_n\rangle&\dots&\langle u_n|u_n\rangle\end{pmatrix}\begin{pmatrix}\lambda_0\\\lambda_1\\\vdots\\\lambda_n\end{pmatrix}-\begin{pmatrix}\langle c|u_0\rangle\\\langle c|u_1\rangle\\\vdots\\\langle c|u_n\rangle\end{pmatrix}$$ where all the terms of the form $$\langle u_k|u_i\rangle$$ are omitted in the matrix, and where the two column vectors also do not contain the $$i$$-th term.

I this correct ? I was expecting the matrix to be invertible, but taking $$u_0=0$$, for instance, does not provide this property...