Given the ODE $$x^2M''+xM'+\lambda M = 0$$ where $1<x<L$, with boundary conditions $M(1) = 0$, $M(L)=0$, we can rewrite it in the Sturm-Liouville form and get $$\left[M'\exp\left(\int\limits_0^L{\frac{1}{x}}dx\right)\right]'+\lambda x^{-2}\exp\left(\int\limits_0^L{\frac{1}{x}}dx\right) M=0$$ This equation becomes $$LM''+\lambda Lx^{-2}M = 0$$ for some constant $L>0$, because $\exp\left(\int\limits_0^L{\frac{1}{x}}dx\right)=L$.
Now, to rewrite this equation in terms of $z=e^x$, is it sufficient to do the following?
$\frac{dM}{dx}=\frac{dM}{dz}\frac{dz}{dx}=zM'(z)$, thus we get the equation $$L\left[zM'(z)\right]'+\lambda Lz^{-2}M(z)=0$$ or simply $$\left[zM'(z)\right]'+\lambda z^{-2}M(z)=0$$
I'm not sure if everything I did above is correct, so I would appreciate your feedback.
$$x^2\frac{d^2M}{dx^2}+x\frac{dM}{dx}+\lambda M(x)=0$$ The change of variable $\quad z=e^x\quad\to\quad x=\ln|z[\quad\to\quad \frac{dz}{dx}=z \quad$ isn't a good idea because it leads to a more complicated form of ODE :
$\frac{dM}{dx}=\frac{dM}{dz}\frac{dz}{dx}=z\frac{dM}{dz}$
$\frac{d^2M}{dx^2}=\left(\frac{d}{dz}\frac{dM}{dx}\right)\frac{dz}{dx}=\frac{d}{dz}\left(z\frac{dM}{dz} \right)z = z^2\frac{d^2M}{dz^2}+z\frac{dM}{dz}$
So, the ODE becomes :
$$\ln^2|z| \left(z^2\frac{d^2M}{dz^2}+z\frac{dM}{dz} \right) +\ln|z|z\frac{dM}{dz}+\lambda M(z)=0$$
A better change of variable would be : $$\quad x=e^t \quad\to\quad t=\ln|x|$$ With the same method as above (the chain rule), I let you find the derivatives :
$\frac{dM}{dx}=e^{-t}\frac{dM}{dt}$
$\frac{d^2M}{dx^2}=e^{-2t}\left(\frac{d^2M}{dt^2}-\frac{dM}{dt} \right)$
which leads to : $$\frac{d^2M}{dt^2}+\lambda M(t)=0$$
COMMENT :
The above method of solving isn't the simplest for this ODE : $x^2\frac{d^2M}{dx^2}+x\frac{dM}{dx}+\lambda M(x)=0 $
A direct method consists in the search of particular solutions on the form $M=x^r$ which leads to the equation : $$r(r-1)+r+\lambda=0 \quad\to\quad r=\pm\sqrt{-\lambda}$$ $$M(x)=c_1x^{\sqrt{-\lambda}}+c_2x^{-\sqrt{-\lambda}}$$ which can be easily transformed with sinusoidal terms in case of $\lambda>0$.