syms x
y=0.35*sin(pi*x);
dy=diff(y,x);
L=int(sqrt(1+(dy)^2),x,0,2);
L =
1/5/pi*(400+49*pi^2)^(1/2)*EllipticE(7*pi/(400+49*pi^2)^(1/2))
还可以用数值积分
x=0:0.01:2;%数值计算适合于有限区间上,取有限个采样点
f=sqrt(1+(0.35*pi*cos(pi*x)).^2);%给出被积函数f
L=trapz(x,f) %求定积分计算弧长
L =
1117/445