# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

# `intlib`::`changevar`

Change of variable

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```intlib::changevar(`integral`, `eq`, <`var`>)
```

## Description

`intlib::changevar(integral, eq)` performs a change of variable for indefinite and definite integrals.

Mathematically, the substitution rule is formally defined for indefinite integrals as

and for definite integrals as

`intlib::changevar(integral, eq)` performs in `integral` the change of variable defined by `eq` and returns an unevaluated new integral. You can use the `eval` command to find the closed form of this new integral providing that the closed form exists.

`intlib::changevar` works for indefinite as well as for definite integrals.

The first argument should contain a symbolic integral of type `"int"`. Such an expression can be obtained with `hold` or `freeze`. See Example 1.

If more than two variables occur in `eq`, the new variable must be given as third argument.

If MuPAD® cannot solve the given equation `eq` an error will occur.

## Examples

### Example 1

As a first example we perform a change of variable for the integral . By using the `hold` function we ensure that the first argument is of type `"int"`:

```intlib::changevar(hold(int)(f(x + c), x = a..b), t = x + c, t)```

Note that in this case the substitution equation has two further variables besides x. Thus it is necessary to specify the new integration variable as third argument.

### Example 2

In the following example we use the change of variable method for solving the integral . First we perform the transformation t = ln(x):

```f1 := intlib::changevar(hold(int)(cos(ln(x)), x), t = ln(x), t)```

Now we can evaluate the integral with the MuPAD integrator:

`f2:=eval(f1)`

Finally we change the variable t back to x and get the result:

`F := simplify(f2 | t = ln(x))`

We can also verify the solution of the integral:

`simplify(diff(F,x) - cos(ln(x)))`

## Parameters

 `integral` The integral: an arithmetical expression containing a symbolic `"int"` call `eq` Equation defining the new integration variable in terms of the old one: an equation `var` The new integration variable: an identifier

## Return Values

Arithmetical expression.