# How to solve ODE Bernoulli type equation plus a constant?

I would like to solve the following differential equation:

$$\frac{dX}{dt} = a X - b X^c + d$$. Where $$a,b,c,d$$ are constants.

For $$d=0$$, this EDO is a Bernoulli equation, $$\frac{dX}{dt} = a X - b X^c$$.

In this case this equation can be exactly solved using $$Z=X^{1-n}$$ and it is easily reduced as $$\frac{dZ}{dt}= (1-n)(aZ -b)$$.

Here, the question is, how this ODE can be solved for $$d \neq 0$$, I would like to have a close and analytical expression?.

What is the analytical transformation needed to solve it ?.

Using Mathematica:

ode = X'[t] - a*X[t] +  b* X[t]^c + d == 0;
DSolve[ode, X[t], t]


the output is

{{X[t] -> InverseFunction[
Inactive[Integrate][1/(
d - a K[1] + b K[1]^c), {K[1], 1, #1}] &][-t + C[1]]}}


Interesting solutions and comments are welcome.

• The solution for c = p/q (reduced rational) seems to be Solve[-q RootSum[ d + b #1^p - a #1^q &, ( Log[-#1 + X[t]^(1/q)] #1^(q - p))/(-p b + q a #1^(q - p)) &] == -t + C[1], X[t]] Commented Sep 20, 2022 at 3:21
• thanks @Michael E2 , sure It will be interesting to explore a general polynomial solutions using Mathematica by fixing some parameters under some considerations. Commented Sep 27, 2022 at 5:32

Actually the ode $$\frac{dx}{dt}=a x- b x^c$$ is not Bernoulli. It is simply separable since $$a,b$$ are constants. The same with $$\frac{dx}{dt}=a x- b x^c+d$$ is separable.

Bernoulli has the form $$\frac{dx}{dt}=f_0(t) x + f_1(t) x^n$$.

The reason why $$x'=a x- b x^c$$ gives explicit solution is because the integral can be found when solving as separable. i.e. it becomes

\begin{align*} \frac{dx}{dt} &= a x- b x^c \\ \frac{dx}{a x- b x^c} &= dt \\ \int{\frac{dx}{a x- b x^c} } &= \int dt \\ -\frac{\log \left(b-a x^{1-c}\right)}{a (c-1)} &= t+c_0 \end{align*}

Which can be written explicitly for $$x(t)$$ by raising both side to the exponential as

\begin{align*} x(t)= \left(\frac{b-e^{-a c t-a c c_1+a t+a c_1}}{a}\right){}^{\frac{1}{1-c}} \end{align*}

Now when adding $$d$$, it is still separable. But the problem is that now the integral itself that shows up using the same steps above has no analytical solution. That is why Mathematica gives the solution as implicit.

\begin{align*} \frac{dx}{dt} &= a x- b x^c +d \\ \frac{dx}{a x- b x^c +d} &= dt \\ \int{\frac{dx}{a x- b x^c +d} } &= \int dt \\ \int{\frac{dx}{a x- b x^c +d} } &= t+c_0 \\ \end{align*}

This is the difference. Compare

Integrate[1/(a*x - b*x^c), x]


Integrate[1/(a*x - b*x^c + d), x]


So what does Mathematica do now? It can't integrate the left side in order to finish the solution as the case without $$d$$. So it gives up and says the solution is

So this is an implicit solution.

If you can figure how to solve $$\int{\frac{dx}{a x- b x^c +d} }$$ then you can do better than what Mathematica did above.

• Thanks @Nasser , before I posted this. I already got a solution. but I am looking and interested in a general integral solution by choosing some parameters for example c=a/b non integer, a, b>0., but I don't know if using Mathematica is possible to obtain an anaytical solution. Commented Sep 27, 2022 at 5:41
• for example c=a/b non integer, a, b>0 Why can't you just type c = a/b; ode = X'[t] - a*X[t] + b*X[t]^c + d == 0; DSolve[ode, X[t], t] ? Next, plugin in any values you want for $a,b$. The issue is the integration itself. The integral that results can or not be integrable. That is all. Commented Sep 27, 2022 at 8:24