Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How to solve $$\frac{dv}{dt} = av^2 + bv + c$$ to obtain $x(t)$, where $a$, $b$ and $c$ are constants, $v$ is velocity, $t$ is time and $x$ is position. Boundaries for the first integral are $v_0$, $v_t$ and $0$, $t$ and boundaries for the second integral are $0$, $x_{max}$ and $0$, $t$.

share|improve this question
I am guessing the second term should be $b v$? –  copper.hat May 15 '12 at 18:51
Why don't you ask on physics? You'll get better answers, I think. –  Gigili May 15 '12 at 19:01
Yes you'r right the second term is bv. I posted it on physics too but they proposed me to post it on maths. –  ACL May 15 '12 at 19:36
Am I right in assuming that the speed varies in your example, i.e., we need to solve a differential equation for speed and then integrate? –  Johannes Kloos May 15 '12 at 19:44
Solve for $v(t)$ by separation of variables; then integrate to get $x(t)$. –  Arturo Magidin May 15 '12 at 19:51
add comment

2 Answers

As suggested by Arturo: $$ \begin{eqnarray} \int_{0}^{t} \frac{\dot{v}(t)}{a v(t)^2+ b v(t) + c} \mathrm{d} t &=& \int_0^t \mathrm{d} t \\ \int_{v_0}^{v_t} \frac{\mathrm{d} u}{a u^2 + b u + c} &=& t \\ \int_{v_0}^{v_t} \frac{4 a }{\left(2 a u + b\right)^2 + 4 a c - b^2} \mathrm{d} u &=& t \\ \left.\frac{2}{\sqrt{4 a c - b^2}} \arctan\left(\frac{2 a u + b}{\sqrt{4 c a - b^2}}\right)\right|_{v_0}^{v_t} &=& t \\ \frac{2}{\sqrt{4 a c - b^2}} \arctan\left(\frac{2 a v_t + b}{\sqrt{4 c a - b^2}}\right) &=& \frac{2}{\sqrt{4 a c - b^2}} \arctan\left(\frac{2 a v_0 + b}{\sqrt{4 c a - b^2}}\right) + t \\ \frac{2 a v_t + b}{\sqrt{4 c a - b^2}} &=& \tan\left( \arctan\left(\frac{2 a v_0 + b}{\sqrt{4 c a - b^2}}\right) + \frac{\sqrt{4 c a - b^2}}{2} t \right) \\ \frac{2 a v_t + b}{\sqrt{4 c a - b^2}} &=& \frac{ \frac{2 a v_0 + b}{\sqrt{4 c a - b^2}} + \tan\left(\frac{\sqrt{4 c a - b^2}}{2} t\right)}{1 - \frac{2 a v_0 + b}{\sqrt{4 c a - b^2}} \tan\left(\frac{\sqrt{4 c a - b^2}}{2} t\right)} \end{eqnarray} $$ Now one solves for $v_t$, and integrates over time: $$ x(t) = x(0) + \int_0^t v_t \mathrm{d} t $$

The integral is not likely to admit evaluation in closed form. Typically trajectories for such system are defined parametrically.

As pointed out in @ChristianBlatter answer, the integral is indeed elementary: $$ x(t) = x(0) - \frac{b}{2a} t - \frac{1}{2a} \log\left(\frac{4 a \left(a v_0^2 + b v_0 + c\right)}{4 a c-b^2} \cos^2\left(\frac{t}{2} \sqrt{4 a c - b^2} + \arctan\left(\frac{2 a v_0 + b }{\sqrt{4 a c - b^2}}\right)\right)\right) $$ Here is a comparison of the exact solution to the numerical solution of the differential equation in Mathematica:

enter image description here

Several physical conclusions:

  • if $4 a c - b^2 < 0$, trigonometric cosine becomes hyperbolic cosine, and position $x(t)$ increases with time linearly, approximately linearly.
  • if $4 a c - b^2 > 0$, the position $x(t)$ plunges to $-\infty$ in finite time, determined by zero of the cosine function.
  • if $4 a c = b^2$, the solution is easy to re-derived. It also goes to $-\infty$ in finite time (if $2a v_0 + b > 0$), or goes $\pm\infty$ (if $2 a v_0 + b < 0$), depending on initial conditions: $$ x(t) = x(0) - \frac{ b t}{2a} - \frac{1}{a} \log\left( 1 - \frac{b t}{2} - a t v_0\right) $$
share|improve this answer
Integrating over time gives me (log(tan(atan(b/(4*a*c - b^2)^(1/2) + (2*a*v0)/(4*a*c - b^2)^(1/2)) + (t*(4*a*c - b^2)^(1/2))/2)^2 + 1) - b*t)/(2*a) when I incorportate my a, b, c and v0 values x oscillates and goes to infinite when t = inf. and that doesn't make sense with the physics of my situation so I thought I had made ​​a mistake. –  ACL May 16 '12 at 19:49
@ACL I have extended my answer, with exact solution, comparison with simulation, and analysis of long-time behavior. –  Sasha May 16 '12 at 20:46
add comment

"Separating variables" means writing $${dv\over av^2+bv +c}=dt\ .\qquad(1)$$ The next step depends on the values of $a$, $b$, $c$. Assuming $a>0$ one has $$a v^2+bv +c={1\over a}\Bigl(\bigl(av +{b\over 2}\bigr)^2+{4ac -b^2\over 4}\Bigr)\ ,$$ so that after a linear substitution of the dependent variable $v$ the equation $(1)$ transforms into one of $${du\over 1+u^2}= p\ dt,\quad{du\over u^2}=p\ dt,\quad {du\over u^2-1}=p \ dt\ ,$$ depending on the value of $4ac-b^2$. Up to scalings and shifts the first form implies $$\arctan u = t\quad{\rm or}\quad u=\tan t\ .$$ It follows that (again neglecting scalings and shifts) $$x(t)=\int_{t_0}^t v(t)\ dt=\int _{t_0}^t \tan t\ dt=-\log(\cos t)\Bigr|_{t_0}^t\ .$$

share|improve this answer
And the second form becomes $u = - \tanh t$ and $x(t) = \left. - \log(\cosh t) \right|_{t_0}^t$. –  Robert Israel May 16 '12 at 19:36
Putting back the scalings and shifts, it's $$ x(t) = x_0 -\dfrac {b(t-t_0)}{2a} - \dfrac{\log (\cos(\sqrt{ac-b^2/4}(t-t_0)))}{a}$$ (if $4 ac > b^2$), or $$ x(t) = x_0 -\dfrac {b(t-t_0)}{2a} - \dfrac{\log (\cosh(\sqrt{b^2/4-ac}(t-t_0)))}{a}$$ (if $4ac < b^2$) –  Robert Israel May 16 '12 at 19:52
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.