kill(all);

van=facebook.com/LearningCalculus;

PList: [integrate(a*x+b,x,0,2)=4,integrate((a*x+b)^2,x,0,2)=14];

QList: [integrate(c*x+d,x,0,2)=2,integrate((c*x+d)^2,x,0,2)=26];

solve(PList,[a,b]);

solve(QList,[c,d]);

P1(x):=3*x-1$ P2(x):= -3*x + 5$

Q1(x):= -6*x+7$ Q2(x):=6*x-5$

solutions: sort([
    integrate(P1(x)*Q1(x),x,0,2),
    integrate(P1(x)*Q2(x),x,0,2),
    integrate(P2(x)*Q1(x),x,0,2),
    integrate(P2(x)*Q2(x),x,0,2)
]);

["min", first(solutions), "max", last(solutions)];

graphics: [
    integrate(P1(x)*Q1(x),x),
    integrate(P1(x)*Q2(x),x),
    integrate(P2(x)*Q1(x),x),
    integrate(P2(x)*Q2(x),x)
];