Main Content

release

Evaluate integrals

Description

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.

example

Examples

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

Use release to evaluate the integral by ignoring the 'Hold' option.

G = release(F)
G = sin(x)

Find the integral of xexdx.

Define the integral without evaluating it by setting the Hold option to true.

syms x g(y)
F = int(x*exp(x),Hold=true)
F = 

xex dx

You can apply integration by parts to F by using the integrateByParts function. Use exp(x) as the differential to be integrated.

G = integrateByParts(F,exp(x))
G = 

xex-ex dx

To evaluate the integral in G, use the release function to ignore the Hold option.

Gcalc = release(G)
Gcalc = xex-ex

Compare the result to the integration result returned by int without setting the Hold option.

Fcalc = int(x*exp(x))
Fcalc = exx-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

Substitute the expression log(x) with t.

G = changeIntegrationVariable(F,log(x),t) 
G = 

etcos(t) dt

To evaluate the integral in G, use the release function to ignore the 'Hold' option.

H = release(G)
H = 

etcos(t)+sin(t)2

Restore log(x) in place of t.

H = simplify(subs(H,t,log(x)))
H = 

2xsin(π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 = 

2xsin(π4+log(x))2

Input Arguments

collapse all

Expression containing integrals, specified as a symbolic expression, function, vector, or matrix.

Version History

Introduced in R2019b