# Analytic expression of the $n$-th derivative of a function of two variables

I am hoping to get Mathematica to find an analytic form for the $$n$$th derivative of the following function of two variables: $$f(a,b)=\frac{1}{\left((1-a) b\right)^{-k} \left(1-(1-a) b\right)^{k-n}+\left((1-a) b+a\right)^{-k} \left(1-(1-a) b-a\right)^{k-n}}$$ where $$(a,b)\in\mathbb{R}^2$$, $$(k,n)\in\mathbb{N}^2$$ are two constants such that $$k\le n$$, and $$f(a,b)\in\mathbb{R}$$.

To be more specific, rather than an "$$n$$th derivative", I am really talking about the $$\ell$$th and $$m$$th derivative with respect to a and b, as shown in the following Mathematica code:

f[a_, b_] := 1/(
1/(((1 - a) b)^k (1 - (1 - a) b)^(n - k)) +
1/(((1 - a) b + a)^k (1 - (1 - a) b - a)^(n - k)));
D[f[a, b], {a, l}, {b, m}]


The above code produces the following result (which I am including as a screenshot because I have not been able to make the output readable here in any other format):

As far as I can tell, the work done by Mathematica here is unsatisfactory because it still keeps two derivatives, one over $$b$$ and then one over $$a$$ (and I cannot understand why it has done the other "simplifications" since, as far as I can tell, they do not really push the ball forward).

This question was spawned following a comment on this other question. The answer to that question uses a workaround for obtaining the result of the nth derivative of a function of one variable. That said, it is unclear to me if or how the proposed method would be transferable to a function of two variables.

This is related to yet another question in which it turns out that Mathematica is (in its current version) capable of producing a satisfactory answer using the DifferenceRoot function (although it is still not clear to me how a potential DifferenceRoot function, if it were to appear in my case, would be used). In this post, Maple was also used, and I have tried that route as well, to no avail in my case.

• f[a_, b_] := 1/(1/(((1 - a) b)^k (1 - (1 - a) b)^(n - k)) + 1/(((1 - a) b + a)^k (1 - (1 - a) b - a)^(n - k))); k = 3; n = 7; l = 5; m = 7; D[f[a, b], {a, l}, {b, m}] result in the output which takes 20.2 MB. Are you really interested in it? Commented Jun 14 at 10:21
• NO hope to compute n-th derivative for general parameters k and n of function f[a,b] , because is too complex. This is one of those questions that will remain unanswered for many years, probably. I may be wrong :P Commented Jun 14 at 12:32
• @user64494 thanks for that test, though I do not think that the fact that Mathematica has a large finite series for specific values is related to the size or existence of the closed form, e.g. Sum[Binomial[n, k] x^k, {k, 0, [Infinity]}] vs Sum[Binomial[n, k] x^k, {k, 0, 17}]. I could be wrong, but I have seen simplifications (for series in particular) not immediately visible to MMA. Commented Jun 14 at 15:35
• @MariuszIwaniuk you might be right, but without asking I would just be stuck on this problem on my own :) thanks for your feedback, I was hoping your workaround would be applicable in this case. Commented Jun 14 at 15:38