Question: Coefficients of differential polynomial. 2

Hello everyone!

Suppose, we have a differential polynomial

P := u(x) + (D@@2)(u)(x)

Given this, I am looking for a procedure which gives coefficients depending on the order given as input, for example, lets say, procedure name is fun_coeff which depends on two parameters, original polynomial P and the order n, then

fun_coeff(P, 3) should give [1, 0, 1, 0]

where each entry corresponds to the coeff of

 [u(x), (D@@1)(u)(x), (D@@2)(u)(x), (D@@3)(u)(x)]

in the polynomial, similarly

fun_coeff(P,4) should give [1, 0, 1, 0, 0]

corresponding to

 [u(x), (D@@1)(u)(x), (D@@2)(u)(x), (D@@3)(u)(x), (D@@4)(u)(x) ]

Thank you all for your time :)

Please Wait...