Using \usepackage{xfp}
, I have created the following command:
\newcommand{\ppdv}[5]{\dfrac{\partial^{\fpeval{#3 + #5}} #1}{\partial {#2}^{#3} \partial {#4}^{#5}}}
So that, for example, if I type: \ppdv{f}{x}{2}{y}{3}
I will get: \dfrac{\partial^5 f}{\partial x^2 \partial y^3}
I have two problems:
If I write \ppdv{f}{x}{2}{y}{}
, meaning I only want to take the first derivative of variable y (I don't want to write number 1),
I won't get: \dfrac{\partial^3 f}{\partial x^2 \partial y}
And if I write \ppdv{f}{x}{n}{y}{4}
, meaning I want to calculate the n-th derivative of variable x,
I won't get: \dfrac{\partial^{n+4} f}{\partial x^2 \partial y}
Tex doesn't compile these tasks using xfp package. Is there a way to solve this problem? I won't bother changing xfp package for another one anyway.
Also, If I write, for example, \ppdv{f}{x}{2}{y}{m}
, meaning I want to calculate the m-th derivative of variable y,
I would like to get, if possible: \dfrac{\partial^{m+2} f}{\partial x^2 \partial y}
with de unknown letter m, being the first one to appear in the sum.
If anyone knows how to solve this problem I will appreciate it.
Best Answer
Here is one way to do it:
Code: