# Differential equation integrating factor exact solution

I am trying to find an integrating factor for my differential equation $$\left( c + \frac{1}{1-z}\right)g(z) + \frac{dg}{dz}\left(\frac{a}{1-z}z - 1\right)+\frac{a}{1-z} z\frac{df}{dz}=0$$ A similar equation uses $$(1-z)e^{c z}$$ however, I am struggling to solve this equation. Note that $f(z) = \sum_k e^{c(z-1)} z^k$ such that $$z\frac{df}{dz} = z(cz-1)e^{c(z-1)}$$ There is no relation between $g$ and $f$.

• What's relation between $f$ and $g$ ? – Nosrati Aug 10 '18 at 15:15

Hint: Use $e^{-cz}$ and after multiplying let $h=e^{-cz}g$ to simplify equation.
Edit: $$\left( c + \frac{1}{1-z}\right)g(z) + \frac{dg}{dz}\left(\frac{a}{1-z}z - 1\right)+\frac{a}{1-z} z\frac{df}{dz}=0$$ $$\left( c + \frac{1}{1-z}\right)g(z) + \frac{dg}{dz}\left(\frac{a}{1-z}z - 1\right)+\frac{a}{1-z} z(cz-1)e^{c(z-1)}=0$$ $$c(1-z)g + g + azg' - (1-z)g' + az(cz-1)e^{c(z-1)}=0$$ $$(1-z)(cg-g') + g + azg' + az(cz-1)e^{c(z-1)}=0$$ $$-(1-z)(-ce^{-cz}g+e^{-cz}g') + e^{-cz}g + aze^{-cz}g' + az(cz-1)e^{-c}=0$$ $$-(1-z)(e^{-cz}g)' + (e^{-cz}g) + aze^{-cz}g' + az(cz-1)e^{-c}=0$$ $$-(1-z)h' + h + aze^{-cz}(e^{cz}h'+ce^{cz}h) + az(cz-1)e^{-c}=0$$ $$-(1-z)h' + h + azh' + azch + az(cz-1)e^{-c}=0$$ $$(az+z-1)h' + (azc+1)h + az(cz-1)e^{-c}=0$$ $$h' + \dfrac{azc+1}{az+z-1}h = -\dfrac{az(cz-1)e^{-c}}{az+z-1}$$ let $p=\dfrac{azc+1}{az+z-1}$ with integrating factor $$I=e^{\int p dz}=e^{\frac{ac}{1+a}z}\left(1-(a+1)z\right)^{\frac{1+a+ac}{(1+a)^2}}$$ then $$h(z)=\dfrac{1}{I}\int\left(-\dfrac{az(cz-1)e^{-c}}{az+z-1}\right)I\ dz+C$$ or $$\color{blue}{g(z)=e^{cz}\dfrac{1}{I}\int\left(-\dfrac{az(cz-1)e^{-c}}{az+z-1}\right)I\ dz+C}$$ is the final answer. I think you would better to solve the last integral with online softwares.
• Just do as I said. The equation will be of the form $$(az-z+1)h'+(acz+1)h+\cdots$$ – Nosrati Aug 10 '18 at 19:03
• Thank you for your edit! If I have a condition on $g(1)=1$, do you have any advice on how I can choose the boundary for my integration? – AngusTheMan Aug 12 '18 at 18:52
• You are welcome. about your question, you may write $$\int_1^w I\ h\ dz=\int_1^w -\dfrac{az(cz-1)e^{-c}}{az+z-1} I\ dz$$ without constant $C$. – Nosrati Aug 12 '18 at 18:57