Higher order derivatives - Equation of motion One possible starting point to create a physical theory is the Lagrangian $L$. There we assume that the variation of the action $\delta S = \delta \int_{-\infty}^\infty dt \ L = 0$.
In classical theories we usually only use $q$ and $\dot{q}$ in the Lagrangian. But there are also effects like the Abraham-Lorentz force, which describes a force $F(q) = \alpha \dddot{q}$, where $\alpha$ is a constant and $q$ is the location of a particle. This would require a higher order derivatives in the Lagrangian.
Now I wondered if it is even possible to write down a Lagrangian for such a force, that contains a third derivative in time?
Maybe a similar question is if it is possible to get a Lagrangian that results in a friction force $m\ddot{q} = - \gamma\dot{q}$?
 A: I) Concerning an action principle $S=\int\!dt~ L$, let us assume that the Lagrangian is of the form 
$$\tag{1}  L~=~T-U,$$
where $T$ is the kinetic term, and $U({\bf r},\dot{\bf r}, \ddot{\bf r},\dddot{\bf r}, \ldots;t)$ is a generalized potential, which we would like to find. The generalized potential $U$ should satisfy
$$\tag{2} {\bf F}~=~-\frac{\partial U}{\partial {\bf r}} 
  +\frac{d}{dt}\frac{\partial U}{\partial \dot{\bf r}}
-\frac{d^2}{dt^2}\frac{\partial U}{\partial \ddot{\bf r}} 
+\frac{d^3}{dt^3}\frac{\partial U}{\partial \dddot{\bf r}} - \ldots, $$
where ${\bf F}({\bf r},\dot{\bf r}, \ddot{\bf r}, \dddot{\bf r}, \ldots;t)$ is a given total force on the point particle.
II) Let us for fun consider a force proportional to the $n$'th time-derivative of the position
$$\tag{3} {\bf F}~=~-k \frac{d^n{\bf r}}{dt^n} $$
for any non-negative integer $n\in\mathbb{N}_0$. For an even integer $n$, we can use the generalized potential
$$\tag{4} U~=~ (-1)^{\frac{n}{2}}\frac{k}{2} \left(\frac{d^{\frac{n}{2}}{\bf r}}{dt^{\frac{n}{2}}} \right)^2. $$
The case $n=0$ of a force proportional to the position
$$\tag{5} {\bf F}~=~-k {\bf r}, \qquad U ~=~\frac{k}{2}{\bf r}^2,  \qquad k~>~0, $$ 
is the well-known Hooke's law/harmonic oscillator.
The case $n=2$ of an applied force proportional to the acceleration
$$\tag{6} {\bf F}~=~-k \ddot{\bf r}, \qquad U ~=~-\frac{k}{2}\dot{\bf r}^2,  \qquad  $$ 
behaves like a (non-relativistic) kinetic term.
The case $n=1$ of a friction force proportional to the velocity
$$\tag{7} {\bf F}~=~-k \dot{\bf r}, \qquad k~>~0,$$ 
is discussed in e.g. this Phys.SE post and this mathoverflow post. More generally, using very similar methods as in these two posts, one may show that it is impossible to assign a generalized potential $U$ to the force (3) for any odd positive integer $n$. So in particular, the case $n=3$, the Abraham-Lorentz force $^1$ proportional to the jerk
$$\tag{8} {\bf F}~=~-k \dddot{\bf r}\qquad k~<~0,$$ 
does not have a generalized potential $U$. 
--
$^1$ However, see also this related Phys.SE post.
A: The Euler-Lagrange equation for a higher-order Lagrangian $L=L(q,\dot q,\ddot q,\dots\,q^{(n)})$ reads
$$
\frac{\partial L}{\partial q}
- \frac{\mathrm d}{\mathrm dt}\frac{\partial L}{\partial\dot q}
+ \frac{\mathrm d^2}{\mathrm dt^2}\frac{\partial L}{\partial\ddot q}
- \dots
+ (-1)^n \frac{\mathrm d^n}{\mathrm dt^n}\frac{\partial L}{\partial q^{(n)}}
+ Q
= 0
$$
where $Q$ describes the generalized forces that aren't derived from the Lagrangian, eg constraint forces with Lagrange multipliers or friction.
In some cases, it's possible to derive these forces from a dissipation function $R=R(\dot q)$ via
$$
Q=-\frac{\partial R}{\partial\dot q}
$$
I don't see a reason not to introduce dependencies on higher derivatives as well, but I haven't done any research on the subject.
A: Christoph's answer is certainly correct, let me just add a few things:
For the question of higher derivatives, there is this answer from a few years ago. As you see, there is no mathematical problem with Lagrangians involving higher derivatives if we just stay classical, if you can accept an energy that is not bounded below. In quantum theories, however, this creates completely unstable systems, which are certainly not a good description of nature. (Nevertheless, in an effective (i.e non-fundamental) theory, nothing prohibits you from ignoring these problems).
That some friction terms can be obtained from dissipation functions $R(\dot{q})$ is also correct, but this kills off the least action principle, since the equations of motion are no longer the Euler-Lagrange equations, but have the added term ${\partial R} \over {\partial \dot{q}}$. The conceptual reason is that disspative forces are non-conservative, so they cannot come from a potential, and so the Lagrangian as $T - V$ cannot produce them. However, with a bit more calculus, it seems possible to write down a Lagrangian that correctly produces the equation of motion as its Euler-Lagrange equations, as is done in this paper, but this comes with the loss of the interpretation of our Lagrangians and Hamiltonians as simple functions of kinetic and potential energy.
