Uniqueness of the solution to some differential equation. I'm currently working on the subject mentioned in the title in a very general way. I think I get stuck for a stupid reason but here is my problem :
I'd like to show that any solution to the equation $xf'(x)-2f(x)=0$ can be written as a linear combination of the two following functions: $g(x)$ that's defined as $x^2$ for all $x\ge0$ and $0$ otherwise and $h(x)$ that's defined as $0$ for all $x\ge0$ and $x^2$ otherwise.
It seems to me that it is true but I can't prove it properly.
What I have tried :
I've showed that all these functions were indeed solutions, I've taken a few trivial solutions and written them into the required form, I've tried to deal with the difference between two solutions to the equation and prove it was of this form but didn't get anywhere, I've also tried to make some derivative 0 and to define other functions to work with but it was hopeless...
Can you hint me?
 A: When you write your differential equation in the usual form:
$$y'={2\over x} y\ ,$$
then you recognize that its domain consists of the two half planes $x<0$ and $x>0$, because the right side is undefined when $x=0$. In each of these half planes the differential equation is linear and has the solutions
$$y_A(x)=A x^2\quad(-\infty<x<0), \qquad{\rm resp.,}\qquad y_B(x)=B x^2\quad(0<x<\infty)$$
you have found. Since through any point $(x_0,y_0)$ with $x_0\ne0$ passes exactly one of these curves there are no more solutions, on account of the general existence and uniqueness theorem.
A posteriori we realize that we have 
$$\lim_{x\to0-} y_A(x)=\lim_{x\to0-} y'_A(x)=0,\qquad{\rm resp.,}\qquad \lim_{x\to0+} y_B(x)=\lim_{x\to0+} y'_B(x)=0$$
for all $A$ and $B$, so that you can smoothly connect any $y_A$-solution with any $y_B$-solution of your choice, and lo and behold: Any function $\phi:\>{\mathbb R}\to{\mathbb R}$ constructed in this way will even satisfy the differential equation in the originally given form at $x=0$. But note that this is a bonus of this particular example, and is not covered by any general theorem.
A: I think that it is easier to simply solve the equation via "separation of variables". This gives you that something is a solution if and only if it is of the form $$ y = c^2 x^2 $$ for an arbitrary constant c. 
Then all you need say is:
1. That every solution of this form can be split up into the two halves you mentioned, and
2. That any linear combination of those two functions is equivalent to a solution of this form in the two cases that arise according to the sign of x.
Hence we have shown that something is a solution if and only if it is a linear combination of the functions you mentioned.
