kill(all);

van=facebook.com/LearningCalculus$

P(x):=a*x+b;

Q(x):=A*x+B;

f(x):=P(x)*Q(x)$
g(x):=P(x)/Q(x)$

van=facebook.com/LearningCalculus$

           Find Blue Area

f(x)=g(x);

s:solve(f(x)=g(x),x);

p(k):=[rhs(s[k]),f(rhs(s[k]))]$
p(1); p(2); p(3);

A1:integrate(f(x),x,rhs(s[1]),rhs(s[2]));

assume(A > 0)$
intanalysis:false$
A2:integrate(g(x),x,rhs(s[1]),rhs(s[2]));

A1-A2;

fullratsimp(%);