# Solving a first order nonlinear nonhomogeneous ODE

Edit: from the answers, I have learnt that the differential equation can be solved by expressing it as being a hypergeometric differential equation. My question now is that, how many a function in the form of
$x(1-x)^2y''(x)+(1-x)^2y'(x)+ay(x)=0$
be transformed into the form of
$\eta(1-\eta)f''(\eta)+(b-c\eta)f'(\eta)+df(\eta)=0$?

Original question: How may one solve a differential equation in the form of:
$\frac{dy}{dx}=P(x) -ky^2$
I have attempted at reducing it into a second order homogeneous equation in the form of $\frac{d^2u}{dx^2}=-kP(t)u$
by making the substitution of
$ky= \frac{\frac{du}{dx}}{u}$
However, I am still unable to solve this.
Are there any methods for solving either equation?

If it helps, P(x) is the derivative of:
$f(x)=\frac{a-be^{cx+d}}{1-e^{cx+d}}$ where a,b,c,d are constants
Additionally, y=0 when x=0, and y=0 as x$\rightarrow$ infinity

A numerical approach to solving the equation with randomly chosen values for constants substituted in gives the following graph: Link
which looks like (maybe) a chi-square distribution....?

• is $$P(x)=-\frac{c (b-a) e^{c x+d}}{\left(e^{c x+d}-1\right)^2}$$? – Dr. Sonnhard Graubner Jun 23 '17 at 10:14
• yes indeed it is – Samus Jun 23 '17 at 15:00

The equation you are working with is the Ricatti equation: $$y'+ky^{2}=P(x)$$ Where $$P(x)=\frac{d}{dx}\frac{a-be^{cx+d}}{1-e^{cx+d}}=\frac{c(a-b)e^{cx+d}}{(1-e^{cx+d})^{2}}$$ By doing your substitution $$y(x)=\frac{1}{k}\frac{\frac{du(x)}{dx}}{u(x)}$$ you indeed have the second order linear ode $$\frac{d^{2}u}{dx^{2}}=kP(x)u(x)=k\frac{c(a-b)e^{cx+d}}{(1-e^{cx+d})^{2}}u(x)$$ First it is nice to clean the equation a little bit by letting $z=c{x}+d$ and $k(a-b)/c=\alpha$, then $$\frac{d^{2}u(z)}{dz^{2}}=\alpha\frac{e^{z}}{(1-e^{z})^{2}}u(z)$$ Then you may also want a change of variables $$\xi=e^{z}$$ So that $$\xi(1-\xi)^{2}\frac{d^{2}u(\xi)}{d\xi^{2}}+(1-\xi)^{2}\frac{du(\xi)}{d\xi}-\alpha{u}(\xi)=0$$ Then you let $1-\sqrt{4\alpha+1}=\gamma$ and do the following substitutions $$\sigma=(x-1)$$ $$u(\xi)=\sigma^{\frac{1-\gamma}{2}}f(\sigma)$$ To give the Gauss hypergeometric ode $$\sigma(1-\sigma)\frac{d^{2}}{d\sigma^{2}}f(\sigma)+(\gamma+(1-\gamma)\sigma)\frac{d}{d\sigma}f(\sigma)-\frac{1}{4}\gamma^{2}f(\sigma)=0$$
• why is it that $(1-e^{cx+d})^2$ becomes $1-e^z$? – Samus Jun 23 '17 at 15:17
• Sorry, but what is $\sigma$ in the substitution? I believe there might be a typo as (x-1) does not really work there. Once again thank you so much for the help – Samus Jun 24 '17 at 14:31