# Why is Mathematica having trouble with this first order separable ODE

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

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}$$

• 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. – Andrew Aug 5 '17 at 6:49
• Michael's withTimedIntegrate[] can be useful here: withTimedIntegrate[dsol = First[DSolve[y'[x] == Log[1 + y[x]^2], y[x], x]], 2]` – J. M. will be back soon Aug 5 '17 at 7:28