2
$\begingroup$

How can I calculate a Polynomial that passes through the origin and a given point (P) having given tangents at the origin (Ot) and the given point (Op)?

The given point will always be to the right of the origin (Px > 0). The polynomial should be a function of x (i.e. it moves from left to right).

I believe a 3rd degree polynomial will always fit these constraints, but I'm not certain.

I am looking for a function f( x, Px, Py, Ot, Pt ) = ? which plots a polynomial for x, satisfying the four given values.

When x = 0,   f()   = 0 When x = Px,  f()   = Py When x = 0,   f'()  = Ot When x = Px,  f'()  = Pt 
  • 0
    @anon: You could put that in the answer box. I'd vote for it2011-08-11

2 Answers 2

4

The slope of a tangent line is the derivative, so you want to solve a system of the form ($p\ne 0$)

$f(0)=0, f(p)=q,$ f'(0)=a, f'(p)=b.

The coefficients of $f$ are the unknowns, and we have four equations making a linear system for the coefficients. To ensure a solution, we need also four unknowns i.e. a degree $3$ polynomial. From the left two conditions we know that $f(x)=dx^3+cx^2+ax$. The right two conditions then are

$\begin{pmatrix}p^3 & p^2\\3p^2 & 2p\end{pmatrix} \begin{pmatrix}d\\c\end{pmatrix}=\begin{pmatrix}q-ap\\b-a\end{pmatrix}.$

Solving,

$\begin{pmatrix}d\\c\end{pmatrix}=-\frac{1}{p^4}\begin{pmatrix}2p & -p^2\\-3p^2 & p^3\end{pmatrix}\begin{pmatrix}q-ap\\b-a\end{pmatrix}.$

Thus we have

$f(x,p,q,a,b)=-\frac{2p(q-ap)-p^2(b-a)}{p^4}x^3-\frac{-3p^2(q-ap)+p^3(b-a)}{p^4}x^2+ax.$

EDIT: Also, the polynomial can be quadratic or linear if and only if the corresponding coefficients above vanish appropriately. To see this, solve the quadratic case to get the condition

$\frac{q-ap}{p^2}=\frac{b-a}{2p},$

which is equivalent to $d=0$. By geometry, the linear case occurs when $a=b=p/q$, which can also be shown as logically equivalent to $d=c=0$.

  • 0
    In general one needs to solve a (confluent) Vandermonde system to do Hermite interpolation, but as can be seen in anon's answer, specially arranged data can allow for shortcuts.2011-08-11
3

This is a very well-studied problem. In addition to anon's comment (which he expanded into an answer while I was writing this up), I wanted to direct you to this class of problems

This is a polynomial interpolation problem, and when you know the values of the function and some or all of its derivatives at these points, this is called Hermite Interpolation. Atkinson's Introduction to Numerical Analysis covers this topic very well and has several very instructive problems on it.

  • 0
    Addendum: in fact, OP's very problem (i.e. cubics with known tangents) turns up a lot in computer graphics (e.g. splines) among other things.2011-08-11