Got stuck with simple (is it?) nonlinear first-order ODE. 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.
 A: 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.
A: $$u' + \frac{1}{2} u^2 = -\frac{a}{\cosh^2 (x)}-k$$
Let $u=2\frac{v'}{v} \quad\to\quad u'=2\frac{v''}{v}-2\frac{v'^2}{v^2}$
$2\frac{v''}{v}-2\frac{v'^2}{v^2} + \frac{1}{2} \left(2\frac{v'}{v}\right)^2 = -\frac{a}{\cosh^2 (x)}-k$
$$v'' +\left(\frac{a}{2\cosh^2 (x)}+\frac{k}{2}\right)v=0 \tag 1$$
This is a second order linear ODE of the kind : 
$$\quad v''+f(x)\:v=0\quad$$ 
where $f(x)$ is a known function. 
It is well known that this kind of ODEs are not always analytically solvable. Some of them are solvable in terms of special functions. For example if $f(x)=\frac{A}{x^2}+\frac{B}{x}+C$ the solutions involve the Kummer and Whittaker functions. In case of $f(x)=Cx^p$ the solutions involve the Bessel functions. A few other examples can be found involving some standard special functions.
Unfortunately, the case $\quad f(x)=-\frac{a}{\cosh^2 (x)}-k\quad$ is not known, as far as I know. On my opinion, you cannot expect a solution of Eq.$(1)$ on closed form until a new family of special functions be created and standardized.
In such circumstances, other approaches such as series expansion or numerical calculus could provide approximate results. 
