kill(all)$

maxima : taylor one variable (symbolic or discrete),version 1.0
peter.vlasschaert@gmail.com,23/02/2022

load(lrats)$

p1:f(x)=taylor(f(x),x,x0,3);

→ taylor expansion around the point : x0

p2:f(x0+Δx)=expand(lratsubst([x-x0=Δx],rhs(p1)));

p3:subst([x0=x],p2);

→ get highest power of Δx

hipow(p3,Δx);

p4:makelist(at('diff(f(x),x,i),x=x) = 'diff(f(x),x,i),i,[1,2,3]);

p4a:makelist(at('diff(f(x),x,i),x=x) = 'diff(f(x),x,i),i,1,hipow(p3,Δx));

p5:subst(p4,p3);

p6:p5-f(x);

What about : Δy
--------------------

p6a:Δy = rhs(p6);

rem : 1! = 1,2! = 2,3! = 6,4! = 24,...................

discrete version : taylor expansion
==========================

step 1: principal:
---------------------

declare_index_properties(A1,[postsubscript,postsuperscript,presubscript,presuperscript])$
A1[postsubscript,postsuperscript,presubscript,presuperscript];

declare_index_properties(A2,[postsubscript,postsuperscript])$
A2[postsubscript,postsuperscript];

A2[d,0];

d = derivative
0 = function (A2)

A2[d,1];

d = derivative
1 =first order derivative function(A2)

step 2: makelist discrete symbols:
---------------------------------------

declare_index_properties(yi,[postsubscript,postsuperscript])$

p7a: makelist('diff(f(x),x,j)=yi[d,j],j,0,hipow(p3,Δx));

p7b:reverse(p7a);

step 3: makelist discrete taylor expansion:
---------------------------------------------------

use :p5, psubst : "parallel substitution"

p8a:yi[0,i]=psubst(p7a,rhs(p5));

→ rem : result is wrong.

p8a:yi[0,i]=psubst(p7b,rhs(p5));

→ rem : result is good.

----------------------------------------------------------
result :The place of the elements in the list
           depent for the final result with psubst.
----------------------------------------------------------
yi[0,i] = f(x+Δx)
----------------------------------------------------------