10
$\begingroup$

I was trying to solve the initial value problem $$u'(t) = \sqrt{u(t)} + \frac{1}{n+1}, \, u(0) = 0$$ using DSolve:

DSolve[{u'[t] == Sqrt[u[t]] + 1/(n + 1), u[0] == 0}, u, t]

The output for this command in Mathematica 9 is:

{{u -> Function[{t}, 
         (1 + ProductLog[-E^(-(1/(1 + n)) - n/(1 + n) - t/2 - (n t)/2)])^2/(1 + n)^2]}}

Although the returned $u(t)$ satisfies the initial condition $u(0)=0$, it doesn't satisfies the differential equation. What went wrong?

$\endgroup$
  • 3
    $\begingroup$ The very first thing I think when I see that square root is "you have underestimated the power of mathematica." It will try to solve in full generality unless you give it commands not to, so possibly your acquired answer is trying to account for the branches of the sqrt. I don't have access to mathematica right now to verify this thought, but try rewriting the equation without the square root, or using Assumptions to restrict the branch. $\endgroup$ – Zibadawa Sep 15 '14 at 0:04
  • 2
    $\begingroup$ The answer satisfies $u(x) = \left(u'(x)-\frac{1}{n+1}\right)^2$. $\endgroup$ – wxffles Sep 15 '14 at 3:34
4
$\begingroup$

The problem is that the solution takes the other branch of the square root. Look at this:

f = u[t] /. 
  First@DSolve[{u'[t] == Sqrt[u[t]] + 1/(n + 1), u[0] == 0}, u[t], t]
fp = D[f, t]
Plot[Evaluate[{fp, Sqrt[f] + 1/(n + 1)} /. n -> 3], {t, 0, 1}]

enter image description here

Note that Mathematica warns you that some solutions may not be found.

$\endgroup$
5
$\begingroup$

I could not verify the solution given by M either. Maple solved this and verifies the solution. But the solution is given as implicit. Here is the solution fyi in case it might help see what is the problem:

restart;
eq:=diff(u(t),t)=sqrt(u(t))+1/(n+1);
ic:=u(0)=0;
sol:=dsolve({eq,ic},u(t));

Mathematica graphics

 DEtools[remove_RootOf](sol);
-2*u(t)^(1/2)*n+t*n+2*arctanh((n+1)*u(t)^(1/2))-2*u(t)^(1/2)+
      ln(-u(t)*n^2-2*u(t)*n-u(t)+1)+t = 0

Mathematica graphics

odetest(%,eq); #verifies the solution
         (* 0 *)

You might want to report this to support@wolfram.com. It might be that M tried to solve the implicit solution, and that where the problem is. Notice the warning messages on the console:

Inverse functions are being used by Solve, so some solutions 
may not be found; use Reduce for complete solution information
$\endgroup$
3
$\begingroup$

While working with NDSolve whenever I see a square root of first order I get rid of it immediately by squaring and raising the order or power of ODE... as a Rule. It could be beneficial with DSolve also.

Better to raise the power or order of ODE rather than bring in the power of Mathematica into an otherwise easily doable reconfiguration.

c= 1/(1+n) ; u'[t] = Sqrt[u[t]] + c 

Squaring,differentiating and simplifying we get:

2 u''[t] = (1 + c/ Sqrt[u[t]])

Now eliminate Sqrt[u], throwing out all double sign problems to get a neat second

order ODE.

DSolve[{2 u''[t] == u'[t]/(u'[t]-c) , u'[0]== c, u[0]== 0}, u,t]

It may require Reduce due to inverse functions.Also it provides a handle on new

initial u'[0] variations as bonus for wider understanding of your phenomenon.

EDIT: We can take it further into analytic form based on new derivative u'[t]= y[t]:

y'[t]== y[t]/(y[t]-c)

DSolve[{2 y'[t] == y[t]/(y[t] - c)}, y, t]

{{y -> Function[{t}, -c ProductLog[-(E^(-(t/(2 c)) + C[1]/c)/c)]]}}  

whose integral you are looking for after incorporating initial value.

If closed form is not possible, a full numerical can be taken as a recourse.

$\endgroup$
  • 2
    $\begingroup$ How does it solve the problem? $\endgroup$ – Artes Sep 15 '14 at 8:39

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.