From normal distribution to the lognormal distrubtion; where does $1/x$ come from? So the normal distribution is given by $\frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)$; Now the lognormal distribution is related to this by $y = e^x$ so the distrbution should be $\frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(\ln(y)-\mu)^2}{2\sigma^2}\right)$, but apparently it is $\frac{1}{\color{red}{y}\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(\ln(y)-\mu)^2}{2\sigma^2}\right)$, so where does this $\frac{1}{\color{red}{y}}$?
It's apparent to me that this substitution is invalid, so the question is really: What's the valid way to do it?

It comes from the chain rule.
You have $\log Y\sim N(\mu,\sigma^2),$ so
\begin{align}
& \Pr( Y \le y) = \Pr(\log Y \le \log y) = \Pr\left( \frac{(\log Y) - \mu}{\sigma} \le \frac{(\log y) - \mu}{\sigma} \right) \\[10pt]
= {} & \int_{-\infty}^{((\log y) - \mu)/\sigma} \frac 1 {\sqrt{2\pi\,}} e^{-z^2/2} \, dz,
\end{align}
and so
\begin{align}
\frac d {dy} \Pr(Y \le y) = \frac 1 {\sqrt{2\pi}} e^{-(((\log y) - \mu)/\sigma)^2/2} \cdot \frac d {dy} \, \frac{(\log y) -\mu} \sigma.
\end{align}
This is the chain rule, applied thus:
$$
\frac d {ds} \int_{\text{some number}}^{g(s)} h(w) \, dw = h(g(s)) \cdot \frac d {ds} g(s).
$$
Alternatively, one could do the following:
$$
\begin{align}
\Pr(Y\le y) & = \Pr( \log Y \le \log y) = \int_{-\infty}^{\log y} \frac 1 {\sigma\sqrt{2\pi}} e^{-(w - \mu)/\sigma)^2/2} \, dw \\[10pt]
\text{and consequently } \frac d {dy} \Pr(Y \le y) & = \frac 1 {\sigma\sqrt{2\pi}} e^{-((\log y) - \mu)/\sigma)^2/2} \cdot \frac d {dy} \log y.
\end{align}
$$
The bottom line will be the same.
