Is this ODE separable? I'm preparing for the final in my ODE course by reviewing some past exams and I found this problem. 
Solve the following equation by the separation of variables method.
$$2tx\frac{dx}{dt}+(t^2-x^2)=0$$
I've learned that separable equations must be of the form 
$$\frac{dy}{dx}=g(x)h(y)$$
I've tried and failed to get the problem into the form of the product of a function of $x$ and a function of $t$. I can rearrange it to get
$$\frac{dx}{dt}=\frac{1}{2}\left(\frac{x}{t}-\frac{t}{x}\right)$$
Can someone please show me how to solve this equation using the separation of variables method?
 A: Let $v = x/t$ then $x = tv$ and $x' = v + tv'$. Hence your equation may be rewritten as
$$v + tv' = {1 \over 2}\left(v - {1\over v}\right)$$
or 
$${dv \over dt} = -{1 \over t}\cdot {v^2 + 1 \over 2v}$$
This is separable. 
A: Same solution as Simon S, but with easier motivation (IMO).
The part that is causing this to not be seperable is $(t^2-x^2)$. If we consider $x = t y$ then this part will become $t^2(1-y^2)$ which is seperable.
So using $x = t y$, and $x' = t y' + y$ into the first equation we get
$$
2 t ( t y ) ( t y' +y ) + t^2 (1-y^2) = 0
$$
For $t\ne0$ we can divide through by $t^2$ and get
$$
2 t y y' + 2 y^2 + (1 - y^2) = 0 \\
y' = \frac{-1}{2t} \frac{y^2+1}{y}
$$
A: This is a fuller explanation of the pitfalls due to division by zero that you need to be aware of. The problem as stated is in fact incorrect because there is no such solution for all real $t$. If $t \in (0,\infty)$ then we can proceed by first proving that $x \ne 0$, since otherwise $t^2 = x^2 = 0$ and so $t = 0$. Only after that can we continue by the method of separating variables, which divides both sides by $xt$. Without proving that such divisions are valid, one can easily lose solutions. (An exception is if we only want complex meromorphic solutions, in which case we can divide by anything that has only isolated zeros, because a Laurent series is uniquely determined as long as only isolated points are unspecified, corresponding to where we divide by zero.)
Alternatively, you can observe the following (for $t>0$):
$(t^{-1}x^2)' = - t^{-2}x^2 + 2t^{-1}x\frac{dx}{dt} = t^{-2} ( tx\frac{dx}{dt} - x^2 ) = -1$
Thus $t^{-1}x^2 = -t + c$ for some constant $c$ and hence $x^2 = ct - t^2$.
