kill(all)$

maxima: appendix :modified bernoulli polynomials, version 1,0
peter.vlasschaert@gmail.com,09/03/2022

ref : https://mathworld.wolfram.com/BernoulliPolynomial.html

Why: modified polynomials are need it for solving the integral equations.

load :packages
------------------

load(lrats)$

ordergreat(x)$

use: function.

bernpoly (x, 1);

definition : BernoulliPolynomial. (in Maxima)
----------------------------------------------------------

nn:6;

for i:0 thru nn do(
print("i=",i,"→",bernpoly(x,i))    
    )$

What to do remove "constant value" from : bernpoly(x,2*i), i=1,2,....

use : (p)redicate "even(p)"

evenp(2*3);

evenp(0);

corrected :bernpoly(x,4)

p1: bernpoly(x,2);
p1a:bernpoly(x,2*1)-bernpoly(0,2*1);

corrected :bernpoly(x,2*i), i=1,2,3,..............

n1:2;

p2:bernpoly(x,2*j)-bernpoly(0,2*j);

p2a:makelist(ev(p2,nouns),j,1,2*n1);

build : modified bernoulli polynomials (without constant values ,except:first term)

modibernpoly(xx,mm):=block([],
if mm=0 then q:bernpoly(xx,0), 
if evenp(mm) = true and mm≠0 then 
    q:bernpoly(x,mm)-bernpoly(0,mm)
else
    q:bernpoly(x,mm),
if mm=1 then q:bernpoly(xx,1)+1/2, 
    return(q)    
)$

modibernpoly(x,1);

for i:0 thru nn do(
print("i=",i,"→",modibernpoly(x,i))    
    )$

Use:

Numerical solutions :
Fredholm Integral Equations of Second kind using,
→  "Piecewise Bernoulli Polynomials" = modibernpoly(x,n) , n=0,1,......

special property: @x=0 and @x=1
------------------------------------------
i≥ 2, modibernpoly(x,i) =0

for i:0 thru nn do(
print("i=",i," x=0 → ",subst([x=0],modibernpoly(x,i))," x=1 → ",subst([x=1],modibernpoly(x,i))))$   

rem : bernoulli numbers
-------------------------------

Function: bern (n)
-----------------------

Returns the n'th Bernoulli number for integer n.
Bernoulli numbers equal to zero are suppressed 
if zerobern is false. 

zerobern: true$
s1:map (bern, [0, 1, 2, 3, 4, 5, 6, 7, 8]);

zerobern: false$
 s2:map (bern, [0, 1, 2, 3, 4, 5, 6, 7, 8]);

see: modibernpoly(x,n) → bernoulli numbers suppressed the zeros.

bm[k]:= -integrate(p2a[k],x,0,1);

see: s2[i],i=3 to 6

s1a:makelist(ev(bm[k],nouns),k,1,length(p2a));

s2a:makelist(s2[i],i,3,6);

is(s1a=s2a);

"no suppressed zeros": see "above: s1"

s3:makelist(bernpoly(0,k),k,0,8);

is(s1=s3);

--------------------------------------------------------------------------------------------------