Problem in evaluating logarithm derivatives

Yes, as you noted, it matters which variable you take a derivative with respect to. Since we have two variables, if we assume they are independent, then we need to use partial derivatives. If we chose $x$, then $$\frac{\partial \log(xy)}{\partial x}=\frac{y}{xy}=\frac1x$$and $$\frac{\partial}{\partial x}(\log x+\log y)=\frac1x+0=\frac1x$$So the answers agree. (the same thing happens if we chose $y$ instead).

Alternatively, you could take a total derivative. $$\mathrm d(\log xy)=\frac{\partial \log xy}{\partial x}\mathrm dx+\frac{\partial \log xy}{\partial y}\mathrm dy=\frac1x\mathrm dx+\frac1y \mathrm dy$$This agrees with $$d(\log x+\log y)=\frac1x\mathrm dx+\frac1y \mathrm dy$$ So there are no inconsistencies.


The issue is that your differential operator $D$ does not behave in the way you think it does! $$ D(\log(xy))=\frac{1}{xy}D(xy)=\frac{1}{xy}(ydx+xdy)=\frac{1}{x}dx+\frac{1}{y}dy=D(\log(x))+D(\log(y)) $$ At no point in this computation do we actually have $\frac{1}{xy}=\frac{1}{x}+\frac{1}{y}$ -- we are working with differentials, and not derivatives.