# How to compute the composition of linear differential operator [duplicate]

For example, I have to write down the differential operator below as a polynomial in $\partial$ $$(\partial-f_n(x))(\partial-f_{n-1}(x))\cdots(\partial-f_1(x))$$where the product the the composition. Specifically, $$y_1 = x - \frac{m}{m+1},y_2=1,T_1=x^m(x-1),T_2=x^n$$ $$(\partial - D[y_1, x]/y_1)(\partial - D[T_1y_2/y_1, x]/(T_1y_2/y_1))(\partial - D[T_1T_2y_1/y_2, x]/(T_1T_2y_2/y_2)) (\partial - D[T_1^2T_2/y_1, x]/(T_1^2T_2/y_1))$$ Here $D[f,x]$ means $f'$.

I need the coefficients in $\partial$. And this is the simplest case that I will consider.

• Can you give a specific example of what $f_i(x)$ might be, and of what you expect to do with this? – bill s Dec 3 '14 at 4:04
• @bill s $f_i$ are some rational functions in $x$, I need the coefficients in $\partial$. Thanks – Nirvanacs Dec 3 '14 at 4:09
• I don't know what you mean. Please give a specific example of the $f_i$ and what you expect/hope to see as an output. – bill s Dec 3 '14 at 4:14
• @bill s, I have given a specific example. – Nirvanacs Dec 3 '14 at 4:26
• Related to mathematica.stackexchange.com/questions/55182/… including my solution. – Dr. Wolfgang Hintze Dec 3 '14 at 13:01

I am assuming that $\partial$ in your question stands for the derivative with respect to x. Then you can directly use the method in my linked answer to solve this:

dx = Function[f, D[f, x]];
multiplyOp[scalar_, op_] := Function[{f1}, scalar op[f1]];
addOps[ops__] := Function[{f1}, Total@Map[#[f1] &, {ops}]];


$\left\{f(1)'(x)+f(1)(x) f(2)(x),f(1)(x)+f(2)(x),1\right\}$
Here I constructed the operator prod for example with two factors of the general type in the question. Then I apply prod to a test function Exp[k x] which has the property that every derivative pulls down a factor of k. To get the coefficients of the powers or the original $\partial$ operator, one therefore needs only to collect the powers of k. This is done by CoefficientList (with the lowest power first and the highest power last).