1
$\begingroup$

Why Mathematica 11.1.1 seems to hang on

DSolve[y'[x] == Log[1 + y[x]^2], y[x], x]

Since this ODE is separable, it becomes just an integration problem.

Mathematica knows that Integrate[1/Log[y^2 + 1], y] have no closed form solution as it returns instantly unevaluated the integration of the left side

Mathematica graphics

The question is: What else could possibly make it hang on this?

I know CAS does not necessarily follow the same steps to solve problems as humans do by hand, so it must be trying something else and I am just curious what is Mathematica trying to do with this to make it seem to hang (I gave up waiting after few minutes).

Hand solution follows.

Solve

$$ \boxed{y'=\log \left(1+y^2\right)} $$ Solution

This is separable ODE of the form $y'(x) = p(x) f(y) $. Moving $\left(\log \left(y^2+1\right)\right)$ to the left side gives

$$ \frac{y'(x)}{\log \left(y^2+1\right)} = 1 $$ Integrating both sides

\begin{align*} \frac{1}{\log \left(y^2+1\right)} \frac{ \mathop{\mathrm{d}y}}{\mathop{\mathrm{d}x}} &= 1 \\ \int \frac{1}{\log \left(y^2+1\right)} \mathop{\mathrm{d}y} &= \int 1\mathop{\mathrm{d}x} \\ \int \frac{1}{\log \left(y^2+1\right)} \mathop{\mathrm{d}y} &= x + C_0 \end{align*}

The left side has no closed form solution, therefore solution can be written as $$ \boxed{\int^{y(x)} \frac{1}{\log \left(\tau ^2+1\right)} \,d\tau = x + C_0} $$

$\endgroup$
  • 1
    $\begingroup$ If to change $y^2$ on $y$ in the rhs, the solution is given as {{y[x] -> InverseFunction[LogIntegral[#1 + 1] & ][C[1] + x]}}'. So may be after obtaining the integral it is trying to apply InverseFunction` here too. $\endgroup$ – Andrew Aug 5 '17 at 6:49
  • 1
    $\begingroup$ Michael's withTimedIntegrate[] can be useful here: withTimedIntegrate[dsol = First[DSolve[y'[x] == Log[1 + y[x]^2], y[x], x]], 2] $\endgroup$ – J. M. is away Aug 5 '17 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.