I come across this problem in my study for diffusion-action nonlinear PDE. I tried to solve the problem explicitly but I stuck as I am going to show. However I solved the solution 2. I am not convinced it even a solution though.
Solution 1 $$ u_{xx} = \frac{1}{2}u(u^2-1)$$ multiplying by $u_x$,
$$2u_{xx} u_x = u^3 u_x-u u_x.$$
Integrating for $x$ from $0$ to $x$ we get
$$(u_x)^2 = \frac{u^4}{4} - \frac{u^2}{2}.$$
Now we solve the ODE, $$u_x = \pm \sqrt{\frac{u^4}{4} - \frac{u^2}{2}} \Rightarrow u_x = \pm \frac{u}{\sqrt{2}}\sqrt{\frac{u^2}{2} - 1}. $$
$$\int \frac{du}{\frac{u}{\sqrt{2}}\sqrt{\frac{u^2}{2} - 1}} = \pm \int dx.$$
After I make the substitution $u= \sqrt{2} \sec v$ and calculating the integration on the left as;
$$\int \frac{du}{\frac{u}{\sqrt{2}}\sqrt{\frac{u^2}{2} - 1}} = \sqrt{2} \sec^{-1}(\frac{u}{\sqrt{2}}).$$
Substituting the result in the equation before and simplify I get the general solution
$$u(x)= \sqrt{2} \sec(\frac{x}{\sqrt{2}}+c).$$ boundary conditions. Could you please explain a way to get the right solution mentioned in solution 2. Thanks in advance. Which does not satisfy the
Solve $\begin{cases} &0= u_{xx} + \frac{1}{2}u(1-u^2),\,\,\, x\in \mathbb{R}\\ &u(0)=0,\,\, u({\pm \infty})=\pm 1. \end{cases}$
Solution 2 Consider the $ u(x) = \tanh{a x}$, where $a >0$ and $x \in \mathbb{R}$.
\begin{align*} u_x &= a (1- \tanh^2{(a x)},\\ u_{xx}&= -2 a^2 \tanh{(ax)} (1 -\tanh^2{(ax)}),\\ 0&=u_{xx}+2a^2 u(x) (1- u(x)^2).\\ \end{align*}
By comparison with the main ODE we get $a = \frac{1}{2}$. Then the solution is $u(x) = \tanh{\frac{x}{2}}$. We can see that $u(x)$ satisfies the main ODE, and
\begin{align*} u(0)&=0.\\ u(\pm \infty)&=\pm1. \end{align*}