kill(all)$

van=facebook.com/LearningCalculus$

           Bulbuul Dev of New Dehli, India asks:
           Find all polynomials P(x) such that 2P(x) = P(x-1) + P(x+1)

           First we write an expression for all polynomials:

P(a, x,n):=sum(a[i]*x^i,i,0,n);

P(a,x,1);

solve(%,a);

solve(%,x);

solve(P(a, x,3),a);

           Besides their coefficients, all that distinguishes polynomials is their leading exponent: n
           We write and simplify f(n)=0 such that 2P(x) = P(x-1) + P(x+1)

f(n):=P(x-1,n)-2*P(x,n)+P(x+1,n)=0;

f(0);

f(1);

f(2);

f(3);

f(4);

factor(%);

f(6);

factor(%);

           Now we look at the expansion of f(n) for n from 0 to 7

for n:0 thru 7 do
    print("Answer n = ", n, ":  ", (fullratsimp(expand(f(n)))));

           The first two cases are trivial, true for all constants and linear equations,
           the second case being the principle of superposition.

f(0);
f(1);
expand(f(1));

           For subsequent cases n = {2,6} we expand the solution to discover that a2 and a3 are always zero

for n:2 thru 6 do
    print("Answer n = ", n, ":  ", expand(fullratsimp((f(n)))));

           for n = 4 we have:

expand(f(4));
subst(0,a[3],subst(0,a[2],expand(f(4))));
solve(%,x);
solve(%,a);

for n:0 thru 10 do
    print("Answer n = ", n, ":  ", solve(fullratsimp(expand(f(n))),a));