# command diffp: index on a variable for partial derivative bug?

Consider the following, with the package:

\usepackage[thinc]{esdiff}

$\diffp*{A}{k}{Q_L}>0$


The code compiles.

However with:

$\diffp*{A}{Q_L}{k}>0$


It returns me "A left brace was mandatory here..."

Why so ? Isn't it possible with this package to have variables with index ?

Apparently, esdiff scans the second argument to \diffp in order to compute automatically the order of the derivative.

Since Q_L has three tokens, this makes esdiff think to a third order derivative with respect to Q, _ and L; errors ensue.

Just brace the “composite” variable to make \diffp consider it as a single object:

$\diffp*{A}{{Q_L}}{k}>0$


My it is only an humble alternative to your used old packageesdiff (Writing derivatives, Eddie Saudrais, April 24, 2008). There are also two recent packages to write the derivates (of type classic or partial):

1) diffcoeff package with a simple syntax;

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{diffcoeff}
\begin{document}

Using \textit{diffcoeff} package:
$\diffp A{Q_L}[k]>0$


2) The derivative package of Simon Jensen, v. 0.98 of 2020/07/20.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{derivative}
\begin{document}
Using \textit{derivative} package:
$\pdv{A}{Q_L}_{k}>0$
\end{document}


In both cases you can get the same result of esdiff.