clear;
clc;

disp('20子区间数值积分为')
s_20 = tixing(0,60,20)/60
disp('40子区间数值积分为')
s_40 = tixing(0,60,40)/60
disp('80子区间数值积分为')
s_80 = tixing(0,60,80)/60
disp('200子区间数值积分为')
s_200 = tixing(0,60,200)/60

%% 定义含 x 方程的方式

syms x;
y = @(x) ((60-x).^2 + (60-x).*sin(sqrt(x))).*(10*((60-x).^2 + (60-x).*sin(sqrt(x))) + 2*((60-x).^2 + (60-x).*sin(sqrt(x))).^(2/3));
s = integral(y, 0, 60, "AbsTol",5e-13)/60 % 求积分的函数
TOL = [s_20-s;
s_40-s;
s_80-s;
s_200-s]

%% 绘图

x=0:10:60;
i = (60-x).^2 + (60-x).*sin(x.^0.5);
y = i.*(10.*i + 2*i.^(2/3));
x1 = 0:0.5:60;
i = (60-x1).^2 + (60-x1).*sin(x1.^0.5);
y1 = i.*(10.*i + 2*i.^(2/3));
hold on
area(x,y,'FaceColor','b','EdgeColor','r','FaceAlpha',0.2) % 对区域涂色
plot(x1,y1,'w')
grid
