S1:1/2;

M1:x/2;

Sa:q*b/2;

Ma:q*b*x/2;

Sb:-q*x+q*(a+b/2);

Mb:-q/2*x^2+(a+b/2)*q*x-q/2*a^2;

(1/kGA*(integrate((%o1)*(%o3),x,0,a)+integrate((%o1)*(%o5),x,a,a+b/2))+1/EI*(integrate((%o2)*(%o4),x,0,a)+integrate((%o2)*(%o6),x,a,a+b/2)))*2;

ratsimp((%));

expand(%);

subst(0,a,%);