math-minimal-distance-to-cubic-function.tex 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. \documentclass[a4paper]{scrartcl}
  2. \usepackage{amssymb, amsmath} % needed for math
  3. \usepackage{mathtools} % \xRightarrow
  4. \usepackage[utf8]{inputenc} % this is needed for umlauts
  5. \usepackage[english]{babel} % this is needed for umlauts
  6. \usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
  7. \usepackage[margin=2.5cm]{geometry} %layout
  8. \usepackage{hyperref} % links im text
  9. \usepackage{braket} % needed for \Set
  10. \usepackage{parskip}
  11. \usepackage[colorinlistoftodos]{todonotes}
  12. \usepackage{pgfplots}
  13. \pgfplotsset{compat=1.7,compat/path replacement=1.5.1}
  14. \usepackage{tikz}
  15. \usepackage[framed,amsmath,thmmarks,hyperref]{ntheorem}
  16. \usepackage{framed}
  17. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  18. % Define theorems %
  19. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  20. \theoremstyle{break}
  21. \setlength\theoremindent{0.7cm}
  22. \theoremheaderfont{\kern-0.7cm\normalfont\bfseries}
  23. \theorembodyfont{\normalfont} % nicht mehr kursiv
  24. \newframedtheorem{theorem}{Theorem}
  25. \newframedtheorem{lemma}[theorem]{Lemma}
  26. \newtheorem{plaindefinition}{Definition}
  27. \newenvironment{definition}{\begin{plaindefinition}}{\end{plaindefinition}}
  28. \newenvironment{definition*}{\begin{plaindefinition*}}{\end{plaindefinition*}}
  29. \newtheorem{example}{Example}
  30. \theoremstyle{nonumberplain}
  31. \newtheorem{proof}{Proof:}
  32. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  33. \title{Minimal distance to a cubic function}
  34. \author{Martin Thoma}
  35. \hypersetup{
  36. pdfauthor = {Martin Thoma},
  37. pdfkeywords = {},
  38. pdftitle = {Minimal Distance}
  39. }
  40. \def\mdr{\ensuremath{\mathbb{R}}}
  41. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  42. % Begin document %
  43. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  44. \begin{document}
  45. \maketitle
  46. \begin{abstract}
  47. When you want to develop a selfdriving car, you have to plan which path
  48. it should take. A reasonable choice for the representation of
  49. paths are cubic splines. You also have to be able to calculate
  50. how to steer to get or to remain on a path. A way to do this
  51. is applying the \href{https://en.wikipedia.org/wiki/PID_algorithm}{PID algorithm}.
  52. This algorithm needs to know the signed current error. So you need to
  53. be able to get the minimal distance of a point to a cubic spline combined with the direction (left or right).
  54. As you need to get the signed error (and one steering direction might
  55. be prefered), it is not only necessary to
  56. get the minimal absolute distance, but also to get all points
  57. on the spline with minimal distance.
  58. In this paper I want to discuss how to find all points on a cubic
  59. function with minimal distance to a given point.
  60. As other representations of paths might be easier to understand and
  61. to implement, I will also cover the problem of finding the minimal
  62. distance of a point to a polynomial of degree 0, 1 and 2.
  63. \end{abstract}
  64. \section{Description of the Problem}
  65. Let $f: \mdr \rightarrow \mdr$ be a polynomial function and $P \in \mdr^2$
  66. be a point. Let $d_{P,f}: \mdr \rightarrow \mdr_0^+$
  67. be the Euklidean distance $d_{P,f}$ of a point $P$ and a point $\left (x, f(x) \right )$:
  68. \[d_{P,f} (x) := \sqrt{(x_P - x)^2 + (y_P - f(x))^2}\]
  69. Now there is \todo{Should I proof this?}{finite set} $x_1, \dots, x_n$ such that
  70. \[\forall \tilde x \in \mathbb{R} \setminus \{x_1, \dots, x_n\}: d_{P,f}(x_1) = \dots = d_{P,f}(x_n) < d_{P,f}(\tilde x)\]
  71. Essentially, you want to find the minima $x_1, \dots, x_n$ for given
  72. $f$ and $P$.
  73. But minimizing $d_{P,f}$ is the same as minimizing $d_{P,f}^2$:
  74. \begin{align}
  75. d_{P,f}(x)^2 &= \sqrt{(x_P - x)^2 + (y_P - f(x))^2}^2\\
  76. &= x_p^2 - 2x_p x + x^2 + y_p^2 - 2y_p f(x) + f(x)^2
  77. \end{align}
  78. \todo[inline]{Hat dieser Satz einen Namen? Gibt es ein gutes Buch,
  79. aus dem ich den zitieren kann? Ich habe ihn aus \href{https://github.com/MartinThoma/LaTeX-examples/tree/master/documents/Analysis I}{meinem Analysis I Skript} (Satz 21.5).}
  80. \begin{theorem}\label{thm:required-extremum-property}
  81. Let $x_0$ be a relative extremum of a differentiable function $f: \mathbb{R} \rightarrow \mathbb{R}$.
  82. Then: $f'(x_0) = 0$.
  83. \end{theorem}
  84. %bzw. 22.3
  85. %\begin{theorem}[Minima of polynomial functions]\label{thm:minima-of-polynomials}
  86. % Let $n \in \mathbb{N}, n \geq 2$, $f$ polynomial function of
  87. % degree $n$, $x_0 \in \mathbb{R}$, \\
  88. % $f'(x_0) = f''(x_0) = \dots = f^{(n-1)} (x_0) = 0$
  89. % and $f^{(n)} > 0$.
  90. %
  91. % Then $x_0$ is a local minimum of $f$.
  92. %\end{theorem}
  93. \clearpage
  94. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  95. % Constant functions %
  96. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  97. \section{Minimal distance to a constant function}
  98. Let $f(x) = c$ with $c \in \mdr$ be a constant function.
  99. \begin{figure}[htp]
  100. \centering
  101. \begin{tikzpicture}
  102. \begin{axis}[
  103. legend pos=north west,
  104. axis x line=middle,
  105. axis y line=middle,
  106. grid = major,
  107. width=0.8\linewidth,
  108. height=8cm,
  109. grid style={dashed, gray!30},
  110. xmin=-5, % start the diagram at this x-coordinate
  111. xmax= 5, % end the diagram at this x-coordinate
  112. ymin= 0, % start the diagram at this y-coordinate
  113. ymax= 3, % end the diagram at this y-coordinate
  114. axis background/.style={fill=white},
  115. xlabel=$x$,
  116. ylabel=$y$,
  117. tick align=outside,
  118. minor tick num=-3,
  119. enlargelimits=true,
  120. tension=0.08]
  121. \addplot[domain=-5:5, thick,samples=50, red] {1};
  122. \addplot[domain=-5:5, thick,samples=50, green] {2};
  123. \addplot[domain=-5:5, thick,samples=50, blue] {3};
  124. \addplot[black, mark = *, nodes near coords=$P$,every node near coord/.style={anchor=225}] coordinates {(2, 2)};
  125. \addplot[blue, mark = *, nodes near coords=$P_{h,\text{min}}$,every node near coord/.style={anchor=225}] coordinates {(2, 3)};
  126. \addplot[green, mark = x, nodes near coords=$P_{g,\text{min}}$,every node near coord/.style={anchor=120}] coordinates {(2, 2)};
  127. \addplot[red, mark = *, nodes near coords=$P_{f,\text{min}}$,every node near coord/.style={anchor=225}] coordinates {(2, 1)};
  128. \draw[thick, dashed] (axis cs:2,0) -- (axis cs:2,3);
  129. \addlegendentry{$f(x)=1$}
  130. \addlegendentry{$g(x)=2$}
  131. \addlegendentry{$h(x)=3$}
  132. \end{axis}
  133. \end{tikzpicture}
  134. \caption{Three constant functions and their points with minimal distance}
  135. \label{fig:constant-min-distance}
  136. \end{figure}
  137. Then $(x_P,f(x_P))$ has
  138. minimal distance to $P$. Every other point has higher distance.
  139. See Figure~\ref{fig:constant-min-distance}.
  140. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  141. % Linear functions %
  142. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  143. \section{Minimal distance to a linear function}
  144. Let $f(x) = m \cdot x + t$ with $m \in \mdr \setminus \Set{0}$ and
  145. $t \in \mdr$ be a linear function.
  146. \begin{figure}[htp]
  147. \centering
  148. \begin{tikzpicture}
  149. \begin{axis}[
  150. legend pos=north east,
  151. axis x line=middle,
  152. axis y line=middle,
  153. grid = major,
  154. width=0.8\linewidth,
  155. height=8cm,
  156. grid style={dashed, gray!30},
  157. xmin= 0, % start the diagram at this x-coordinate
  158. xmax= 5, % end the diagram at this x-coordinate
  159. ymin= 0, % start the diagram at this y-coordinate
  160. ymax= 3, % end the diagram at this y-coordinate
  161. axis background/.style={fill=white},
  162. xlabel=$x$,
  163. ylabel=$y$,
  164. tick align=outside,
  165. minor tick num=-3,
  166. enlargelimits=true,
  167. tension=0.08]
  168. \addplot[domain=-5:5, thick,samples=50, red] {0.5*x};
  169. \addplot[domain=-5:5, thick,samples=50, blue] {-2*x+6};
  170. \addplot[black, mark = *, nodes near coords=$P$,every node near coord/.style={anchor=225}] coordinates {(2, 2)};
  171. \addlegendentry{$f(x)=\frac{1}{2}x$}
  172. \addlegendentry{$g(x)=-2x+6$}
  173. \end{axis}
  174. \end{tikzpicture}
  175. \caption{The shortest distance of $P$ to $f$ can be calculated by using the perpendicular}
  176. \label{fig:linear-min-distance}
  177. \end{figure}
  178. Now you can drop a perpendicular $f_\bot$ through $P$ on $f(x)$. The slope of $f_\bot$
  179. is $- \frac{1}{m}$. Now you can calculate $f_\bot$:\nobreak
  180. \begin{align}
  181. f_\bot(x) &= - \frac{1}{m} \cdot x + t_\bot\\
  182. \Rightarrow y_P &= - \frac{1}{m} \cdot x_P + t_\bot\\
  183. \Leftrightarrow t_\bot &= y_P + \frac{1}{m} \cdot x_P
  184. \end{align}
  185. Now find the point $(x, f(x))$ where the perpendicular crosses the function:
  186. \begin{align}
  187. f(x) &= f_\bot(x)\\
  188. \Leftrightarrow m \cdot x + t &= - \frac{1}{m} \cdot x + \left(y_P + \frac{1}{m} \cdot x_P \right)\\
  189. \Leftrightarrow \left (m + \frac{1}{m} \right ) \cdot x &= y_P + \frac{1}{m} \cdot x_P - t\\
  190. \Leftrightarrow x &= \frac{m}{m^2+1} \left ( y_P + \frac{1}{m} \cdot x_P - t \right )
  191. \end{align}
  192. There is only one point with minimal distance. See Figure~\ref{fig:linear-min-distance}.
  193. \clearpage
  194. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  195. % Quadratic functions %
  196. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  197. \section{Minimal distance to a quadratic function}
  198. Let $f(x) = a \cdot x^2 + b \cdot x + c$ with $a \in \mdr \setminus \Set{0}$ and
  199. $b, c \in \mdr$ be a quadratic function.
  200. \begin{figure}[htp]
  201. \centering
  202. \begin{tikzpicture}
  203. \begin{axis}[
  204. legend pos=north west,
  205. axis x line=middle,
  206. axis y line=middle,
  207. grid = major,
  208. width=0.8\linewidth,
  209. height=8cm,
  210. grid style={dashed, gray!30},
  211. xmin=-3, % start the diagram at this x-coordinate
  212. xmax= 3, % end the diagram at this x-coordinate
  213. ymin=-0.25, % start the diagram at this y-coordinate
  214. ymax= 9, % end the diagram at this y-coordinate
  215. axis background/.style={fill=white},
  216. xlabel=$x$,
  217. ylabel=$y$,
  218. %xticklabels={-2,-1.6,...,7},
  219. %yticklabels={-8,-7,...,8},
  220. tick align=outside,
  221. minor tick num=-3,
  222. enlargelimits=true,
  223. tension=0.08]
  224. \addplot[domain=-3:3, thick,samples=50, red] {0.5*x*x};
  225. \addplot[domain=-3:3, thick,samples=50, green] {x*x};
  226. \addplot[domain=-3:3, thick,samples=50, blue] {x*x + x};
  227. \addplot[domain=-3:3, thick,samples=50, orange] {x*x + 2*x};
  228. \addplot[domain=-3:3, thick,samples=50, black] {-x*x + 6};
  229. \addlegendentry{$f_1(x)=\frac{1}{2}x^2$}
  230. \addlegendentry{$f_2(x)=x^2$}
  231. \addlegendentry{$f_3(x)=x^2+x$}
  232. \addlegendentry{$f_4(x)=x^2+2x$}
  233. \addlegendentry{$f_5(x)=-x^2+6$}
  234. \end{axis}
  235. \end{tikzpicture}
  236. \caption{Quadratic functions}
  237. \end{figure}
  238. \subsection{Calculate points with minimal distance}
  239. In this case, $d_{P,f}^2$ is polynomial of degree 4.
  240. We use Theorem~\ref{thm:required-extremum-property}:\nobreak
  241. \begin{align}
  242. 0 &\overset{!}{=} (d_{P,f}^2)'\\
  243. &= -2 x_p + 2x -2y_p f'(x) + \left (f(x)^2 \right )'\\
  244. &= -2 x_p + 2x -2y_p f'(x) + 2 f(x) \cdot f'(x) \rlap{\hspace*{3em}(chain rule)}\label{eq:minimizingFirstDerivative}\\
  245. \Leftrightarrow 0 &\overset{!}{=} -x_p + x -y_p f'(x) + f(x) \cdot f'(x) \rlap{\hspace*{3em}(divide by 2)}\label{eq:minimizingFirstDerivative}\\
  246. &= -x_p + x -y_p (2ax+b) + (ax^2+bx+c)(2ax+b)\\
  247. &= -x_p + x -y_p \cdot 2ax- y_p b + (2 a^2 x^3+2 a b x^2+2 a c x+ab x^2+b^2 x+bc)\\
  248. &= -x_p + x -2y_p ax- y_p b + (2a^2 x^3 + 3 ab x^2 + 2acx + b^2 x + bc)\\
  249. &= 2a^2 x^3 + 3 ab x^2 + (1 -2y_p a+ 2ac + b^2)x +(bc-by_p-x_p)
  250. \end{align}
  251. %\begin{align}
  252. % 0 &\overset{!}{=}(d_{P,f}^2)''\\
  253. % &= 2 - 2y_p f''(x) + \left ( 2 f(x) \cdot f'(x) \right )' \rlap{\hspace*{3em}(Eq. \ref{eq:minimizingFirstDerivative})}\\
  254. % &= 2 - 2y_p f''(x) + 2 \cdot \left ( f'(x) \cdot f'(x) + f(x) \cdot f''(x) \right ) \rlap{\hspace*{3em}(product rule)}\\
  255. % &= 2 - 2y_p f''(x) + 2 \cdot \left ( f'(x)^2 + f(x) \cdot f''(x) \right )\\
  256. % &= 12a^2 x^2 + 12abx + 2(1 -2y_p a+ 2ac + b^2)
  257. %\end{align}
  258. This is an algebraic equation of degree 3.
  259. There can be up to 3 solutions in such an equation. Those solutions
  260. can be found with a closed formula.
  261. \todo[inline]{Where are those closed formulas?}
  262. \begin{example}
  263. Let $a = 1, b = 0, c= 1, x_p= 0, y_p = 1$.
  264. So $f(x) = x^2 + 1$ and $P(0, 1)$.
  265. \begin{align}
  266. 0 &\stackrel{!}{=} 4 x^3 - 2x\\
  267. &=2x(2x^2 - 1)\\
  268. \Rightarrow x_1 &= 0 \;\;\; x_{2,3} = \pm \frac{1}{\sqrt{2}}
  269. \end{align}
  270. As you can easily verify, only $x_1$ is a minimum of $d_{P,f}$.
  271. \end{example}
  272. \subsection{Number of points with minimal distance}
  273. It is obvious that a quadratic function can have two points with
  274. minimal distance.
  275. For example, let $f(x) = x^2$ and $P = (0,5)$. Then $P_{f,1} \approx (2.179, 2.179^2)$
  276. has minimal distance to $P$, but also $P_{f,2}\approx (-2.179, 2.179^2)$.\todo{exact example?}
  277. As discussed before, there cannot be more than 3 points on the graph
  278. of $f$ next to $P$.
  279. \todo[inline]{But can there be three points? O.b.d.A: $a > 0$.
  280. As $c$ is moves the curve only up and down, we can o.b.d.A assume
  281. that $c=0$.
  282. $x=-\frac{b}{2a}$ is the minimum of $f$. If there are 3 points, this will
  283. be one of them. The other two ones are symmetric by an axis through
  284. $-\frac{b}{2a}$}
  285. \begin{figure}[htp]
  286. \centering
  287. \begin{tikzpicture}
  288. \begin{axis}[
  289. legend pos=north west,
  290. axis x line=middle,
  291. axis y line=middle,
  292. grid = major,
  293. width=0.8\linewidth,
  294. height=8cm,
  295. grid style={dashed, gray!30},
  296. xmin=-0.7, % start the diagram at this x-coordinate
  297. xmax= 0.7, % end the diagram at this x-coordinate
  298. ymin=-0.25, % start the diagram at this y-coordinate
  299. ymax= 0.5, % end the diagram at this y-coordinate
  300. axis background/.style={fill=white},
  301. xlabel=$x$,
  302. ylabel=$y$,
  303. %xticklabels={-2,-1.6,...,7},
  304. %yticklabels={-8,-7,...,8},
  305. tick align=outside,
  306. minor tick num=-3,
  307. enlargelimits=true,
  308. tension=0.08]
  309. \addplot[domain=-0.7:0.7, thick,samples=50, orange] {x*x};
  310. \draw (axis cs:0,0.5) circle[radius=0.5];
  311. \draw[red, thick] (axis cs:0,0.5) -- (axis cs:0.101,0.0102);
  312. \draw[red, thick] (axis cs:0,0.5) -- (axis cs:-0.101,0.0102);
  313. \draw[red, thick] (axis cs:0,0.5) -- (axis cs:0,0);
  314. \addlegendentry{$f(x)=x^2$}
  315. \end{axis}
  316. \end{tikzpicture}
  317. \caption{3 points with minimal distance?}
  318. \end{figure}
  319. \clearpage
  320. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  321. % Cubic %
  322. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  323. \section{Minimal distance to a cubic function}
  324. Let $f(x) = a \cdot x^3 + b \cdot x^2 + c \cdot x + d$ be a cubic function
  325. with $a \in \mdr \setminus \Set{0}$ and
  326. $b, c, d \in \mdr$ be a function.
  327. \begin{figure}[htp]
  328. \centering
  329. \begin{tikzpicture}
  330. \begin{axis}[
  331. legend pos=south east,
  332. axis x line=middle,
  333. axis y line=middle,
  334. grid = major,
  335. width=0.8\linewidth,
  336. height=8cm,
  337. grid style={dashed, gray!30},
  338. xmin=-3, % start the diagram at this x-coordinate
  339. xmax= 3, % end the diagram at this x-coordinate
  340. ymin=-3, % start the diagram at this y-coordinate
  341. ymax= 3, % end the diagram at this y-coordinate
  342. axis background/.style={fill=white},
  343. xlabel=$x$,
  344. ylabel=$y$,
  345. %xticklabels={-2,-1.6,...,7},
  346. %yticklabels={-8,-7,...,8},
  347. tick align=outside,
  348. minor tick num=-3,
  349. enlargelimits=true,
  350. tension=0.08]
  351. \addplot[domain=-3:3, thick,samples=50, red] {x*x*x};
  352. \addplot[domain=-3:3, thick,samples=50, green] {x*x*x+x*x};
  353. \addplot[domain=-3:3, thick,samples=50, blue] {x*x*x+2*x*x};
  354. \addplot[domain=-3:3, thick,samples=50, orange] {x*x*x+x};
  355. \addlegendentry{$f_1(x)=x^3$}
  356. \addlegendentry{$f_2(x)=x^3 + x^2$}
  357. \addlegendentry{$f_2(x)=x^3 + 2 \cdot x^2$}
  358. \addlegendentry{$f_1(x)=x^3 + x$}
  359. \end{axis}
  360. \end{tikzpicture}
  361. \caption{Cubic functions}
  362. \end{figure}
  363. %
  364. %\subsection{Special points}
  365. %\todo[inline]{Write this}
  366. %
  367. %\subsection{Voronoi}
  368. %
  369. %For $b^2 \geq 3ac$
  370. %
  371. %\todo[inline]{Write this}
  372. \subsection{Calculate points with minimal distance}
  373. When you want to calculate points with minimal distance, you can
  374. take the same approach as in Equation \ref{eq:minimizingFirstDerivative}:
  375. \begin{align}
  376. 0 &\stackrel{!}{=} -2 x_p + 2x -2y_p(f(x))' + (f(x)^2)'\\
  377. &= 2 f(x) \cdot f'(x) - 2 y_p f'(x) + 2x - 2 x_p\\
  378. &= f(x) \cdot f'(x) - y_p f'(x) + x - x_p\\
  379. &= \underbrace{f'(x) \cdot \left (f(x) - y_p \right )}_{\text{Polynomial of degree 5}} + \underbrace{x - x_p}_{\text{:-(}}
  380. \end{align}
  381. \todo[inline]{Although general algebraic equations of degree 5 don't
  382. have a solution formula, the special structure might give the
  383. possibilty to find a closed form solution. But I don't know how.
  384. This is a first-order nonlinear ordinary differential equation - does this help?}
  385. \subsection{Number of points with minimal distance}
  386. As there is an algebraic equation of degree 5, there cannot be more
  387. than 5 solutions.
  388. \todo[inline]{Can there be 3, 4 or even 5 solutions? Examples!
  389. After looking at function graphs of cubic functions, I'm pretty
  390. sure that there cannot be 4 or 5 solutions, no matter how you
  391. chose the cubic function $f$ and $P$.
  392. I'm also pretty sure that there is no polynomial (no matter what degree)
  393. that has more than 3 solutions.}
  394. \todo[inline]{If there is no closed form solution, I want to
  395. describe a numerical solution. I guess Newtons method might be good.}
  396. \end{document}