Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am having problems solving this differential equation:

diffeq = m x''[t] == -a E^(b*x'[t]);
sol = DSolve[{diffeq, x[0] == 0, x'[0] == v0}, x[t], t]

The output is {}, that means no solution found, however if I take the first condition out i get:

diffeq = m x''[t] == -a E^(b*x'[t]);
sol = DSolve[{diffeq, x'[0] == v0}, x[t], t]

{{x[t] -> (1/(a b^2))*E^(-b v0) (a b E^(b v0) t + a b^2 E^(b v0)C[2]-m Log[(E^(-b v0) m)/b + a t]-a b E^(b v0) t Log[b (E^(-b v0)/b + (a t)/m)])}}

So I tried to find a value for C[2] that could solve x[0]==0:

solution[y_] = ((x[t] /. sol)[[1]]) /. t -> y;
Reduce[solution[0] == 0, C[2]]

a b != 0 && C[2] == (E^(-b v0) m Log[(E^(-b v0) m)/b])/(a b^2)

I verified the result:

solution[0] /. C[2] -> (E^(-b v0) m Log[(E^(-b v0) m)/b])/(a b^2) // FullSimplify

0

My question is: why couldn't mathematica find this? it can't be because a*b!=0: for this values the solution changes completely and C[2] is easy to find.

share|improve this question

1 Answer 1

I think Mathematica should have been to solve it.

Here is what I did: Solved this by hand using state space type approach. i.e. make 2 first order ODE's, from the second order ODE. These two first order ODE's can be solved by Mathematica on their own, using the initial conditions you gave above.

The issue is that, for the second ODE, it needed a specific set of assumptions to make it integrate it, and I think that is why DSolve could not do it. It needed these assumptions.

But taking these assumptions, after they are found, and passing them to DSolve, in the hope now DSolve can now solve the second order ODE, did not do the trick. This means, DSolve must be using some other method to solve this second order ODE, or it is not using the assumptions. Maple was able to solve the second order ODE as is with no assumptions, and it matches the solution using the state space method. Here are the steps done:

\begin{align*} mx^{\prime\prime}\left( t\right) +ae^{bx^{\prime}\left( t\right) } & =0\\ x\left( 0\right) & =0\\ x^{\prime}\left( 0\right) & =v_{0}% \end{align*}

Let \begin{align*} x_{1}\left( t\right) & =x\left( t\right) \\ x_{2}\left( t\right) & =x^{\prime}\left( t\right) \end{align*} The initial conditions in new state variables are $x_{1}\left( 0\right) =0$ and $x_{2}\left( 0\right) =v_{0}$. Taking derivatives of the above ODE's give \begin{align} x_{1}^{\prime}\left( t\right) & =x_{2}\left( t\right) \tag{1}\\ x_{2}^{\prime}\left( t\right) & =-\frac{a}{m}e^{bx_{2}\left( t\right) }\tag{2}% \end{align} The solution to the first ODE is

$$ x_{1}\left( t\right) =c_{0}+\int_{0}^{t}x_{2}\left( \tau\right) d\tau $$

When $t=0,x_{1}\left( 0\right) =0$, hence $c_{0}=0$ and the above becomes

\begin{equation} x_{1}\left( t\right) =\int_{0}^{t}x_{2}\left( \tau\right) d\tau\tag{3} \end{equation}

The solution to the second ODE is, using $x_{2}\left( 0\right) =v_{0}$ is

DSolve[{x2'[t] == -a/m Exp[b x2[t]], x2[0] == v0}, x2[t], t]

Mathematica graphics

$$ x_{2}\left( t\right) =-\frac{1}{b}\ln\left( \frac{bat}{m}+e^{-bv_{0} }\right) $$

Using the above, now the solution in Eq (3) can be found by integrating $x_{2}\left( t\right) $ $$ x_{1}\left( t\right) =-\frac{1}{b}\int_{0}^{t}\ln\left( \frac{ba\tau} {m}+e^{-bv_{0}}\right) d\tau $$

The above can be integrated by Mathematica giving

$$ x_{1}\left( t\right) =-\frac{e^{-bv_{0}}}{ab^{2}}\left( \left( abte^{bv_{0}}+m\right) \log\left( \frac{abt}{m}+e^{-bv_{0}}\right) -abte^{bv_{0}}+bmv_{0}\right) $$

But it needed assumptions to integrate the above. Here are the assumption (do not ask me how I found these, long story, trial and error and guessing :) to make the integral converges

Assuming[Element[{b, v0, m, a, t}, Reals] && a != 0 && b != 0 && m != 0 && t != 0 && 
     m/(a b t) >= 0 && t > 0 && m > 0 && ((b < 0 && a < 0) || (b > 0 && a > 0)), 
          -1/b  Integrate[Log[(b a tao)/m + Exp[-b v0]], {tao, 0, t}]]

Mathematica graphics

So the two solution are found. They are again:

\begin{align*} x_{1}\left( t\right) & =-\frac{e^{-bv_{0}}}{ab^{2}}\left( \left( abte^{bv_{0}}+m\right) \log\left( \frac{abt}{m}+e^{-bv_{0}}\right) -abte^{bv_{0}}+bmv_{0}\right) \\ x_{2}\left( t\right) & =-\frac{1}{b}\ln\left( \frac{bat}{m}+e^{-bv_{0}% }\right) \end{align*}

To verify with Maple:

Mathematica graphics

Now, taking the assumptions used above to integrate for $x2(t)$ and pass them to DSolve:

$Assumptions = Element[{b, v0, m, a, t}, Reals] && a != 0 && b != 0 
   && m != 0 && m/(a b t) >= 0 && 
   m > 0 && ((b < 0 && a < 0) || (b > 0 && a > 0));

diffeq = m x''[t] == -a E^(b*x'[t]);
sol = DSolve[{diffeq, x[0] == 0, x'[0] == v0}, x[t], t]
(* {} *)

I also tried Assuming[....

Bottom line: I think DSolve should have been able to do this. Might require better assumption that the ones used above.

share|improve this answer
    
Well, I doubt if Assuming and $Assumptions will help in this case for they only work for functions with the option Assumption. DSolve doesn't have this option, and there seems to be no evidence that DSolve has called functions with this option… –  xzczd Feb 5 at 9:59
    
@Nasser Yes I know this equation is solvable by hand, my question was why could mathematica find the general solution (without any assumption on the parameters) and still not be able to find the particular solution when this solution clearly exists and is easy to find without the need of particular assumptions. –  John Feb 5 at 19:20
    
@John I do not think any one can answer why DSolve could not solve this without looking at the source code for DSolve. And since I do not work at WRI, I have no access to the source code to answer this. We all could only try to speculate and give workarounds and suggestions. –  Nasser Feb 6 at 6:30
    
Yeah you're probably right, I just found weird that DSolve couldn't do what I did, thank you anyway! –  John Feb 6 at 11:19

Your Answer

 
discard

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.