Solution to $y^{\prime \prime} -xy = 0$ I have a differential equation of the form 

$y^{\prime \prime} - xy = 0$,

which I'm told has a solution of the form

$y(x) = p(x) e^{-q(x)}$.

I've been trying to solve for q(x) by differentiating y(x) and plugging it into the ODE directly, which led me to find

$p^{\prime \prime}(x) - 2p^{\prime}(x)q^{\prime}(x) + p(x)(q^{\prime}(x)^2 - q^{\prime \prime}(x)) = xp(x)$,

but I'm not sure where to go from here, or if this is even the right direction. I've been given a hint that to solve for $q(x)$, I'll need to think about the behaviour of $p(x)$ for large $x$. Since $p(x)$ looks like an amplitude to an oscillation, I feel like it will go to $0$ over time.

I would appreciate any help on how to to get a solution of this form.

EDIT: for large enough $x$, I think we can make the approximation that $y^{\prime \prime}(x) &lt;&lt; y^{\prime}(x)^2$, although I'm not sure yet exactly how this could help.
You have $2$ functions parametrizing one solution. Thus you can add one external condition on the relation of $p$ and $q$. One relatively natural condition is that the "amplitude" $p$ varies much more slowly than the "phase" $q$, meaning that the derivatives of $p$ are dominated by the derivatives of $q$. This then suggests to extract from the dominant terms
$$
q'(x)^2=x
$$
so that the remaining equation is
$$
p''(x)-2p'(x)q'(x)-p(x)q''(x)=0
$$
Here again one can concentrate in a first approximation on the dominant terms
$$
-2p'(x)q'(x)-p(x)q''(x)=0\implies p(x)^2q'(x)=C
$$
In total this gives the first order of the WKB approximation method.
Well, if all you want to do is solve for $q(x),$ then that's just the logarithm of $p(x)/y(x).$ That is, if you rewrite your equation as $$\frac{y(x)}{p(x)}=e^{-q(x)},$$ whence, by raising both sides to the power $-1$ we get  $$\frac{p(x)}{y(x)}=e^{q(x)},$$ from which it follows that $$q(x)=\log\left(\frac{p(x)}{y(x)}\right).$$