Solution (source code)

= Solution

Expand the two operators before comparing coefficients:
$$
\widetilde L y=-\widetilde a\,y''-(\widetilde a'+\widetilde b)y'-\widetilde c\,y,\qquad Ly=-aw\,y''-(aw)'y'-wc\,y.
$$
Equality $L=w\widetilde L$ requires $a=\widetilde a$, $c=\widetilde c$, and $(aw)'=w(a'+\widetilde b)$. Thus $aw'=\widetilde b w$, giving the positive <integrating factor>
$$
\boxed{a=\widetilde a,\qquad c=\widetilde c,\qquad w(x)=C\exp\left[\int_{x_0}^x\frac{\widetilde b(s)}{\widetilde a(s)}\,ds\right],\quad C>0.}
$$
With $p=aw>0$, the result is the <Sturm-Liouville form> $L=-(p\,d/dx)'-wc$. The arbitrary positive multiplier $C$ rescales both sides of the <eigenvalue> problem and does not change its <eigenvalues>. The coefficient $\widetilde a'$ is already present in the <divergence> term of $\widetilde L$; it must not be counted a second time in the exponential.