Solution to $\frac{1}{6}g''=v g^3+k g^3-k g$ I have a nice problem with a not-so simple solution. Consider the following differential equation:
$$\frac{1}{6}g''=v g^3+kg^3 - k g$$
with boundary conditions $g(0)=0$ and $g(\infty)=1$, where $k>0$ and $v \geq 0$.
What i've tried so far:
Multiply by $g'$ and integrate once:
$$(g')^2=3\left[(k+v)g^4-2k g^2+(k-v)\right]$$
where I've added the integration constant $(v+k)$ to ensure that $g(\infty)=1$ and thus $g'(\infty)=0$.
which has a nice solution for $v=0$, $g'=3k(1-g^2)$, thus $g=\tanh{(3k x)}$. However,such a nice factorization of the polynomial does not hold for $v \neq 0$.
This is where your help may come in, if anyone has any suggestions, it would be greatly appreciated.
 A: It depends, of course, on the boundary conditions. As written the problem actually has no solution because $g\to1$ as $x\to\infty$ is obtainable only when $v=0$. For nonzero $v$ you find that assuming $g\to1$ gives the second derivative a nonzero limit which is contradictory. If you mean to force a constant value at infinity, you must allow this constant to vary with $v$ and $k$ so that it properly corresponds to a zero of $g''$. Then, it turns out,  you always have the hyperbolic tangent solution.
To wit, render $g=ah$ for some constant $a$, and then
$\dfrac16ah''=(v+k)a^3h^3-kah$
Then you eliminate the constant term from the first integral equation by setting $a$ to match $(v+k)a^3$ with $ka$. So for a nonzero solution as you presumably want,
$a=\pm\sqrt{\dfrac{k}{v+k}}$
where the sign corresponds to an overall factor of $\pm 1$ in the solution for $g$ itself (the differential equation has odd parity). For this value of $a$ the constant-limit boundary condition turns out to be $h=1,\therefore g=a\overset{generally}{\not=}1$.
When the substitution is carried through, the equation for $h$ becomes identical to the equation for $g$ already solved with $v=0$, so
$h=\tanh(3kx),g=a\tanh(3kx).$
