I'm dealing with an optimal control problem and I want to solve it with the B-splines. In order to compute the gradient of my objective function, I have to derive the B-spline with respect to the control points $p_i$. For the case of a univariate B-spline I have no problem defining the gradient as the vector of the following partial derivatives:
$\frac{\partial s(t,P)}{\partial p_i} = \sum_{j=1}^{d+1} B_j(t) \frac{\partial p_j}{\partial p_i} = \sum_{j=1}^{d+1} B_j(t) \delta_{ij} \qquad i=1,\dots,m$
Where $s(t,P)$ is the B-spline function, $P=[p_1,p_2,\dots,p_m]$ is the set of the control points , $B_j(t)$ is the j-th basis function and $\delta_{ij}$ is the Kronecker delta.
When I have to define a partial derivative of 2D B-spline, is it correct to define the gradient I have some difficulties. My first idea was to calculate a partial derivative of the b-spline with respect to a translation of the j-th point in x direction and one with a translation in y direction, but seems to me that I'm wrong with something.
Thanks for help!