Finding equation to cubic function between two points with non-negative derivative

399 Views Asked by At

I'm working on a CAD project and attempting to do some basic lofting, which is a skill that I'll require in the future.

What I'm attempting to find is a smooth cubic curve that intersects two points, but that avoids the two derivative zero-crossings of the standard $y=x^3$ (i.e., the derivative is positive throughout the entire domain of $[a,b]$, if the two points are $(a, f(a))$ and $(b, f(b))$.

Proceeding from $f(x) = ax^3 + bx^2 + cx + d$, how would I go about satisfying the criteria, in essence, being:

  1. Point 1: $(a, f(a))$
  2. Point 2: $(b, f(b))$
  3. $f'(x) > 0$ throughout $[a,b]$.

As a fair warning, I'm a college student currently and I'm currently in Calculus I, so my knowledge of more advanced solutions may be woefully inadequate. I've tried to describe my problem to the best of my knowledge, let me know if anyone needs more information.

1

There are 1 best solutions below

0
On

There are many cubic polynomials that satisfy your conditions (assuming that $f(b)>f(a)$). One of them, sort of, is simply the line $$ 0x^3 + 0x^2 + \frac{f(b)-f(a)}{b-a}(x-a) + f(a). $$ Maybe you don't like this one because it's not a real cubic. However, you can add to this any cubic polynomial that vanishes at both $a$ and $b$, that is, you can take any polynomial of the form $$ \bigg( \frac{f(b)-f(a)}{b-a}(x-a) + f(a) \bigg) + \bigg( (cx+d)(x-a)(x-b) \bigg), $$ and it will still go through the points $(a,f(a))$ and $(b,f(b))$; moreover, if you choose $c$ and $d$ small enough, the derivative of this cubic polynomial will still be positive everywhere in $[a,b]$.

To figure out which cubic polynomial one chooses, one usually fixes in advance not only the endpoints $(a,f(a))$ and $(b,f(b))$ but also the desired derivatives of the cubic polynomial at those endpoints; then the resulting cubic polynomial is well-defined. Moreover, this makes it possible to use several different cubic polynomials to nicely fit a smooth curve between many consecutive data points (one makes the desired derivatives match up on both sides of each data point). However, it is possible that one of these cubic curves isn't always increasing, depending on what we choose for the endpoint-derivatives.

Searching on the term cubic spline will lead you to more details.