# intlib::byparts

Integration by parts

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

```intlib::byparts(`integral`, `du`)
```

## Description

`intlib::byparts(integral, du)` performs on `integral` the integration by parts, where `du` is the part to be integrated and returns an expression containing the unevaluated partial integral.

Mathematically, the rule of integration by parts is formally defined for indefinite integrals as

and for definite integrals as

.

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

If MuPAD® cannot solve the integral for `du` in case of definite integration, the function call is returned unevaluated.

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

The second argument `du` should typically be a partial expression of the integrand in `integral`.

## Examples

### Example 1

As a first example we apply the rule of integration by parts to the integral . By using the function `hold` we ensure that the first argument is of type `"int"`:

`intlib::byparts(hold(int)(x*exp(x), x = a..b), exp(x))`

In this case the ansatz is chosen as and thus v(x) = x.

### Example 2

In the following we give a more advanced example using the method of integration by parts for solving the integral . For this we have to prevent that the integrator already evaluates the integrals. Thus we first inactivate the requested integral with the function `freeze`

`F := freeze(int)(exp(a*x)*sin(b*x), x)`

and apply afterwards partial integration with :

`F1 := intlib::byparts(F, exp(a*x))`

This result contains another symbolic integral, which MuPAD can solve directly:

`eval(F1)`

### Example 3

Here we demonstrate the difference between indefinite and definite integration by parts. If in the indefinite case the partial part cannot be solved, simply the unevaluated integral is plugged into the integration rule:

`intlib::byparts(hold(int)(x*f(x), x),f(x))`

This is no longer true for the definite case:

```intlib::printWarnings(TRUE): intlib::byparts(hold(int)(x*f(x), x=a..b),f(x))```
```Warning: No closed form for 'int(f(x), x)' is found. [intlib::byparts] ```

## Parameters

 `integral` Integral: an arithmetical expression containing a symbolic `"int"` call of the form `int(du*v, x)` or ```int(du*v, x = a..b)``` `du` The part to be integrated: an arithmetical expression

## Return Values

Arithmetical expression.