Professional Documents
Culture Documents
y2 x 2
y1 0.5x 1
B
1 K
A x
-2 0 b
y2 x 2
y 1 0.5 x 1
1 K
B
A x
-2 b 0
a=roots([1 -0.5 -1]) % Intersection of y1 and y2
b=a(2) % The apsis value of B
Area_Bb0=quad(0.5x+1-x.^2,0,b)
Area_AK0=(0.5*x+1,-2,0)
Area=Area_AK0- Area_Bb0 % Total area
X=-5:0.01:5;
y1=x.^2;
hold on
Plot(x,y1)
Y2=0.5*x+1;
Plot(x,y2)