restart; F:=ln(abs(x+1))-ln(abs(x+2)); plot(F,x=-4..4,y=-4..4); ?piecewise C:=piecewise(x>-1,3, x>-2 and x<-1,1, x<-2,4); plot(F+C,x=-4..4,y=-8..8); a1:=int((B*x+E)/(x^2+x+1),x); t2:=op(3,op(2,a1)); collect(a1,t2);