Differential Equation, how is it solved? I wish to solve the following differential equations:$$g'(z) + \left[ -\frac{2}{1-z} + \frac{b}{(1-z)^2}\right]g(z) = 0$$  A similar one is $$g'(z) + \left[ -\frac{2}{1-z} + \frac{b}{(1-z)^2}\right]g(z) = -\frac{1}{(1-z)^2}$$ I am skeptical of the solutions given by WolframAlpha because in this answer equation *1 is correct, I believe, but it differs from the answer one get with WolframAlpha.  Is WolframAlpha wrong or can this be reconciled?
 A: These are both first order, linear, ODEs of the forms
$$g'(z) + p(z) g(z) = 0 \text{ and } g'(z) + p(z) g(z) = q(z).$$
Both equations can be solve the the method of integrating factors.
Define $\mu(z) = \exp( \int_0^z p(t) ~\mathrm{d}t )$. Multiply each equation through by $\mu(z)$ to get 
$$ \mu(z) g'(z) + \mu(z)p(z) g(z) = 0 \text{ and } \mu(z)g'(z) + \mu(z)p(z) g(z) = \mu(z)q(z).$$
The integrating factor $\mu(z)$ is designed so that the left-hand sides are result of product rules, as $\frac{d}{dz} \mu(z) = \mu(z) p(z)$. This yields
$$\frac{d}{dz} \left[ \mu(z) g(z) \right] = 0 \text{ and } \frac{d}{dz} \left[ \mu(z) g(z) \right] = \mu(z)q(z).$$
Integrate both sides and solve for $g(z)$:
$$g(z) = \frac{c_1}{\mu(z)} \text{ and } g(z) = \frac{ \int \mu(z) q(z) ~\mathrm{d}z}{\mu(z)}.$$
For these particular problems, we find that
\begin{align*}
 \mu(z) &= (z-1)^2 e^{-\frac{b}{z-1}} \\
  g_1(z)&= \frac{c_1}{\mu(z)} =\frac{c_1 e^{\frac{b}{z-1}}}{(z-1)^2} \\
  g_2(z)&= \frac{c_2 e^{\frac{b}{z-1}}}{(z-1)^2}+\frac{e^{\frac{b}{z-1}} \left((z-1) \left(-e^{-\frac{b}{z-1}}\right)-b \text{Ei}\left(-\frac{b}{z-1}\right)\right)}{(z-1)^2}
\end{align*}
where $g_1$,$g_2$ are the solutions for the first and second differential equations respecitively, and $Ei(z)$ is the exponential integral function: $Ei(z) = \int_{-z}^\infty e^{-t}/t ~\mathrm{d}t$. 
