Homework, 5.1. pp. 349-
Calculus I
Andy Long

#4, p. 349

Clear[x,f,g,a,b]
a=0
b=3
f[x_]:=2x-x^2
g[x_]:=x^2-4x
Plot[{f[x],g[x]},{x,a,b},Filling->{1->{{2},{Yellow}}}]
Integrate[f[x]-g[x],{x,a,b}]

#5, p. 349

Clear[x,f,g,a,b]
a=-1;
b=2;
f[x_]:=x+1
g[x_]:=9-x^2
Plot[{f[x],g[x]},{x,a,b},Filling->{1->{{2},{Yellow}}}]
Integrate[g[x]-f[x],{x,a,b}]
N[%]

#7, p. 349

Clear[x,f,g,a,b]
a=1;
b=4;
f[x_]:=x
g[x_]:=(x-2)^2
Plot[{f[x],g[x]},{x,a,b},Filling->{1->{{2},{Yellow}}}]
Integrate[f[x]-g[x],{x,a,b}]
N[%]

#13, p. 349

a=0
b=3
f[x_]:=12-x^2
g[x_]:=x^2-6
Plot[{f[x],g[x]},{x,-b,b},Filling->{1->{{2},{Yellow}}}]
2*Integrate[f[x]-g[x],{x,a,b}]

#14, p. 349

a=0
b=2
f[x_]:=x^2
g[x_]:=4x-x^2
Plot[{f[x],g[x]},{x,a,b},Filling->{1->{{2},{Yellow}}}]
Integrate[g[x]-f[x],{x,a,b}]
N[%]

#21, p. 349

a=0
b=Pi/2
f[x_]:=Cos[x]
g[x_]:=1-2x/Pi
Plot[{f[x],g[x]},{x,0,Pi},Filling->{1->{{2},{Yellow}}}]
2*Integrate[f[x]-g[x],{x,a,b}]
N[%]

#28, p. 349

a=0
b=1
c=2
f[x_]:=x^2/4
g[x_]:=2x^2
h[x_]:=3-x
top[x_]:=If[x<b,g[x],h[x]]
Show[{
Plot[{g[x],h[x],f[x]},{x,a,c}],
Plot[{top[x],f[x]},{x,a,c},Filling->{1->{{2},{Yellow}}}]
}
]
Integrate[g[x]-f[x],{x,a,b}]+Integrate[h[x]-f[x],{x,b,c}]
N[%]