I have the following differential equation with a reciprocal and a constant:

$$ dx/dt =-\frac{a}{x}-b, $$

where $a$ is a positive constant and $b$ a nonnegative constant. I can solve this for $b=0$. Then (if this is allowed...) $$x dx = -adt.$$ Integrating both sides and summing up the constants of integration gives $$\frac{1}{2} x^2 = -at+C,$$ hence $$x = \sqrt{2(-at+C)}. $$ Perhaps this is a rather elementary question, but how can this be solved for $b>0$? Since $1/x$ is not a well-behaved function, does this differential equation have an analytical solution?

Thanks in advance.


Just shift all of the R.H.S in the denominator and put the $dt$ in the R.H.S to get $$\frac{dx}{\frac{-a}{x}-b}=dt$$ $\implies$ $$\int \frac{-xdx}{a+bx}=\int dt$$ $\implies$ $$\int \frac{-bx-a+a}{a+bx}dx=bt+bC$$ $\implies$ $$-x+a\int \frac{dx}{a+bx}=bt+bC$$ Hence $$-x+\frac {a}{b}\log_e |a+bx|=bt+C'$$ is the required solution.

  • $\begingroup$ And, once more, $x$ would be given in terms of Lambert function ! Cheers. $\endgroup$ – Claude Leibovici Feb 24 '16 at 11:13
  • $\begingroup$ Thank you. I understand all your steps. Neat trick to multiply by $a$ and adding and subtracting $b$. Seems like this can only be solved numerically for $x$, but that should be easy with a computer. $\endgroup$ – Forzaa Feb 24 '16 at 11:17
  • $\begingroup$ You can also use the W function as Claude pointed out $\endgroup$ – Nikunj Feb 24 '16 at 11:18
  • $\begingroup$ I did a major edit, I had solved it wrongly, but now it's corrected (just so you know) $\endgroup$ – Nikunj Feb 24 '16 at 11:21
  • $\begingroup$ @Nikunj Can you show how writing it in terms of lambert W would work? I'm stuck with this $a$ term before the logarithm. My function becomes something like $-(a+bx)^ae^{-(a+bx)} = Ce^{b^2t}$. This is only a Lambert W function if $a=1$. $\endgroup$ – Forzaa Feb 26 '16 at 12:39

\begin{align*} \int dt &= -\int \frac{dx}{\frac{a}{x}+b} \\ t &=\int \frac{x\, dx}{a+bx} \\ &=\int \left[ \frac{1}{b}-\frac{a}{b(a+bx)} \right] dx \\ &=\frac{x}{b}-\frac{a}{b^{2}} \ln |a+bx|+C \end{align*}

  • $\begingroup$ @Nikunji, breakdown into partial fractions first. $\endgroup$ – Ng Chung Tak Feb 24 '16 at 11:23
  • $\begingroup$ Your first approach was clearly wrong so that's why I asked, any way this one is correct! $\endgroup$ – Nikunj Feb 24 '16 at 11:30
  • $\begingroup$ @Nikunji, made a lot of typos while editing $\endgroup$ – Ng Chung Tak Feb 24 '16 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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