Let $n$ be a natural number, $a_k(x)$ functions defined on an interval and $$Df(x)=\frac{d}{dx}(a_1(x)\frac{d}{dx}(a_2(x)\dots\frac{d}{dx}(a_{n}(x)\frac{d}{dx}f(x))\dots)$$ be an ordinary differential operator acting on functions on the interval. $D$ can be rewritten as $$Df(x)=a_1(x)a_2(x)\dots a_{n}(x)(\frac{d^{n+1}}{dx^{n+1}}+b(x)\frac{d^{n}}{dx^{n}}+\text{lower order terms})f(x).$$ Is the following a correct formula $$b(x)=\frac{d}{dx}\log(a_1(x)a_2^2(x)\dots a_n^n(x))$$ for the second leading coefficient of $D$?
NOTE: The question is motivated by a semi-discrete model for conductivity inverse boundary problem in 2D.