# Notes: A family of ramp functions and the Beta function

Sometimes in a numerical method, you need to be able to continuously turn a calculation on or off in space or time (here I will pretend it’s in time). This can be easily accomplished if you have a function that starts at a value of 0 before some first time , and rises up to a value of 1 by time . Through an affine transformation you can always map . An example “ramp” function is plotted above.

Now if this function appears in a differential equation, and you are
integrating it with an order method, then it’s not
enough for the function to be continuous: you probably want the first
*n* derivatives to match (and thus vanish) at each endpoint.

Let’s go for a piecewise ramp function,

where is some polynomial in *t*.
Some counting tells you that these 2 endpoint values and *2n*
derivative conditions can be satisfied with a polynomial of degree
*2n+1*. Try changing the value of *n* above and see how the
smoothness changes.

Now for any value of *n*, it’s a straightforward algebra problem to
set up the polynomial and solve for the coefficients. You probably
want to know the answer for the general case, and a simple approach is
to do a few examples and look for the pattern. Here are the first
few:

Can you spot the pattern? Don’t feel bad if you can’t, that’s why we have the OEIS. If you search for the above integers as a sequence, you’ll find A091811.

With this newfound knowledge, we can now write down the closed form for the polynomial,

But was there a better way to find this than relying on the OEIS to already have the result? But of course!

Rather than thinking about itself, let’s think about
. Since is strictly increasing,
is positive, while going to zero at the endpoints. In
fact it goes to zero like at one endpoint, and at
the other endpoint, because we wanted *n* derivatives to vanish at
each endpoint. Therefore we know the proportionality

The only thing to get right is the normalization, which we enforce by asking that the integral of is 1 at . If you’ve spent enough time on probability and statistics, then you’ll recognize as a special case of the Beta distribution, with shape parameters . So we know the normalization,

where is the beta function, and we can now call the regularized incomplete beta function, .

The incomplete beta function has a representation in terms of the Gauss hypergeometric function,

The important fact for us is that we’re interested in , in which case one of the first two arguments is a non-positive integer, and therefore the series will terminate as a finite-degree polynomial. This way, you can prove Eq. \eqref{eq:def}!