MATLAB 帮助中心
Evaluate integrals
release(expr)
release(expr) evaluates the integrals in the expression expr. The release function ignores the 'Hold' option in the int function when the integrals are defined.
expr
release
'Hold'
int
example
collapse all
Define a symbolic call to an integral ∫cos(x) dx without evaluating it. Set the 'Hold' option to true when defining the integral using the int function.
syms x F = int(cos(x),'Hold',true)
F = ∫cos(x) dx
∫cos(x) dx
Use release to evaluate the integral by ignoring the 'Hold' option.
G = release(F)
G = sin(x)
Find the integral of ∫x ex dx.
Define the integral without evaluating it by setting the Hold option to true.
Hold
true
syms x g(y) F = int(x*exp(x),Hold=true)
F = ∫x ex dx
∫x ex dx
You can apply integration by parts to F by using the integrateByParts function. Use exp(x) as the differential to be integrated.
F
integrateByParts
exp(x)
G = integrateByParts(F,exp(x))
G = x ex-∫ex dx
x ex-∫ex dx
To evaluate the integral in G, use the release function to ignore the Hold option.
G
Gcalc = release(G)
Gcalc = x ex-ex
Compare the result to the integration result returned by int without setting the Hold option.
Fcalc = int(x*exp(x))
Fcalc = ex x-1
Find the integral of ∫cos(log(x))dx using integration by substitution.
Define the integral without evaluating it by setting the 'Hold' option to true.
syms x t F = int(cos(log(x)),'Hold',true)
F = ∫cos(log(x)) dx
∫cos(log(x)) dx
Substitute the expression log(x) with t.
log(x)
t
G = changeIntegrationVariable(F,log(x),t)
G = ∫et cos(t) dt
∫et cos(t) dt
To evaluate the integral in G, use the release function to ignore the 'Hold' option.
H = release(G)
H = et cos(t)+sin(t)2
et cos(t)+sin(t)2
Restore log(x) in place of t.
H = simplify(subs(H,t,log(x)))
H = 2 x sin(π4+log(x))2
2 x sin(π4+log(x))2
Compare the result to the integration result returned by int without setting the 'Hold' option to true.
Fcalc = int(cos(log(x)))
Fcalc = 2 x sin(π4+log(x))2
Expression containing integrals, specified as a symbolic expression, function, vector, or matrix.
Introduced in R2019b
integrateByParts | int | diff | changeIntegrationVariable
diff
changeIntegrationVariable
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处