This is a nonlinear ordinary differential equation of the first order. At this point we only need to know that
it has a solution. The name for this type of equation is Ricatti.

Thus the previous equation further reduces to

(d²ψ/ds²) + 2i(dψ/ds)g(s) = 0

Now let ν equal (dψ/ds). The above equation is then equivalent to

(dν/ds) = −2ig(s)ν
or, equivalently
(1/ν)(dν/ds) = −2ig(s)
which is equivalent to
(d(ln(ν)/ds) = −2ig(s)

This last equation has as its solution

ν(s) = ν(0)exp(−2i∫_{0}^{s}g(z)dz))
or, making use of ζ(s)=∫_{0}^{s}g(z)dz
ν(s) = ν(0)exp(−2iζ(s))

This means that

(dψ/ds) = ν(0)exp(−2iζ(s))
and hence
ψ(s) = ψ(0) + ν(0)∫_{0}^{s}exp(−2iζ(z))dz