Question: applyrule for different expressions

restart;

eq1 := a[n+2]+4*a[n+1]+10*a[n]-5*n-1;

applyrule(a[n::anything] = n*p+q+b[n], eq1);

eq2 := a(n+2)+4*a(n+1)+10*a(n)-5*n-1;

applyrule(a(n::anything) = b(n)+n*p+q, eq2);

eq3 := a(n+2)+4*a(n+1)+10*a(n) = 5*n+1;

applyrule(a(n::anything) = b(n)+n*p+q, eq3)

 

So my question is: Why does the first one not work? the second one works as expected, but the third one again does not?!

Please Wait...