Poisson's equation in 1 dim.
''(x)=
, u(0)=u(1)=0 .
This is part of the worksheet by HA.
Green's function
> G:=(x,y)->piecewise(y>=0 and y <=x,y*(1-x),x<=y and y<=1,x*(1-y));
> x:=0.1:y:=0.2:simplify(G(x,y)-G(y,x));x:='x':y:='y':
> x:='x':f:='f':sol:=int(G(x,y)*f(y),y=0..1);
> assume(x>0);additionally(x<1);
> f:=x->(x^2);
> u:=factor(eval(sol));
> plot(u,x=0..1);
Check:
> simplify(-diff(u,x,x));subs(x=0,u),subs(x=1,u);
O.K.
> f:=x->exp(x);
> u:=factor(eval(sol));
> plot(u,x=0..1);
> simplify(-diff(u,x,x));subs(x=0,u),subs(x=1,u);
> f:=x->cos(x);
> u:=factor(eval(sol));
> plot(u,x=0..1);
> simplify(-diff(u,x,x));subs(x=0,u),subs(x=1,u);
>