First we define the Green's function for the ODE:

> G:=(x,y)->piecewise(y>=0 and y <=x,y*(1-x),x<=y and y<=1,x*(1-y));

[Maple Math]

and then the solution of the ODE using the Green's function is given by:

> x:='x':f:='f':sol:=int(G(x,y)*f(y),y=0..1);

[Maple Math]

Limit the range of x:

> assume(x>0);additionally(x<1);

Define ODE for the dsolve:

> ode:=-diff(v(x),x$2)=f(x);

[Maple Math]

First case:

> f:=y->y*y;

[Maple Math]

> u:=eval(sol);

[Maple Math]

Let's try to use dsolve to see if it gives the same solution:

> sol2:=dsolve({ode,v(0)=0,v(1)=0},v(x));

[Maple Math]

OK. Solutions are the same. Let's verify the solution by differentiating and evaluating u(0) and u(1):

> -diff(u,x$2);

[Maple Math]

> subs(x=0,u);

[Maple Math]

> subs(x=1,u);

[Maple Math]

Finally here is a plot of the solution:

> plot(u,x=0..1);

Second case:u(0);

> f:=y->exp(y);

[Maple Math]

Maple does not show the argument of exp, is it a bug? Anyway the internal representation seems to be correct. Solution with Green's function:

> u:=eval(sol);

[Maple Math]

Solution with dsolve:

> sol2:=dsolve({ode,v(0)=0,v(1)=0},v(x));

[Maple Math]

Verification:

> -diff(u,x$2);

[Maple Math]

> simplify(subs(x=0,u));

[Maple Math]

> subs(x=1,u);

[Maple Math]

Plot of the solution:

> plot(u,x=0..1);

Third case:

> f:=y->cos(a*y);

[Maple Math]

> u:=eval(sol);

[Maple Math]

Solution with dsolve:

> sol2:=dsolve({ode,v(0)=0,v(1)=0},v(x));

[Maple Math]

Verification:

> -diff(u,x$2);

[Maple Math]

> simplify(subs(x=0,u));

[Maple Math]

> subs(x=1,u);

[Maple Math]

Plot of the solution:

> plot(subs(a=1,u),x=0..1);

>