Find the area of the regions enclosed by the curves y=x^2-2x, y=x.

1 view (last 30 days)
clc
clear
syms x
y1 = x^2-2*x;
y2 = x;
fplot(y1)
hold all
fplot(y2)
xi = solve(y1-y2);
yi(1) = eval(subs(y1,xi(1)));
yi(2) = eval(subs(y1,xi(2)));
plot(xi,yi,'o')
%% integration... how to use that over here???

Answers (1)

John D'Errico
John D'Errico on 19 Dec 2020
You know the x locations of the two points where the curves intersect.
Is the area not just the integral of y2-y1 between those limits?
Just use int for that?

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!