Question: algeqtoseries error

opoly := (1-x^2)*diff(f(x), x$2) - x*diff(f(x), x) + n^2*f(x) = 0;
sol := op(2,dsolve(opoly));
P := sum(cos(n*arcsin(x))*z^n/n!, n=0..7);
with(gfun):
algeqtoseries(P, x, z, 7, true);

Error, invalid input: gfun:-algeqtoseries expects its 1st argument, Pol, to be of type polynom(anything, [x, y]), but received 1+(1-x^2)^(1/2)*z+(1/2)*cos(2*arcsin(x))*z^2+(1/6)*cos(3*arcsin(x))*z^3+(1/24)*cos(4*arcsin(x))*z^4+(1/120)*cos(5*arcsin(x))*z^5+(1/720)*cos(6*arcsin(x))*z^6+(1/5040)*cos(7*arcsin(x))*z^7

Please Wait...