2013-12-12 16:22:13 +01:00
\chapter { Cubic functions}
\section { Defined on $ \mdr $ }
2014-01-02 16:16:13 +01:00
Let $ f: \mdr \rightarrow \mdr , f ( x ) = a \cdot x ^ 3 + b \cdot x ^ 2 + c \cdot x + d $
be a cubic function with $ a \in \mdr \setminus \Set { 0 } $ and
$ b, c, d \in \mdr $ .
2013-12-12 16:22:13 +01:00
\begin { figure} [htp]
\centering
\begin { tikzpicture}
\begin { axis} [
legend pos=south east,
axis x line=middle,
axis y line=middle,
grid = major,
width=0.8\linewidth ,
height=8cm,
grid style={ dashed, gray!30} ,
xmin=-3, % start the diagram at this x-coordinate
xmax= 3, % end the diagram at this x-coordinate
ymin=-3, % start the diagram at this y-coordinate
ymax= 3, % end the diagram at this y-coordinate
axis background/.style={ fill=white} ,
xlabel=$ x $ ,
ylabel=$ y $ ,
tick align=outside,
minor tick num=-3,
enlargelimits=true,
tension=0.08]
\addplot [domain=-3:3, thick,samples=50, red] { x*x*x} ;
\addplot [domain=-3:3, thick,samples=50, green] { x*x*x+x*x} ;
\addplot [domain=-3:3, thick,samples=50, blue] { x*x*x+2*x*x} ;
\addplot [domain=-3:3, thick,samples=50, orange] { x*x*x+x} ;
\addlegendentry { $ f _ 1 ( x ) = x ^ 3 $ }
\addlegendentry { $ f _ 2 ( x ) = x ^ 3 + x ^ 2 $ }
\addlegendentry { $ f _ 2 ( x ) = x ^ 3 + 2 \cdot x ^ 2 $ }
\addlegendentry { $ f _ 1 ( x ) = x ^ 3 + x $ }
\end { axis}
\end { tikzpicture}
\caption { Cubic functions}
\end { figure}
%
%\section{Special points}
%\todo[inline]{Write this}
%
%\section{Voronoi}
%
%For $b^2 \geq 3ac$
%
%\todo[inline]{Write this}
\subsection { Calculate points with minimal distance}
2014-01-02 16:16:13 +01:00
\begin { theorem} \label { thm:no-finite-solution}
There cannot be a finite, closed form solution to the problem of finding
2013-12-12 16:22:13 +01:00
a closest point $ ( x, f ( x ) ) $ to a given point $ P $ when $ f $ is
a polynomial function of degree $ 3 $ or higher.
\end { theorem}
\begin { proof}
Suppose you could solve the closest point problem for arbitrary
cubic functions $ f = ax ^ 3 + bx ^ 2 + cx + d $ and arbitrary points $ P = ( x _ P, y _ P ) $ .
Then you could solve the following problem for $ x $ :
\begin { align}
2013-12-20 12:36:06 +01:00
0 & \stackrel { !} { =} \left ((d_ { P,f} (x))^ 2 \right )'\\
2013-12-12 16:22:13 +01:00
& =-2 x_ p + 2x -2y_ p(f(x))' + (f(x)^ 2)'\\
& = 2 f(x) \cdot f'(x) - 2 y_ p f'(x) + 2x - 2 x_ p\\
& = f(x) \cdot f'(x) - y_ p f'(x) + x - x_ p\\
& = \underbrace { f'(x) \cdot \left (f(x) - y_ p \right )} _ { \text { Polynomial of degree 5} } + x - x_ p
\end { align}
General algebraic equations of degree 5 don't have a solution formula.\footnote { TODO: Quelle}
Although here seems to be more structure, the resulting algebraic
2014-01-02 16:16:13 +01:00
equation can be almost any polynomial of degree 5:\footnote { Thanks to Peter Košinár on \href { http://math.stackexchange.com/a/584814/6876} { math.stackexchange.com} for the idea.}
2013-12-12 16:22:13 +01:00
\begin { align}
0 & \stackrel { !} { =} f'(x) \cdot \left (f(x) - y_ p \right ) + (x - x_ p)\\
2014-01-02 16:16:13 +01:00
& = \underbrace { 3 a^ 2} _ { = \tilde { a} } x^ 5 + \underbrace { 5ab} _ { = \tilde { b} } x^ 4 + \underbrace { 2(2ac + b^ 2 )} _ { = \tilde { c} } x^ 3 & +& \underbrace { 3(ad+bc-ay_ p)} _ { = \tilde { d} } x^ 2 \\
& & +& \underbrace { (2 b d+c^ 2+1-2 b y_ p)} _ { = \tilde { e} } x+\underbrace { c d-c y_ p-x_ p} _ { = \tilde { f} } \\
2013-12-12 16:22:13 +01:00
0 & \stackrel { !} { =} \tilde { a} x^ 5 + \tilde { b} x^ 4 + \tilde { c} x^ 3 + \tilde { d} x^ 2 + \tilde { e} x + \tilde { f}
\end { align}
\begin { enumerate}
2014-01-02 16:16:13 +01:00
\item For any coefficient $ \tilde { a } \in \mdr _ { > 0 } $ of $ x ^ 5 $ we can choose $ a : = \frac { 1 } { 3 } \sqrt { \tilde { a } } $ such that we get $ \tilde { a } $ .
\item For any coefficient $ \tilde { b } \in \mdr \setminus \Set { 0 } $ of $ x ^ 4 $ we can choose $ b : = \frac { 1 } { 5 a } \cdot \tilde { b } $ such that we get $ \tilde { b } $ .
\item With $ c : = - 2 b ^ 2 + \frac { 1 } { 4 a } \tilde { c } $ , we can get any value of $ \tilde { c } \in \mdr $ .
\item With $ d : = - bc + a y _ p + \frac { 1 } { a } \tilde { d } $ , we can get any value of $ \tilde { d } \in \mdr $ .
\item With $ y _ p : = \frac { 1 } { 2 b } ( 2 bd + c ^ 2 ) \cdot \tilde { e } $ , we can get any value of $ \tilde { e } \in \mdr $ .
\item With $ x _ p : = cd - c y _ P + \tilde { f } $ , we can get any value of $ \tilde { f } \in \mdr $ .
2013-12-12 16:22:13 +01:00
\end { enumerate}
The first restriction guaratees that we have a polynomial of
degree 5. The second one is necessary, to get a high range of
$ \tilde { e } $ .
2014-01-02 16:16:13 +01:00
This means that there is no finite solution formula for the problem of
2013-12-12 16:22:13 +01:00
finding the closest points on a cubic function to a given point,
because if there was one, you could use this formula for finding
roots of polynomials of degree 5. $ \qed $
\end { proof}
\subsection { Another approach}
Just like we moved the function $ f $ and the point to get in a
nicer situation, we can apply this approach for cubic functions.
\begin { figure} [htp]
\centering
\begin { tikzpicture}
\begin { axis} [
legend pos=south east,
axis x line=middle,
axis y line=middle,
grid = major,
width=0.8\linewidth ,
height=8cm,
grid style={ dashed, gray!30} ,
xmin=-3, % start the diagram at this x-coordinate
xmax= 3, % end the diagram at this x-coordinate
ymin=-3, % start the diagram at this y-coordinate
ymax= 3, % end the diagram at this y-coordinate
axis background/.style={ fill=white} ,
xlabel=$ x $ ,
ylabel=$ y $ ,
tick align=outside,
minor tick num=-3,
enlargelimits=true,
tension=0.08]
\addplot [domain=-3:3, thick,samples=50, red] { x*x*x} ;
\addplot [domain=-3:3, thick,samples=50, green] { x*x*x+x} ;
\addplot [domain=-3:3, thick,samples=50, orange] { x*x*x-x} ;
\addplot [domain=-3:3, thick,samples=50, blue, dotted] { x*x*x+2*x} ;
\addplot [domain=-3:3, thick,samples=50, lime, dashed] { x*x*x+3*x} ;
\addlegendentry { $ f _ 1 ( x ) = x ^ 3 $ }
\addlegendentry { $ f _ 2 ( x ) = x ^ 3 + x $ }
\addlegendentry { $ f _ 1 ( x ) = x ^ 3 - x $ }
\addlegendentry { $ f _ 2 ( x ) = x ^ 3 + 2 \cdot x $ }
\addlegendentry { $ f _ 2 ( x ) = x ^ 3 + 3 \cdot x $ }
\end { axis}
\end { tikzpicture}
\caption { Cubic functions with $ b = d = 0 $ }
\end { figure}
2014-01-02 16:16:13 +01:00
First, we move $ f _ 0 $ by $ \frac { b } { 3 a } $ in $ x $ direction, so
2013-12-12 16:22:13 +01:00
\[ f _ 1 ( x ) = ax ^ 3 + \frac { b ^ 2 ( c - 1 ) } { 3 a } x + \frac { 2 b ^ 3 } { 27 a ^ 2 } - \frac { bc } { 3 a } + d \; \; \; \text { and } \; \; \; P _ 1 = ( x _ P + \frac { b } { 3 a } , y _ P ) \]
because
\begin { align}
f_ 1(x) & = a \left (x - \frac { b} { 3a} \right )^ 3 + b \left (x-\frac { b} { 3a} \right )^ 2 + c \left (x-\frac { b} { 3a} \right ) + d\\
& = a \left (x^ 3 - 3 \frac { b} { 3a} x^ 2 + 3 (\frac { b} { 3a} )^ 2 x - \frac { b^ 3} { 27a^ 3} \right )
+b \left (x^ 2 - \frac { 2b} { 3a} x + \frac { b^ 2} { 9a^ 2} \right )
+c x - \frac { bc} { 3a} + d\\
& = ax^ 3 - bx^ 2 + \frac { b^ 2} { 3a} x - \frac { b^ 3} { 27 a^ 2} \\
& \; \; \; \; \; \; + bx^ 2 - \frac { 2b^ 2} { 3a} x + \frac { b^ 3} { 9a^ 2} \\
& \; \; \; \; \; \; \; \; \; \; \; \; + c x - \frac { bc} { 3a} + d\\
& = ax^ 3 + \frac { b^ 2} { 3a} \left (1-2+c \right )x + \frac { b^ 3} { 9a^ 2} \left (1-\frac { 1} { 3} \right )- \frac { bc} { 3a} + d
\end { align}
2014-01-02 16:16:13 +01:00
The we move it in $ y $ direction by $ - ( \frac { 2 b ^ 3 } { 27 a ^ 2 } - \frac { bc } { 3 a } + d ) $ :
\[ f _ 2 ( x ) = ax ^ 3 + \frac { b ^ 2 ( c - 1 ) } { 3 a } x \; \; \; \text { and } \; \; \; P _ 2 = ( x _ P + \frac { b } { 3 a } , y _ P - ( \frac { 2 b ^ 3 } { 27 a ^ 2 } - \frac { bc } { 3 a } + d ) ) \]
Multiply everything by $ \sgn ( a ) $ :
\[ f _ 3 ( x ) = \underbrace { |a| } _ { = : \alpha } x ^ 3 + \underbrace { \frac { b ^ 2 ( c - 1 ) } { 3 |a| } } _ { = : \beta } x \; \; \; \text { and } \; \; \; P _ 2 = ( x _ P + \frac { b } { 3 a } , \sgn ( a ) ( y _ P - \frac { 2 b ^ 3 } { 27 a ^ 2 } + \frac { bc } { 3 a } - d ) ) \]
Now the problem seems to be much simpler. The function $ \alpha x ^ 3 + \beta x $
with $ \alpha > 0 $ is centrally symmetric to $ ( 0 , 0 ) $ .
\todo [inline] { Und weiter?}
2013-12-12 16:22:13 +01:00
\subsection { Number of points with minimal distance}
As this leads to a polynomial of degree 5 of which we have to find
roots, there cannot be more than 5 solutions.
\todo [inline] { Can there be 3, 4 or even 5 solutions? Examples!
After looking at function graphs of cubic functions, I'm pretty
sure that there cannot be 4 or 5 solutions, no matter how you
chose the cubic function $ f $ and $ P $ .
I'm also pretty sure that there is no polynomial (no matter what degree)
that has more than 3 solutions.}
\subsection { Interpolation and approximation}
\subsubsection { Quadratic spline interpolation}
You could interpolate the cubic function by a quadratic spline.
\subsubsection { Bisection method}
\todo [inline] { TODO}
\subsubsection { Newtons method}
One way to find roots of functions is Newtons method. It gives an
iterative computation procedure that can converge quadratically
if some conditions are met:
2014-01-09 07:04:01 +01:00
\begin { theorem} [local quadratic convergence of Newton's method\footnotemark ]
2013-12-12 16:22:13 +01:00
Let $ D \subseteq \mdr ^ n $ be open and $ f: D \rightarrow \mdr ^ n \in C ^ 2 ( \mdr ) $ .
Let $ x ^ * \in D $ with $ f ( x ^ * ) = 0 $ and the Jaccobi-Matrix $ f' ( x ^ * ) $
should not be invertable when evaluated at the root.
Then there is a sphere
\[ K : = K _ \rho ( x ^ * ) = \Set { x \in \mdr ^ n | \| x - x ^ * \| _ \infty \leq \rho } \subseteq D \]
such that $ x ^ * $ is the only root of $ f $ in $ K $ . Furthermore,
the elements of the sequence
\[ x _ { n + 1 } = x _ n - \frac { f' ( x _ n ) } { f ( x _ n ) } \]
are for every starting value $ x _ 0 \in K $ again in $ K $ and
\[ \lim _ { n \rightarrow \infty } x _ k = x ^ * \]
Also, there is a constant $ C > 0 $ such that
\[ \| x ^ * - x _ { n + 1 } \| = C \| x ^ * - x _ n \| ^ 2 \text { for } n \in \mathbb { N } _ 0 \| \]
\end { theorem}
2014-01-09 07:04:01 +01:00
\footnotetext { Translated from German to English from lecture notes of "Numerische Mathematik für die Fachrichtung Informatik
und Ingenieurwesen" by Dr. Weiß, KIT}
2013-12-12 16:22:13 +01:00
The approach is extraordinary simple. You choose a starting value
$ x _ 0 $ and compute
\[ x _ { n + 1 } = x _ n - \frac { f ( x _ n ) } { f' ( x _ n ) } \]
As soon as the values don't change much, you are close to a root.
The problem of this approach is choosing a starting value that is
close enough to the root. So we have to have a \enquote { good}
initial guess.
2013-12-12 23:05:04 +01:00
\clearpage
2013-12-12 16:22:13 +01:00
2013-12-30 00:02:54 +01:00
\subsubsection { Muller's method}
Muller's method was first presented by David E. Muller in 1956.
2014-01-09 07:04:01 +01:00
\todo [inline] { Paper? Might this be worth a try?}
2013-12-30 00:02:54 +01:00
\subsubsection { Bisection method}
The idea of the bisection method is the following:
Suppose you know a finite intervall $ [ a,b ] $ in which you have
exactly one root $ r \in ( a,b ) $ with $ f ( r ) = 0 $ .
Then you can half that interval:
\[ [ a, b ] = \left [ a, \frac { a + b } { 2 } \right ] \cup \left [ \frac { a + b } { 2 } , b \right ] \]
Now three cases can occur:
\begin { enumerate}
\item [Case 1] $ f ( \frac { a + b } { 2 } ) = 0 $ : You have found the exact root.
\item [Case 2] $ \sgn ( a ) = \sgn ( \frac { a + b } { 2 } ) $ : Continue searching in $ [ \frac { a + b } { 2 } , b ] $
\item [Case 3] $ \sgn ( b ) = \sgn ( \frac { a + b } { 2 } ) $ : Continue searching in $ [ a, \frac { a + b } { 2 } ] $
\end { enumerate}
2014-01-09 07:04:01 +01:00
\todo [inline] { Which intervall can I choose? How would I know that there is exactly one root?}
2013-12-30 00:02:54 +01:00
\subsubsection { Bairstow's method}
Cite from Wikipedia:
The algorithm first appeared in the appendix of the 1920 book "Applied Aerodynamics" by Leonard Bairstow. The algorithm finds the roots in complex conjugate pairs using only real arithmetic.
[...]
\todo [inline] { Find a source for the following!}
A particular kind of instability is observed when the polynomial has odd degree and only one real root.
2013-12-16 11:56:21 +01:00
\section { Defined on a closed interval $ [ a,b ] \subseteq \mdr $ }
2013-12-30 00:02:54 +01:00
The point with minimum distance can be found by:
\[ \underset { x \in [ a,b ] } { \arg \min d _ { P,f } ( x ) } = \begin { cases }
S_ 3(f, P) & \text { if } S_ 3(f, P) \cap [a,b] \neq \emptyset \\
TODO & \text { if } S_ 3(f, P) \cap [a,b] = \emptyset
\end { cases} \]