kill(all)$

maxima :intro  powerseries, maclauren,taylor series,version1.0
peter.vlasschaert@gmail.com,14/11/2020

load packages, option 
==================

load(lrats)$ ratprint:false$

1e)  Maclauren series.
-------------------------------
representation function : polynoom

suppose : represent f1(x) thrid order ploy

powerdisp:true;

first approximation for function : 

p1a:f1(x) = a[0]+a[1]*x+a[2]*x^2+a[3]*x^3;

1e)  → f1(x),at (x=0)

p1b:subst([x=0],p1a);

p1b1:reverse(p1b);

2e)  → first differentation

p1c:diff(p1a,x);

p1c1:rhs(p1c);

      → p[1](0)

p1c2:at('diff(f1(x), x)=p1c1, x= 0);

p1c3:reverse(p1c2);

3e)  → second differentation

p2c:diff(p1a,x,2);

         → @ x=0

p2c1:at(p2c,x=0);

p2c2:solve(p2c1,a[2])[1];

4e)  →thrid differentation

p3c:diff(p1a,x,3);

p3c1:at(p3c,x=0);

p3c2:solve(p3c1,a[3])[1];

rem : 2! =2 ,3! =6

 p4c:lratsubst([p1b1,p1c3,p2c2,p3c2],p1a);

p4c1:expand(p4c);

f1(x) , representation , power serie @ x= 0, v = inf

p5c:f1(x)=sum(at(diff(f1(x),x,m)/m!,x=0)*x^m,m,0,v);

p5c1:subst([v=3],p5c);

p5c2:ev(p5c1,nouns);

def : Maclauren serie ,@ x=0, v → ∞
=============================
use : p5c

p6c:lhs(p5c2) = limit(rhs(p5c),v,inf);

p6c1:lratsubst([v=inf],p5c);

Taylor series : approximation @ x ≠ 0  ,@ some value,  x = c

p6c1:f2(x,m):= sum(a[i]*(x-c)^i,i,0,m);

p6c2:'f2(x,3)=f2(x,3);

p6c3:'diff('f2(x,3),x,k)=diff(rhs(p6c2),x,k);

→ first order derivative.

p6c4:subst([k=1],p6c3);

p6c4a:lhs(p6c4)=ev(rhs(p6c4),nouns);

p6c4b:at(p6c4a,x=c);

p6c4b1:reverse(p6c4b);

→ second order derivative.

p6c5:subst([k=2],p6c3);

p6c5a:lhs(p6c5)=ev(rhs(p6c5),nouns);

p6c5b:at(lhs(p6c5a)=rhs(p6c5a),x=c);

p6c5c:solve(p6c5b,a[2])[1];

p5c5d:a[i]=at('diff('f2(x,3),x,i)/i!,x=c);

p5c5e:makelist(lratsubst([i=j],p5c5d),j,0,3);

p5c5f:'f2(x,3)=subst(p5c5e,f2(x,3));

def : Taylor serie :f2(x),@ x=c, v → ∞
=============================
use : p5c

p6:a[i]=at('diff('f2(x),x,i)/i!,x=c);

p6a:lratsubst([p6],a[i]*(x-c)^i);

p6b:'f2(x)=sum(p6a,i,0,v);

p6b1:'f2(x) = lratsubst([v=3],rhs(p6b));

→ approximation: f2(x,3) =f2(x), v=3

power serie : v → ∞, from taylor expansion.

p6c:subst([v=inf],p6b);