You are on page 1of 4

y

y2 x 2

y1 0.5x 1
B
1 K

A x
-2 0 b

a=roots([1 -0.5 -1]) % Intersection of y1 and y2


b=a(2) % The apsis value of B
Area_0KBb=quad(0.5x+1,0,b)
Area_0bB=(x.^2,0,b) % The area under the curve y2=x^2
Area=Area_0KBb- Area_0bB % Total area
X=-2:0.01:2;
y1=x.^2;
hold on
Plot(x,y1)
Y2=0.5*x+1;
Plot(x,y2)
Results
>>a =
-0.7808
1.2808
b =
1.2808
OKBb_yamugu =
1.6909
ObB_alti =
0.7003
alan =
0.9905
>>
y

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)

You might also like