Questioning the validity of the method of solving Cauchy Euler ODE. Suppose I am given a Cauchy-Euler form second order differential equation $$x^2 \frac{d^2y}{dx^2}+x\frac{dy}{dx}+y=f(x).$$
The usual textbook method for solving the Cauchy Euler equation is to reduce it to a linear differential equation with constant coefficients by the transformation $x=e^t$. But I have a fundamental doubt here, we know that $e^t>0$ $\forall t\in \mathbb R$. But when we are using the above transformation we are subconsciously assuming $x>0$. How does this make sense? 
Substituting $t=\ln(x)$ also makes no difference as $\ln$ is defined on $\mathbb R_{>0}$. So I now doubt the validity of the method followed to solve the Cauchy-Euler equation.
Can someone give me a proper explanation of what exactly going on here and why the process is valid?
 A: The Euler-Cauchy equation has a singularity at $x=0$. This singularity splits the domain of the ODE, which in turn limits any solution of the ODE to a sub-interval of either $x>0$ or $x<0$, depending on the initial condition. In the unusual case where the initial condition is at some negative $x_0$, you can of course also use the substitution $x=-e^t$ or more generally $x=x_0e^t$. 
So with $u(t)=y(x_0e^t)$ one gets $u'(t)=y'(x_0e^t)x_0e^t=xy'(x)$ and $u''(t)=y''(x_0e^t)(x_0e^t)^2+y'(x_0e^t)x_0e^t=x^2y''(x)+xy'(x)$. Here one can see that the effect of the substitution is rather independent of $x_0$ and its sign.
A: The Eular equation $x^2y''+xy'+y=0~~~~(1)$ can be solved y assuming $y=x^m$ (Euler's substitution: ES), then we get $m=\pm i$, so the solution is $y=C_1 x^i + C_2 x^{-i}$ as $$x^i=e^{\ln x^i}=e^{i\ln x}= \cos(\ln x)+ i\sin(\ln x).$$ So the solution of
(1) can also be qrutten as $y=D_1 \sin \ln x+ D_2 \cos \ln x$. So so far no problem with ES.
Alternatively one can claim that $y_1=\sin \ln x, y_2=\cos \ln x $ are two linearly independent solutions of (1). However the solution of  the  in-homogeneous ODE:
$$x^2Y''+xY'+Y=f(x) ~~~~(2)$$
can be obtained by the method of variation of parameters using $y_1,y_2$.
See
https://en.wikipedia.org/wiki/Variation_of_parameters
