R语言计算积分的数值解
1. 1.求下列积分的数值解
1(1)?031?x2edx2?1dx 2x2(2)?xln(x4)arcsin1(3)?e?xsin(x3)dx1?(1)
> f<-function(x)1/sqrt(2*pi)*exp(-x^2/2) > integrate(f,0,1)
0.3413447 with absolute error < 3.8e-15 (2)
> f<-function(x)x*log(x^4)*asin(1/x^2) > integrate(f,1,3)
2.459772 with absolute error < 6.2e-05 (3)
> f<-function(x)exp(-x)*sin(x^3) > integrate(f,1,Inf)
0.07797232 with absolute error < 0.00012
2.一个重5400kg的摩托车在以速度v=30m/s行驶时突然熄火,设滑行方程为
dv5400v??8.276v2?2000,x为滑行距离,计算要滑行多长距离后,速度可降
dx至15m/s?
5400vdv?12?8.276v?2000dx5400vdv?dx?8.276v2?2000
5400v??8.276v2?2000dv??dx155400v?30?8.276v2?2000dv?x > f<-function(v)5400*v/(8.276*v^2+2000) > integrate(f,15,30)
291.8696 with absolute error < 3.2e-12