Second order ODE with $x'' = f(t, x, x')$ I want to find general solution to the following ODE:
$$
x''=\frac{(x-tx')^2}{t^2x}
$$
The problem is, I only know what to do when I have $f(x,x')$ or $f(t, x')$ or $f(x)$ and here the function is clearly $f(t, x, x')$. I suppose the point is to somehow transform the ODE with a trick into one of the mentioned forms. I appreciate your help.
 A: If we suppose that 
$$ x= e^y $$
then
$$x'=e^y y'$$
and
$$x'' = e^y\big[(y')^2+y''\big]. $$
Substituing into the equation we get
$$e^y\big[(y')^2+y''\big]= \frac{1}{t^2e^y}\big[e^y-te^yy'\big]^2=\frac{e^y}{t^2}\big[1-ty'\big]^2$$
Hence 
$$y'' = -(y')^2 + \frac{(1-ty')^2}{t^2}= -(y')^2 + \frac{1-2ty'+t^2(y')^2}{t^2}=\frac{1-2ty'}{t^2}$$
So, if $u=y'$, 
$$u' = \frac{1}{t^2}- \frac{2}{t}u $$
which is a linear ODE of first order with solution
$$u(t) = \frac{c}{t}+ \frac{1}{t}. $$
Since we want $y$, we have to integrate the RHS:
$$ y(t) = \int u(t) \ \mathrm{d}t = \int \bigg(\frac{c}{t^2}+ \frac{1}{t}\bigg) \ \mathrm{d}t  = -\frac{c}{t}+ \ln t + d.$$
Finally the results is
$$x(t) =e^{y(t)}=e^{-\frac{c}{t}+ \ln t + d}=k\ t\ e^{-\frac{c}{t}} $$
A: Making $y = t x$ we have $y'=x+t x'$ and $y''= 2x'+t x''$ and after substitutions we arrive at
$$
t y y''-t y'^2+2y y'=0
$$
now making  $y = e^{v(t)}$ and substituting we arrive at
$$
t v''-2v'=0
$$
A: $$x''=\frac{(x-tx')^2}{t^2x}$$
$$\color{blue} {t^2xx''}=x^2 \color{blue} {-2txx'}+t^2x'^2$$
$$\color{blue} {x(t^2x')'}=x^2+t^2x'^2$$
$$x(t^2x')'-t^2x'^2=x^2$$
$$ \boxed {\left ( \dfrac {t^2x'}{x} \right )'=1}$$

This differential equation can  easily be solved. Integrate:
$$ \dfrac {t^2x'}{x}=t+c$$
$$\left ( \dfrac {x}{t} \right )'=\dfrac {cx}{t^3} \implies 
 \dfrac  txd\left ( \dfrac {x}{t} \right )=\dfrac {c}{t^2}dt$$
Integrate again:
$$\ln \left(\dfrac x t \right)=\dfrac {c_1}{t}+c_2 \implies  x(t)=k_1te^{c_1/t}$$
