Your trial solutions are only used for second order linear DEs with constant coefficients. What you actually have is a Cauchy-Euler equation.
y''-x^{2}y=0, (y''=d^{2}y/dx^{2})
when try to find solution, usually assuming solution form is y=e^{lambda X}, and lambda =x, -x, then general solution is y=c_{1}e^{x^2} + c_{2}e^{-x^2}. however, I was told this is wrong approach to solve.
Then how can I get correct general solution?
Your trial solutions are only used for second order linear DEs with constant coefficients. What you actually have is a Cauchy-Euler equation.
You cannot obtain a closed form for the solutions in using an elementrary method only.
Solving this kind of ODE requires a change of fonction and a change of variable in order to transform it to a standard Bessel ODE.
The solutions involve some Bessel functions.
Alternatively the solution can be directly expressed on the form of particular Parabolic Cylinder functions (which are less usual as the related Bessel functions)