# Math Help - First order dif. eq with second order polynomial

1. ## First order dif. eq with second order polynomial

Hello,
I’m trying to solve for the integral of B as a function of time.

Please forgive the simple-text formatting of the Eqs, for some reason they are losing formatting when I paste them from word.

dB/dt=c-eB-aB^2

I have reworked it to:

dB/(c-eB-aB^2 )=dt

But am unable to simplify it to a point where I can integrate it.

I appreciate any guidance on how to approach this. I have looked through engineering solutions on ordinary Dif eqs. But couldn’t find an example that was helpful.
Thanks

2. ## Re: First order dif. eq with second order polynomial

Originally Posted by given
Hello,
I’m trying to solve for the integral of B as a function of time.

Please forgive the simple-text formatting of the Eqs, for some reason they are losing formatting when I paste them from word.

dB/dt=c-eB-aB^2

I have reworked it to:

dB/(c-eB-aB^2 )=dt

But am unable to simplify it to a point where I can integrate it.

I appreciate any guidance on how to approach this. I have looked through engineering solutions on ordinary Dif eqs. But couldn’t find an example that was helpful.
Thanks
Are you using \displaystyle \begin{align*} eB \end{align*} to represent an arbitrary constant value times B, or Euler's number times B, or \displaystyle \begin{align*} e^B \end{align*}?

3. ## Re: First order dif. eq with second order polynomial

Sorry for the confusion-- e is an arbitrary constant value times b, feel free to replace it with g.

4. ## Re: First order dif. eq with second order polynomial

Originally Posted by given
Hello,
I’m trying to solve for the integral of B as a function of time.

Please forgive the simple-text formatting of the Eqs, for some reason they are losing formatting when I paste them from word.

dB/dt=c-eB-aB^2

I have reworked it to:

dB/(c-eB-aB^2 )=dt

But am unable to simplify it to a point where I can integrate it.

I appreciate any guidance on how to approach this. I have looked through engineering solutions on ordinary Dif eqs. But couldn’t find an example that was helpful.
Thanks
\displaystyle \begin{align*} \int{\frac{dB}{c - e\,B - a\,B^2}} &= \int{dt} \\ \int{-\frac{1}{a}\left(\frac{dB}{B^2 + \frac{e}{a}\,B - \frac{c}{a}}\right)} &= \int{dt} \\ \int{\frac{dB}{B^2 + \frac{e}{a}\,B - \frac{c}{a}}} &= \int{-a\,dt} \\ \int{\frac{dB}{B^2 + \frac{e}{a}\,B + \left(\frac{e}{2a}\right)^2 - \left(\frac{e}{2a}\right)^2 - \frac{c}{a}}} &= \int{-a\,dt} \\ \int{\frac{dB}{\left(B + \frac{e}{2a}\right)^2 - \frac{e^2}{4a^2} - \frac{4ac}{4a^2}}} &= \int{-a\,dt} \\ \int{\frac{dB}{\left(B + \frac{e}{2a}\right)^2 - \left(\frac{e^2 - 4ac}{4a^2}\right)}} &= \int{-a\,dt} \\ \int{\frac{dB}{\left(B + \frac{e}{2a}\right)^2 - \left(\frac{\sqrt{e^2 - 4ac}}{2a}\right)^2}} &= \int{-a\,dt} \\ \int{\frac{dB}{ \left(\frac{\sqrt{e^2 - 4ac}}{2a}\right)^2 - \left(B + \frac{e}{2a}\right)^2}} &= \int{a\,dt} \\ \int{\frac{dB}{\left(\frac{\sqrt{e^2 - 4ac}}{2a}\right)^2 - \left(B + \frac{e}{2a}\right)^2}} &= a\,t + C_1 \end{align*}

Now make the substitution \displaystyle \begin{align*} B + \frac{e}{2a} = \frac{\sqrt{e^2 - 4ac}}{2a}\sin{\theta} \implies dB = \frac{\sqrt{e^2 - 4ac}}{2a}\cos{\theta}\,d\theta \end{align*} and the DE becomes

\displaystyle \begin{align*} \int{\frac{\frac{\sqrt{e^2 - 4ac}}{2a}\cos{\theta}\,d\theta}{\left(\frac{\sqrt{ e^2 - 4ac}}{2a}\right)^2 - \left(\frac{\sqrt{e^2 - 4ac}}{2a}\sin{\theta}\right)^2}} &= a\,t + C_1 \\ \frac{\sqrt{e^2 - 4ac}}{2a}\int{\frac{\cos{\theta}\,d\theta}{\frac{e ^2 - 4ac}{4a^2} - \frac{e^2 - 4ac}{4a^2}\sin^2{\theta}}} &= a\,t + C_1 \\ \frac{\sqrt{e^2 - 4ac}}{2a}\int{\frac{\cos{\theta}\,d\theta}{\frac{e ^2 - 4ac}{4a^2}\left(1 - \sin^2{\theta}\right)}} &= a\,t + C_1 \\ \frac{2a}{\sqrt{e^2 - 4ac}}\int{\frac{\cos{\theta}\,d\theta}{1 - \sin^2{\theta}}} &= a\,t + C_1 \end{align*}

Now make the substitution \displaystyle \begin{align*} u = \sin{\theta} \implies du = \cos{\theta}\,d\theta \end{align*} and the DE becomes

\displaystyle \begin{align*} \frac{2a}{\sqrt{e^2 - 4ac}}\int{\frac{du}{1 - u^2}} &= a\,t + C_1 \\ \int{\frac{du}{1 - u^2}} &= \frac{\sqrt{e^2 - 4ac}}{2a}\left(a\,t + C_1\right) \\ \int{\frac{du}{(1 - u)(1 + u)}} &= \frac{\sqrt{e^2 - 4ac}}{2a}\left(a\,t + C_1\right) \\ \frac{1}{2}\int{\frac{1}{1 - u} + \frac{1}{1 + u}\,du} &= \frac{\sqrt{e^2 - 4ac}}{2a}\left(a\,t + C_1\right) \\ \int{\frac{1}{1 - u} + \frac{1}{1 + u}\,du} &= \frac{\sqrt{e^2 - 4ac}}{a}\left(a\,t + C_1\right) \\ -\ln{|1 - u|} + \ln{|1 + u|} + C_2 &= \frac{\sqrt{e^2 - 4ac}}{a}\left(a\,t + C_1\right) \\ \ln{\left|\frac{1 + u}{1 - u}\right|} &= \sqrt{e^2 - 4ac}\,t + \frac{C_1\sqrt{e^2 - 4ac}}{a} - C_2 \\ \ln{\left|-\left(\frac{u + 1}{u - 1}\right)\right|} &= \sqrt{e^2 - 4ac}\,t + \frac{C_1\sqrt{e^2 - 4ac}}{a} - C_2 \\ \ln{\left|-\left(1 + \frac{2}{u - 1}\right)\right|} &= \sqrt{e^2 - 4ac}\,t + \frac{C_1\sqrt{e^2 - 4ac}}{a} - C_2 \end{align*}

\begin{align*} \left|-\left(1 + \frac{2}{u - 1}\right)\right| &= \exp{\left(\sqrt{e^2 - 4ac}\,t + \frac{C_1\sqrt{e^2 - 4ac}}{a} - C_2\right)} \\ \left|-\left(1 + \frac{2}{u - 1}\right)\right| &= \exp{\left(\frac{C_1\sqrt{e^2 - 4ac}}{a} - C_2\right)} \exp{\left(\sqrt{e^2 - 4ac}\,t\right)} \\ 1 + \frac{2}{u - 1} &= A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} \textrm{ where } A = \pm \exp{\left(\frac{C_1\sqrt{e^2 - 4ac}}{a} - C_2\right)} \\ \frac{2}{u - 1} &= A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1 \\ u - 1 &= \frac{2}{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1} \\ u &= \frac{2}{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1} + 1 \\ u &= \frac{2 + A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1}{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1} \\ u &= \frac{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} + 1}{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1} \\ \sin{\theta} &= \frac{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} + 1}{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1} \end{align*}

\begin{align*} \frac{2a}{\sqrt{e^2 - 4ac}}\left(B + \frac{e}{2a}\right) &= \frac{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} + 1}{A\exp{\left(\sqrt{e^2 - 4ac}\,t\right)} - 1} \end{align*}

You could now write B in terms of t if you wish.

5. ## Re: First order dif. eq with second order polynomial

Prove It's point is that any quadratic polynomial can be solved by the quadratic formula. And once you know the solutions, $r_1$ and $r_2$, $B^2- aB+ c= (B- r_1)(B- r_2)$. If $r_1\ne\r_2$ you can use write the function as $\frac{P}{B- r_1}+ \frac{Q}{B- r_2}$. If $r_1= r_2$, it can be written as $(B- r_1)^{-2}$ and integrated directly.

6. ## Re: First order dif. eq with second order polynomial

Prove It and HallsofIvy, thank you so much. Prove It--I really appreciate the time you put in and the step-wise explanation. HallsofIvy--Thanks for the concise summary.

7. ## Re: First order dif. eq with second order polynomial

Originally Posted by HallsofIvy
Prove It's point is that any quadratic polynomial can be solved by the quadratic formula.
Though Completing The Square is the more direct method to get the function into an integrable form (as I did).