4.3 积分
4.3.1 不定积分
[]:f=Lambda(x, atan(sqrt(x))/((1+x)\*sqrt(x)))
integrate(f(x), x)4.3.2 定积分
[]:integrate(exp(-x), (x, 0, log(2)))4.3.3 广义积分
4.3.4 无穷积分
4.4.5 瑕积分
Last updated
[]:f=Lambda(x, atan(sqrt(x))/((1+x)\*sqrt(x)))
integrate(f(x), x)[]:integrate(exp(-x), (x, 0, log(2)))Last updated
sympy.integrals.quadrature.**gauss_legendre**(*n*,*n_digits*)[]:from sympy.integrals.quadrature import gauss_legendre
n_point=10
xi, wi = gauss\_legendre(n_point, 5)
print(xi, wi)
[]:[-0.97391, -0.86506, -0.67941, -0.43340, -0.14887, 0.14887, 0.43340, 0.67941,
0.86506, 0.97391] [0.066671, 0.14945, 0.21909, 0.26927, 0.29552, 0.29552,
0.26927, 0.21909, 0.14945, 0.066671]
[]:f=Lambda(x, sqrt(16+6\*x-x\*\*2))
gauss_sum=0
for i in range(0, n_point):
gauss_sum=wi[i]\*f(xi[i])+gauss_sum
gauss_sum[]:integrate(exp(-x\*\*2), (x, 0, oo))[]:integrate(1/(1-x)\*\*2, (x, 0, 2))