Trying to solve the following differential equation:
$u' + \frac{1}{2} u^2 = -\frac{a}{cosh^2 (x)}-k$
Following the regular method I first solved the corresponding uniform ODE:
$ u' + \frac{1}{2} u^2 = 0 \\ -\frac{du}{u^2} = \frac{1}{2}dx \\ \frac{1}{u} = \frac{x+C}{2} \\ u = \frac{2}{x+C} $
Next, to find a particular solution of non-uniform equation I replace C with some function of independent variable: $C \rightarrow f(x)$
$ u(x) = \frac{2}{x+f} \\ u'(x) = - \frac{2(1+f')}{(x+f)^2} \\ - \frac{2(1+f')}{(x+f)^2} + \frac{2}{(x+f)^2} = -\frac{a}{cosh^2(x)}-k \\ \frac{-f'}{(x+f)^2} = -\frac{a}{cosh^2(x)} -k$
And I'm totally stuck. Any ideas?
EDIT: Originally the ODE was retrieved from following PDE:
$H_{xx} + H_{yy} + \frac{1}{4} H_y ^2 + \frac{1}{4} H_x ^2 + \cot(y) H_y -1 = 0$
Where the indices denote derivatives over corresponding variables. The PDE itself comes from more complicated PDE after the substitution $H(x,y) = \ln F(x,y)$ and some algebra.
I'll be more than happy if there's some more convenient method of solving it.
EDIT2: just noticed that PDE is not the correct one. Still, if there are any convenient methods of solving it, feel free to post.
The equation is non-linear, so the whole mechanism with homogeneous and inhomogeneous solutions does not work.
You can set $u=2\dfrac{v'}{v}$, $u'=2\dfrac{v''v-v'^2}{v^2}$ so that $$ u'+\frac12u^2=2\frac{v''}{v}=f(x) $$ gives a linear ODE of second order $$ v''(x)-\frac12f(x)v(x)=0 $$ which still is usually not symbolically solvable but gives you more equations with named solutions to compare to. Also, a power series solution might be easier to compute in this form.