How to solve a differential equation including $\ddot{x}\dot{x}$ term? I have the following differential equation
$$ m \ddot{x} \dot{x} + f \dot{x} = p $$
where $m > 0$, $f > 0$, $p > 0$ are constants. How to solve it analytically?
 A: Let $v(t)\frac{dx(t)}{dt}$. Then, note that $\frac12\frac{dv^2(t)}{dt}=x'(t)x''(t)$, where $x''(t)=\frac{dv(t)}{dt}$.  
Hence, we have
$$\begin{align}
mx'(t)x''(t)&=\frac12m\frac{dv^2(t)}{dt}\\\\
&=-f\frac{dx(t)}{dt}+p\tag 1
\end{align}$$
Integrating both sides of $(1)$ from $0$ to $t$ yields
$$\begin{align}
\frac12m(v^2(t)-v(0)^2)&=-f\int_0^t \,\frac{dx(t)}{dt'}\,dt'+pt\\\\
&=-f(x(t)-x(0))+pt
\end{align}$$
A: $$m\ddot{x}\dot{x}+f\dot{x}=p$$
$$\frac{dx}{dt}=y(t)\quad\to\quad m\frac{dy}{dt}y+f\:y=p$$
This is a separable ODE :
$$dt=m\frac{y}{p-f\:y}dy$$
Integration $\quad\to\quad t-t_0=-\frac{m}{f^2}\left(f\:y+p\ln|p-f\:y| \right)$
Solving this equation for $y$ requires a special function, the Lambert W(X) function.
$$y=\frac{p}{f}+\frac{p}{f} W\left(X \right) \quad\text{where}\quad X=-\frac{1}{p}e^{-1-\frac{f^2}{mp}(t-t_0)}$$
$$x(t)=\int ydt=\int\left(\frac{p}{f}+\frac{p}{f} W\left(-\frac{1}{p}e^{-1-\frac{f^2}{mp}(t-t_0)} \right) \right)dt$$
Using the known integral $$\int W\left(e^\chi \right)d\chi=\frac{1}{2}\left(W\left(e^\chi \right)+1 \right)^2+\text{constant}$$ the above integral leads to
$$\begin{cases}
x(t)=\frac{p\:t}{f}-\frac{mp^2}{2f^3}\left(W(X)+1 \right)^2+\text{constant} \\
\text{where }\quad X=-\frac{1}{p}e^{-1-\frac{f^2}{mp}(t-t_0)}
\end{cases}$$
