kill(all)$

maxima :polynoom operation,translation  version 1.0A
peter.vlasschaert@gmail.com,19/11/2020

ref :youtube : https://www.youtube.com/watch?v=KhxiBgNfPBg
info :Bases of polynomial spaces | Wild Linear Algebra A 20 | NJ Wildberger

reason : relation between calculus & linear algebra.

load(lrats)$ ratprint:false$

powerdisp:true$

p1:p[α]:=sum(a[i]*α^i,i,0,3);

→ translation : polynoom 'thrid order'

p2:'p[x-3] = p[x-3];

p2a:lhs(p2)=expand(rhs(p2));

→ translation to right

p2b:lhs(p2)=sum(coeff(rhs(p2a),x,i)*x^i,i,0,3);

→ translation to left

p3:'p[x+3] = expand(p[x+3]);

p3a:lhs(p3)=sum(coeff(rhs(p3),x,i)*x^i,i,0,3);

p3b:x[i]:=coeff(rhs(p3a),x,i);

x[0];

p3ca:listofvars(%);

properties(p3ca);

p3ca1:apply(matrix,[p3ca]);

p3ca2:transpose(p3ca1);

p3cb:makelist(x[i],i,0,3);

p3d:coefmatrix(p3cb,p3ca);

p3dd:p3d[2,3];

simp:false;

p3da:p3d.p3ca2;

p3db:part(p3da,1);

simp:true;

p3dc:p3da;

p4:'p[α+c]=expand(p[α+c]);

p4a:lhs(p4)=sum(coeff(rhs(p4),α,i)*α^i,i,0,3);

y[i]:=coeff(rhs(p4a),α,i);

'y[2]=y[2];

depends(q,c);

p4b:q(c)=y[0];

p4b1:diff(p4b,c);

z[i]:=diff(p4b,c,i);

p5a:reverse(factorsum(z[0]));

p5a1:lhs(p5a)/y[0];

p5a2:p5a/p5a1;

p5b:reverse(factorsum(z[1]));

p5b1:lhs(p5b)/y[1];

p5b2:p5b/p5b1;

p5c:reverse(factorsum(z[2]));

p5c1:lhs(p5c)/y[2];

p5c2:p5c/p5c1;

p5d:reverse(factorsum(z[3]));

p5d1:lhs(p5d)/y[3];

p5d2:p5d/p5d1;

p6:[p5a2,p5b2,p5c2,p5d2];

p7:expand(lratsubst(p6,p4a));

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

depends(qq,c);

p8:pp[c+α]=ev(rhs(p7),q=qq);

p9:p7*p8;

p10:expand(p9);

→ leibnitz : rules  'differentation'

p10a:lhs(p10)=sum(coeff(rhs(p10),α,i)*α^i,i,0,3);

→la = (l)inear (a)lgebra
==================

p10b:ratsimp(makelist(coeff(rhs(p10a),α,i),i,0,3));

→ca= calculus (differentation rules from calculus)
============

0 differentation,c

v1a:diff(p10b[1],c,0);/* divide by 0!=1,see above:la */

one times differentation,c

v1b:diff(p10b[1],c,1);/* divide by 1=1!,see above:la */

two times differentation,c

v1c:diff(p10b[1],c,2);/* divide by 2=2!,see above:la */

three times differentation,c

v1d:diff(p10b[1],c,3);/* divide by 6=3!,see above:la */

p11:'p[α+c]=p[α+c];

→  α :→ α-c

p11a:lratsubst([α = α-c],p11);

→ p7

p11b:p7;

→ taylor series

p11b1:ev(p11b,α=α-c);

→ c=0, Maclauren series

p11b2:at(p11b1,c=0);

basis
====

→ standard basis :[1,α,α^2,α^3]
→ factorial basis   :[1,α,α^2/2!,α^3/3!], for differentation  problems.

1e)  graph :  translation  ()
-------------------------------------

p12a:p3a;

p12a1:makelist(1,i,1,length(p3ca));

p12a2:map("=",p3ca,p12a1);

p12b:subst(p12a2,p[x]);

p12c:subst(p12a2,p[x-3]);

→  moving  : graph to the right

p12d:wxplot2d([p12b,p12c],[x,-7,7]);

2e)  matrix relation and polynoom
----------------------------------------------
use :p12a

p13:p12a;

p13a:p3db;

powerdisp:true;

a) given: g1 :2-x+4*x^2+x^3;
---------------------------------

p13b:g1 = 2-x+4*x^2+x^3;

p13b1:makelist(coeff(rhs(p13b),x,i),i,0,3);

p13b2:transpose(apply(matrix,[p13b1]));

find : g1=g2
-----------------
? a[i]  i=0,1,2,3

p13c:g2=p[x-3];

p13c1:makelist(coeff(rhs(p13c),x-3,i),i,0,3);

p13c2:transpose(apply(matrix,[p13c1]));

solution: a[i], i=0,1,2,3
------------------------------

p13c3:p13c2=p13a.p13b2;

simp:false;

p13c4:ev(p13a.p13b2=rhs(p13c3));

b) given  x^2 = a[0]+a[1]*(x-3) +a[2]*(x-3)^2

→ find :a[0],a[1],a[2]

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

p14a:[0,0,1,0];
p14b:[0,0,x^2,0];

p14a1:transpose(apply(matrix,[p14a]));
p14b1:transpose(apply(matrix,[p14b]));

simp:false;

p14a2:p13a.p14a1=p13c2;

simp:true;

p14a3:p14a2;

p14a4:flatten(args(lhs(p14a3)));

p14a5:map("=",p13c1,p14a4);

check
=====
use :p14

p15:lratsubst(p14a5,p14);

p15a:is(p15);