changeIntegrationVariable

Substitutes a new variable into an integral.

Category: Mathematics > Calculus

Syntax

G = changeIntegrationVariable(F, old, new)

Rewrites the integral F by setting old equal to the expression new of a new variable.

Description

The substitution x = g(u) turns int(f(x), x, a, b) into int(f(g(u))*g'(u), u, ua, ub), where the new limits solve g(u) = a and g(u) = b. The function does exactly this bookkeeping, which is easy to get wrong by hand. F must be an int expression, so an abstract integrand such as f(x) is the clearest way to see the effect.

Input arguments

F
Unevaluated integral created with int.
old
The integration variable of F.
new
Expression of the new variable, such as sqrt(z).

Output arguments

G
Integral in the new variable, with the integrand multiplied by the derivative of the substitution and the limits transformed.

Example

Substitute x = sqrt(z)

syms x u
F = int(2*x*exp(x^2), x, 0, 1);
G = changeIntegrationVariable(F, x, sqrt(u))
Output
G = int(exp(u), u, 0, 1)

See also

int integrateByParts subs solve