Let $\vec{U}=\{u_0,u_1,\ldots,u_m\}$ denotes a non-decreasing sequence of real numbers, i.e, $u_i\leq u_{i+1} \quad i=0,1,2\ldots m-1$.

and the $i$-th B-spline basis function of $p$-degree, denoted by $N_{i,p}(u)$, is defined as below:

$$N_{i,0}(u)= \begin{cases} 1 & u_i\leq u<u_{i+1}\\ 0 & otherwise \end{cases} $$ $$N_{i,p}(u)=\frac{u-u_i}{u_{i+p}-u_i}N_{i,p-1}(u)+\frac{u_{i+p+1}-u}{u_{i+p+1}-u_{i+1}}N_{i+1,p-1}(u) $$


Now I want to solve the maximal value point of the $N_{i,p}(u)$, the following steps is my initial trial.

For instance, now I have a knots vector $U=\{0, 0, 0, 0, 1/5, 1/4, 1/3, 1/2, 1, 1, 1, 1\}$. Namely, $m=11$ and I assume that the degree of the basis function is $3$.

  • How to solve the maximal value point of the $N_{3,3}(u)$?

Step 1: Calculate the mathematical expression of $N_{3,3}(u)$

To achieve the $N_{3,3}(u)$ expression, I draw the following schematic diagram enter image description here

Then I ultilize the recursive formula to calculate the mathematical expression of $N_{3,3}(u)$ by hand.

$$ N_{3,3}(x)= \begin{cases} 60 x^3 & 0\leq x<\frac{1}{5} \\ -10 \left(119 x^3-75 x^2+15 x-1\right) & \frac{1}{5}\leq x<\frac{1}{4} \\ 10 \left(73 x^3-69 x^2+21 x-2\right) & \frac{1}{4}\leq x<\frac{1}{3} \\ -10 \left(8 x^3-12 x^2+6 x-1\right) & \frac{1}{3}\leq x\leq \frac{1}{2} \\ \end{cases} $$

Step 2: Differentiate the $N_{3,3}(x)$ expression with respect to the varible $x$ $$ \frac{d}{dx}N_{3,3}(x)= \begin{cases} 180 x^2 & 0\leq x<\frac{1}{5} \\ -10 \left(357 x^2-150 x+15\right) & \frac{1}{5}\leq x<\frac{1}{4} \\ 10 \left(219 x^2-138 x+21\right) & \frac{1}{4}\leq x<\frac{1}{3} \\ -10 \left(24 x^2-24 x+6\right) & \frac{1}{3}\leq x\leq \frac{1}{2} \\ \end{cases} $$

Step 3: Set the $N'_{3,3}(x)$ to $0$. Namely, $$ \begin{cases} 180 x^2=0 & 0\leq x<\frac{1}{5} \\ -10 \left(357 x^2-150 x+15\right)=0 & \frac{1}{5}\leq x<\frac{1}{4} \\ 10 \left(219 x^2-138 x+21\right)=0 & \frac{1}{4}\leq x<\frac{1}{3} \\ -10 \left(24 x^2-24 x+6\right)=0 & \frac{1}{3}\leq x\leq \frac{1}{2} \\ \end{cases} $$ $$ \Rightarrow \quad \left( \begin{array}{c} x_1=0 \\ x_2=\frac{1}{119} \left(25-\sqrt{30}\right) \\ x_3=\frac{1}{73} \left(23-3 \sqrt{2}\right) \\ x_4=\frac{1}{2} \\ \end{array} \right) $$

Step 4: Compare to the value of $N_{3,3}(x_1),N_{3,3}(x_2),N_{3,3}(x_3)$ and $N_{3,3}(x_4)$

By the calculation, I discovered that the maximal value point is

$$x_3=\frac{1}{73} \left(23-3 \sqrt{2}\right)$$


  • However, I think my initial trial is very complicated and very time-consuming. I would like to know is there a simple/elegant method to solve this question. Because in my actual work, I need to calculate all the maximal value point of $N_{i,p}(u)$ where, $i \in [0, m-n-1]$. Thanks a lot sincerely!
  • 332
  • 3
  • 16
  • 1
    $N_{i,p}$ has only one maximum for $p\ge 1$. If the knot sequence is equidistant, then the maximum is the middle of the support. In other cases, I am not aware that there is some closed formula. – user251257 Oct 02 '15 at 15:30
  • @user251257, Thanks. Yes, I know the conclusion $N_{i,p}$ `owns only one maximum`. – xyz Oct 02 '15 at 15:34
  • 1
    notice that there is recursion formula for $N_{i,p}'$, so you don't have to differentiate it by hand. Finding zeros of high degree polynomials is ... cumbersome, cf [Storm's theory](https://en.wikipedia.org/wiki/Sturm%27s_theorem). – user251257 Oct 02 '15 at 15:39
  • @user251257, OK, I remerber that formula $$\frac{d}{du}N_{i,p}(u)=p\left[ \frac{N_{i,p-1}(u)}{u_{i+p}-u_i}-\frac{N_{i+1,p-1}(u)}{u_{i+p+1}-u_{i+1}} \right]$$ – xyz Oct 02 '15 at 15:49
  • I can remember the indices correctly, otherwise it is the formula I had in mind. – user251257 Oct 02 '15 at 15:51
  • @user251257 In fact, owing to that I have no the knowledge of the `optimization`, so I don't know how to achieve the `maximal value point` in a **simple** or **elegant** method. – xyz Oct 02 '15 at 15:56
  • 1
    As long as $N_{i,p}$ is continuous, you can use [Golden section search](https://en.m.wikipedia.org/wiki/Golden_section_search). If $N_{i,p}$ is not continuous, then the maximum is at the end points of the support. – user251257 Oct 02 '15 at 16:09
  • If $C^1$, you could also apply bisection or the secant method on the derivative. Or even Newton method, if $C^2$. – user251257 Oct 02 '15 at 16:17

1 Answers1


B-spline basis functions are piecewise polynomials, so this is a problem of finding the maximum value of a polynomial. There is nothing special about the polynomials that occur in b-spline basis functions. Or, saying it another way, every polynomial will show up somewhere as part of some b-spline basis function, so there can be no special tricks for finding their maxima.

For cubic b-splines, you can find the maxima by solving quadratics, as you did.

For higher degrees, numerical methods will be needed. You can take advantage of the fact that a b-spline basis function always has a single maximum. And this maximum will always occur on the middle segment of the support (for even degree splines) or on one of the two middle segments (for odd degree splines), so no point doing any analysis of the other segments.

  • 40,254
  • 3
  • 55
  • 107
  • Dear bubba,THX a lot. I would like to know that whether I must calculate the **mathematical expression** before solving the **maximum points** of $N_{i,p}(u)$ according to your answer.:-) – xyz Oct 03 '15 at 10:54
  • 1
    No, not necessarily. If you're going to use numerical methods, then all you need is code to compute the value of a b-spline basis function (and maybe its derivative, if you choose a numerical method that requires this). Computing values and derivatives can be done using the recursive process; you don't need to figure out explicit closed-form formulas. – bubba Oct 03 '15 at 11:11
  • Yes, I have implemented the B-spline basis function with the **Wolfaram Mathematica**, pleaswe [here](i.stack.imgur.com/KnMAu.png) and [here](i.stack.imgur.com/8 oJnZ.png). However, I didn't know how to do in next step. Could you give me a small demo? Thanks a lot:) – xyz Oct 03 '15 at 11:55
  • Dear bubba, please see [here](http://i.stack.imgur.com/5zd9y.png) and [here](http://i.stack.imgur.com/CDnq3.png) – xyz Oct 03 '15 at 12:00
  • Just use Mathematica's FindMaximum function. Apply it to your function CAGDBSplineBasis. Use $x = 0.5$ as a starting point. – bubba Oct 03 '15 at 12:45
  • `FindMaximum[CAGDBSplineBasis[{3, U}, 3, x], {x, .5}]` return the warning information `FindMaximum::fmgz: `. However, when I change the initial point to $x=0.1, 0.2, 0,3, 0.4$, it gives the correct result. `{0.787643, {x -> 0.25695}}` – xyz Oct 03 '15 at 14:49
  • You can look up the fmgz error to understand what it means. You could also try Maximize or NMaximize. – bubba Oct 04 '15 at 00:51