6
$\begingroup$

I have a second order differential equation with $2$ boundary conditions and want to use the following code to solve it:

DSolve[{x''[t] == -x[t]^2, x[ta] == xa, x[tb] == xb}, x[t], t]

However, Mathematica gives me an error message saying:

DSolve::bvfail: For some branches of the general solution, 
unable to solve the conditions.

How I can get around that?

$\endgroup$
2
  • $\begingroup$ Look at the result without BCs, DSolve[{x''[t] == -(x[t])^2}, x, t] . It cannot converge even when the BCs are defined, for example DSolve[{x''[t] == -(x[t])^2, x[0] == 1, x'[0] == 1/3}, x, t] . Maybe there is a way around this. $\endgroup$
    – Moo
    Commented Mar 10, 2020 at 14:47
  • $\begingroup$ You should add certain assamptions on the boundary conditions to elucidate a bit more a symbolic structure of the solution that I've demonstrated in my answer. $\endgroup$
    – Artes
    Commented Mar 10, 2020 at 15:36

1 Answer 1

12
$\begingroup$

There are a few issues we should remember when we would like to solve nonlinear differential equations:

  • If we want a symbolic solution we can get it only if the equation can be transformed to such that can be solved by the system. In fact most of differential equations cannot be solved symbolically, however several types of nonlinear equations can be found with DSolve
  • This equation has solutions in terms of elliptic functions ( i.e. doubly periodic meromorphic functions in the complex plane) and so there are certain specific restrictions which we should have in mind dealing with such equations. Usually Mathematica refuses solving equations with boundary (or initial) conditions if there are elliptic functions involved
  • One should avoid using symbolic boundary (initial) conditions when certain special functions can be expected as solutions, although sometimes one can succeed in spite of this issue. One can go ahead without boundary conditions and use them after using DSolve or analogous functions.

This differential equation is nonlinear and let's solve it without boundary conditions:

DSolveValue[x''[t] == -x[t]^2, x[t], t]     
 -(-1)^(2/3) 6^(1/3) WeierstrassP[(-(1/6))^(1/3) (t + C[1]), {0, C[2]}]

We have a solution in terms of WeierstrassP being the most important one of the elliptic functions, namely the Weierstrass elliptic function $\wp$ with WeirstrassInvariants 0 and C[2] A bit more on this function one can find in this answer.

Using boundary conditions we can get rid of the constants of integration C[1] and C[2]. There is a problem with the number ComplexExpand[-(-1)^(2/3)], it yields 1/2 - (I Sqrt[3])/2. If we are to consider real solutions we have to use appropriately the boundary conditions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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