Integration by parts

In calculus, and more generally in mathematical analysis, integration by parts or partial integration is a process that finds the integral of a product of functions in terms of the integral of the product of their derivative and antiderivative. It is frequently used to transform the antiderivative of a product of functions into an antiderivative for which a solution can be more easily found. The rule can be thought of as an integral version of the product rule of differentiation.

If u = u(x) and du = u'(x) dx, while v = v(x) and dv = v'(x) dx, then integration by parts states that:

${\displaystyle {\begin\int _^u(x)v'(x)\,dx&\ =\ {\Big [}u(x)v(x){\Big ]}_^-\int _^u'(x)v(x)\,dx\\&\ =\ u(b)v(b)-u(a)v(a)-\int _^u'(x)v(x)\,dx\end}}$

or more compactly:

${\displaystyle \int u\,dv\ =\ uv-\int v\,du.}$

Mathematician Brook Taylor discovered integration by parts, first publishing the idea in 1715.[1][2] More general formulations of integration by parts exist for the Riemann–Stieltjes and Lebesgue–Stieltjes integrals. The discrete analogue for sequences is called summation by parts.

Theorem

Product of two functions

The theorem can be derived as follows. For two continuously differentiable functions u(x) and v(x), the product rule states:

${\displaystyle {\Big (}u(x)v(x){\Big )}'\ =\ v(x)u'(x)+u(x)v'(x).}$

Integrating both sides with respect to x,

${\displaystyle \int {\Big (}u(x)v(x){\Big )}'\,dx\ =\ \int u'(x)v(x)\,dx+\int u(x)v'(x)\,dx,}$

and noting that an indefinite integral is an antiderivative gives

${\displaystyle u(x)v(x)\ =\ \int u'(x)v(x)\,dx+\int u(x)v'(x)\,dx,}$

where we neglect writing the constant of integration. This yields the formula for integration by parts:

${\displaystyle \int u(x)v'(x)\,dx\ =\ u(x)v(x)-\int u'(x)v(x)\,dx,}$

or in terms of the differentials ${\displaystyle \ du=u'(x)\,dx,\ \ dv=v'(x)\,dx,\quad }$

${\displaystyle \int u(x)\,dv\ =\ u(x)v(x)-\int v(x)\,du.}$

This is to be understood as an equality of functions with an unspecified constant added to each side. Taking the difference of each side between two values x = a and x = b and applying the fundamental theorem of calculus gives the definite integral version:

${\displaystyle \int _^u(x)v'(x)\,dx\ =\ u(b)v(b)-u(a)v(a)-\int _^u'(x)v(x)\,dx.}$

The original integral ∫ uv′ dx contains the derivative v′; to apply the theorem, one must find v, the antiderivative of v', then evaluate the resulting integral ∫ vu′ dx.

Validity for less smooth functions

It is not necessary for u and v to be continuously differentiable. Integration by parts works if u is absolutely continuous and the function designated v′ is Lebesgue integrable (but not necessarily continuous).[3] (If v′ has a point of discontinuity then its antiderivative v may not have a derivative at that point.)

If the interval of integration is not compact, then it is not necessary for u to be absolutely continuous in the whole interval or for v′ to be Lebesgue integrable in the interval, as a couple of examples (in which u and v are continuous and continuously differentiable) will show. For instance, if

${\displaystyle u(x)=\exp(x)/x^,\,v'(x)=\exp(-x)}$

u is not absolutely continuous on the interval [1, ∞), but nevertheless

${\displaystyle \int _^{\infty }u(x)v'(x)\,dx={\Big [}u(x)v(x){\Big ]}_^{\infty }-\int _^{\infty }u'(x)v(x)\,dx}$

so long as ${\displaystyle \left[u(x)v(x)\right]_^{\infty }}$ is taken to mean the limit of ${\displaystyle u(L)v(L)-u(1)v(1)}$ as ${\displaystyle L\to \infty }$ and so long as the two terms on the right-hand side are finite. This is only true if we choose ${\displaystyle v(x)=-\exp(-x).}$ Similarly, if

${\displaystyle u(x)=\exp(-x),\,v'(x)=x^{-1}\sin(x)}$

v′ is not Lebesgue integrable on the interval [1, ∞), but nevertheless

${\displaystyle \int _^{\infty }u(x)v'(x)\,dx={\Big [}u(x)v(x){\Big ]}_^{\infty }-\int _^{\infty }u'(x)v(x)\,dx}$

with the same interpretation.

One can also easily come up with similar examples in which u and v are not continuously differentiable.

Further, if ${\displaystyle f(x)}$ is a function of bounded variation on the segment ${\displaystyle [a,b],}$ and ${\displaystyle \varphi (x)}$ is differentiable on ${\displaystyle [a,b],}$ then

${\displaystyle \int _^f(x)\varphi '(x)\,dx=-\int _{-\infty }^{\infty }{\widetilde {\varphi }}(x)\,d({\widetilde {\chi }}_{[a,b]}(x){\widetilde }(x)),}$

where ${\displaystyle d(\chi _{[a,b]}(x){\widetilde }(x))}$ denotes the signed measure corresponding to the function of bounded variation ${\displaystyle \chi _{[a,b]}(x)f(x)}$, and functions ${\displaystyle {\widetilde },{\widetilde {\varphi }}}$ are extensions of ${\displaystyle f,\varphi }$ to ${\displaystyle \mathbb ,}$ which are respectively of bounded variation and differentiable.[citation needed]

Product of many functions

Integrating the product rule for three multiplied functions, u(x), v(x), w(x), gives a similar result:

${\displaystyle \int _^uv\,dw\ =\ {\Big [}uvw{\Big ]}_^-\int _^uw\,dv-\int _^vw\,du.}$

In general, for n factors

${\displaystyle \left(\prod _^u_(x)\right)'\ =\ \sum _^\prod _^u_(x)\,u_'(x),}$

${\displaystyle \left[\prod _^u_(x)\right]_^\ =\ \sum _^\int _^\prod _^u_(x)\,u_'(x),}$

where the product is of all functions except for the one differentiated in the same term.

Visualization

Graphical interpretation of the theorem. The pictured curve is parametrized by the variable t.

Consider a parametric curve by (x, y) = (f(t), g(t)). Assuming that the curve is locally one-to-one and integrable, we can define

${\displaystyle x(y)=f(g^{-1}(y))}$
${\displaystyle y(x)=g(f^{-1}(x))}$

The area of the blue region is

${\displaystyle A_=\int _}^}x(y)\,dy}$

Similarly, the area of the red region is

${\displaystyle A_=\int _}^}y(x)\,dx}$

The total area A1 + A2 is equal to the area of the bigger rectangle, x2y2, minus the area of the smaller one, x1y1:

${\displaystyle \overbrace {\int _}^}x(y)\,dy} ^}+\overbrace {\int _}^}y(x)\,dx} ^}\ =\ {\biggl .}x\cdot y(x){\biggl |}_}^}\ =\ {\biggl .}y\cdot x(y){\biggl |}_}^}.}$

Or, in terms of t,

${\displaystyle \int _}^}x(t)\,dy(t)+\int _}^}y(t)\,dx(t)\ =\ {\biggl .}x(t)y(t){\biggl |}_}^}}$

Or, in terms of indefinite integrals, this can be written as

${\displaystyle \int x\,dy+\int y\,dx\ =\ xy}$

Rearranging:

${\displaystyle \int x\,dy\ =\ xy-\int y\,dx}$

Thus integration by parts may be thought of as deriving the area of the blue region from the area of rectangles and that of the red region.

This visualization also explains why integration by parts may help find the integral of an inverse function f−1(x) when the integral of the function f(x) is known. Indeed, the functions x(y) and y(x) are inverses, and the integral ∫ x dy may be calculated as above from knowing the integral ∫ y dx. In particular, this explains use of integration by parts to integrate logarithm and inverse trigonometric functions.

Applications

Finding antiderivatives

Integration by parts is a heuristic rather than a purely mechanical process for solving integrals; given a single function to integrate, the typical strategy is to carefully separate this single function into a product of two functions u(x)v(x) such that the residual integral from the integration by parts formula is easier to evaluate than the single function. The following form is useful in illustrating the best strategy to take:

${\displaystyle \int uv\ dx=u\int v\ dx-\int \left(u'\int v\ dx\right)\ dx.}$

On the right-hand side, u is differentiated and v is integrated; consequently it is useful to choose u as a function that simplifies when differentiated, or to choose v as a function that simplifies when integrated. As a simple example, consider:

${\displaystyle \int {\frac {\ln(x)}}}\ dx\ .}$

Since the derivative of ln(x) is 1/x, one makes (ln(x)) part u; since the antiderivative of 1/x2 is −1/x, one makes 1/x2 dx part dv. The formula now yields:

${\displaystyle \int {\frac {\ln(x)}}}\ dx=-{\frac {\ln(x)}}-\int {\biggl (}{\frac }{\biggr )}{\biggl (}-{\frac }{\biggr )}\ dx\ .}$

The antiderivative of −1/x2 can be found with the power rule and is 1/x.

Alternatively, one may choose u and v such that the product u′ (∫v dx) simplifies due to cancellation. For example, suppose one wishes to integrate:

${\displaystyle \int \sec ^(x)\cdot \ln {\Big (}{\bigl |}\sin(x){\bigr |}{\Big )}\ dx.}$

If we choose u(x) = ln(|sin(x)|) and v(x) = sec2x, then u differentiates to 1/ tan x using the chain rule and v integrates to tan x; so the formula gives:

${\displaystyle \int \sec ^(x)\cdot \ln {\Big (}{\bigl |}\sin(x){\bigr |}{\Big )}\ dx=\tan(x)\cdot \ln {\Big (}{\bigl |}\sin(x){\bigr |}{\Big )}-\int \tan(x)\cdot {\frac {\tan(x)}}\,dx\ .}$

The integrand simplifies to 1, so the antiderivative is x. Finding a simplifying combination frequently involves experimentation.

In some applications, it may not be necessary to ensure that the integral produced by integration by parts has a simple form; for example, in numerical analysis, it may suffice that it has small magnitude and so contributes only a small error term. Some other special techniques are demonstrated in the examples below.

Polynomials and trigonometric functions

In order to calculate

${\displaystyle I=\int x\cos(x)\ dx\ ,}$

let:

${\displaystyle u=x\ \Rightarrow \ du=dx}$
${\displaystyle dv=\cos(x)\ dx\ \Rightarrow \ v=\int \cos(x)\ dx=\sin(x)}$

then:

${\displaystyle {\begin\int x\cos(x)\ dx&=\int u\ dv\\&=u\cdot v-\int v\,du\\&=x\sin(x)-\int \sin(x)\ dx\\&=x\sin(x)+\cos(x)+C,\end}}$

where C is a constant of integration.

For higher powers of x in the form

${\displaystyle \int x^e^\ dx,\ \int x^\sin(x)\ dx,\ \int x^\cos(x)\ dx\ ,}$

repeatedly using integration by parts can evaluate integrals such as these; each application of the theorem lowers the power of x by one.

Exponentials and trigonometric functions

An example commonly used to examine the workings of integration by parts is

${\displaystyle I=\int e^\cos(x)\ dx.}$

Here, integration by parts is performed twice. First let

${\displaystyle u=\cos(x)\ \Rightarrow \ du=-\sin(x)\ dx}$
${\displaystyle dv=e^\ dx\ \Rightarrow \ v=\int e^\ dx=e^}$

then:

${\displaystyle \int e^\cos(x)\ dx=e^\cos(x)+\int e^\sin(x)\ dx.}$

Now, to evaluate the remaining integral, we use integration by parts again, with:

${\displaystyle u=\sin(x)\ \Rightarrow \ du=\cos(x)\ dx}$
${\displaystyle dv=e^\ dx\ \Rightarrow \ v=\int e^\ dx=e^.}$

Then:

${\displaystyle \int e^\sin(x)\ dx=e^\sin(x)-\int e^\cos(x)\ dx.}$

Putting these together,

${\displaystyle \int e^\cos(x)\ dx=e^\cos(x)+e^\sin(x)-\int e^\cos(x)\ dx.}$

The same integral shows up on both sides of this equation. The integral can simply be added to both sides to get

${\displaystyle 2\int e^\cos(x)\ dx=e^{\bigl (}\sin(x)+\cos(x){\bigr )}+C}$

which rearranges to:

${\displaystyle \int e^\cos(x)\ dx={\frac {\bigl (}\sin(x)+\cos(x){\bigr )}}}+C'}$

where again C (and C′ = C/2) is a constant of integration.

A similar method is used to find the integral of secant cubed.

Functions multiplied by unity

Two other well-known examples are when integration by parts is applied to a function expressed as a product of 1 and itself. This works if the derivative of the function is known, and the integral of this derivative times x is also known.

The first example is ∫ ln(x) dx. We write this as:

${\displaystyle I=\int \ln(x)\cdot 1\ dx\ .}$

Let:

${\displaystyle u=\ln(x)\ \Rightarrow \ du={\frac }}$
${\displaystyle dv=dx\ \Rightarrow \ v=x}$

then:

${\displaystyle {\begin\int \ln(x)\ dx&=x\ln(x)-\int {\frac }\ dx\\&=x\ln(x)-\int 1\ dx\\&=x\ln(x)-x+C\end}}$

where C is the constant of integration.

The second example is the inverse tangent function arctan(x):

${\displaystyle I=\int \arctan(x)\ dx.}$

Rewrite this as

${\displaystyle \int \arctan(x)\cdot 1\ dx.}$

Now let:

${\displaystyle u=\arctan(x)\ \Rightarrow \ du={\frac }}}$
${\displaystyle dv=dx\ \Rightarrow \ v=x}$

then

${\displaystyle {\begin\int \arctan(x)\ dx&=x\arctan(x)-\int {\frac }}\ dx\\[8pt]&=x\arctan(x)-{\frac {\ln(1+x^)}}+C\end}}$

using a combination of the inverse chain rule method and the natural logarithm integral condition.

LIATE rule

A rule of thumb has been proposed, consisting of choosing as u the function that comes first in the following list:[4]

Llogarithmic functions: ${\displaystyle \ln(x),\ \log _(x),}$ etc.
Iinverse trigonometric functions: ${\displaystyle \arctan(x),\ \operatorname (x),}$ etc.
Aalgebraic functions: ${\displaystyle x^,\ 3x^,}$ etc.
Ttrigonometric functions: ${\displaystyle \sin(x),\ \tan(x),}$ etc.
Eexponential functions: ${\displaystyle e^,\ 19^,}$ etc.

The function which is to be dv is whichever comes last in the list: functions lower on the list have easier antiderivatives than the functions above them. The rule is sometimes written as "DETAIL" where D stands for dv.

To demonstrate the LIATE rule, consider the integral

${\displaystyle \int x\cdot \cos(x)\,dx.}$

Following the LIATE rule, u = x, and dv = cos(x) dx, hence du = dx, and v = sin(x), which makes the integral become

${\displaystyle x\cdot \sin(x)-\int 1\sin(x)\,dx,}$

which equals

${\displaystyle x\cdot \sin(x)+\cos(x)+C.}$

In general, one tries to choose u and dv such that du is simpler than u and dv is easy to integrate. If instead cos(x) was chosen as u, and x dx as dv, we would have the integral

${\displaystyle {\frac }}\cos(x)+\int {\frac }}\sin(x)\,dx,}$

which, after recursive application of the integration by parts formula, would clearly result in an infinite recursion and lead nowhere.

Although a useful rule of thumb, there are exceptions to the LIATE rule. A common alternative is to consider the rules in the "ILATE" order instead. Also, in some cases, polynomial terms need to be split in non-trivial ways. For example, to integrate

${\displaystyle \int x^e^}\,dx,}$

one would set

${\displaystyle u=x^,\quad dv=x\cdot e^}\,dx,}$

so that

${\displaystyle du=2x\,dx,\quad v={\frac }}}.}$

Then

${\displaystyle \int x^e^}\,dx=\int (x^)\left(xe^}\right)\,dx=\int u\,dv=uv-\int v\,du={\frac e^}}}-\int xe^}\,dx.}$

Finally, this results in

${\displaystyle \int x^e^}\,dx={\frac }(x^-1)}}+C.}$

Integration by parts is often used as a tool to prove theorems in mathematical analysis.

Gamma function identity

The gamma function is an example of a special function, defined as an improper integral for z > 0. Integration by parts illustrates it to be an extension of the factorial:

${\displaystyle {\begin\Gamma (z)&=\int _^{\infty }e^{-x}x^\,dx\\&=-\int _^{\infty }x^\,d\left(e^{-x}\right)\\&=-\left[e^{-x}x^\right]_^{\infty }+\int _^{\infty }e^{-x}\,d\left(x^\right)\\&=0+\int _^{\infty }\left(z-1\right)x^e^{-x}\,dx\\&=(z-1)\Gamma (z-1).\end}}$

Since

${\displaystyle \Gamma (1)=\int _^{\infty }e^{-x}\,dx=1,}$

for integer z, applying this formula repeatedly gives the factorial:

${\displaystyle \Gamma (z+1)=z!}$

Use in harmonic analysis

Integration by parts is often used in harmonic analysis, particularly Fourier analysis, to show that quickly oscillating integrals with sufficiently smooth integrands decay quickly. The most common example of this is its use in showing that the decay of function's Fourier transform depends on the smoothness of that function, as described below.

Fourier transform of derivative

If f is a k-times continuously differentiable function and all derivatives up to the kth one decay to zero at infinity, then its Fourier transform satisfies

${\displaystyle ({\mathcal }f^{(k)})(\xi )=(2\pi i\xi )^{\mathcal }f(\xi ),}$

where f(k) is the kth derivative of f. (The exact constant on the right depends on the convention of the Fourier transform used.) This is proved by noting that

${\displaystyle {\frac }e^{-2\pi iy\xi }=-2\pi i\xi e^{-2\pi iy\xi },}$

so using integration by parts on the Fourier transform of the derivative we get

${\displaystyle {\begin({\mathcal }f')(\xi )&=\int _{-\infty }^{\infty }e^{-2\pi iy\xi }f'(y)\,dy\\&=\left[e^{-2\pi iy\xi }f(y)\right]_{-\infty }^{\infty }-\int _{-\infty }^{\infty }(-2\pi i\xi e^{-2\pi iy\xi })f(y)\,dy\\[5pt]&=2\pi i\xi \int _{-\infty }^{\infty }e^{-2\pi iy\xi }f(y)\,dy\\[5pt]&=2\pi i\xi {\mathcal }f(\xi ).\end}}$

Applying this inductively gives the result for general k. A similar method can be used to find the Laplace transform of a derivative of a function.

Decay of Fourier transform

The above result tells us about the decay of the Fourier transform, since it follows that if f and f(k) are integrable then

${\displaystyle \vert {\mathcal }f(\xi )\vert \leq {\frac }},{\text{ where }}I(f)=\int _{-\infty }^{\infty }{\Bigl (}\vert f(y)\vert +\vert f^{(k)}(y)\vert {\Bigr )}\,dy.}$

In other words, if f satisfies these conditions then its Fourier transform decays at infinity at least as quickly as 1/|ξ|k. In particular, if k ≥ 2 then the Fourier transform is integrable.

The proof uses the fact, which is immediate from the definition of the Fourier transform, that

${\displaystyle \vert {\mathcal }f(\xi )\vert \leq \int _{-\infty }^{\infty }\vert f(y)\vert \,dy.}$

Using the same idea on the equality stated at the start of this subsection gives

${\displaystyle \vert (2\pi i\xi )^{\mathcal }f(\xi )\vert \leq \int _{-\infty }^{\infty }\vert f^{(k)}(y)\vert \,dy.}$

Summing these two inequalities and then dividing by 1 + |2πξk| gives the stated inequality.

Use in operator theory

One use of integration by parts in operator theory is that it shows that the −∆ (where ∆ is the Laplace operator) is a positive operator on L2 (see Lp space). If f is smooth and compactly supported then, using integration by parts, we have

${\displaystyle {\begin\langle -\Delta f,f\rangle _}&=-\int _{-\infty }^{\infty }f''(x){\overline }\,dx\\[5pt]&=-\left[f'(x){\overline }\right]_{-\infty }^{\infty }+\int _{-\infty }^{\infty }f'(x){\overline }\,dx\\[5pt]&=\int _{-\infty }^{\infty }\vert f'(x)\vert ^\,dx\geq 0.\end}}$

Repeated integration by parts

Considering a second derivative of ${\displaystyle v}$ in the integral on the LHS of the formula for partial integration suggests a repeated application to the integral on the RHS:

${\displaystyle \int uv''\,dx=uv'-\int u'v'\,dx=uv'-\left(u'v-\int u''v\,dx\right).}$

Extending this concept of repeated partial integration to derivatives of degree n leads to

${\displaystyle {\begin\int u^{(0)}v^{(n)}\,dx&=u^{(0)}v^{(n-1)}-u^{(1)}v^{(n-2)}+u^{(2)}v^{(n-3)}-\cdots +(-1)^u^{(n-1)}v^{(0)}+(-1)^\int u^{(n)}v^{(0)}\,dx.\\[5pt]&=\sum _^(-1)^u^{(k)}v^{(n-1-k)}+(-1)^\int u^{(n)}v^{(0)}\,dx.\end}}$

This concept may be useful when the successive integrals of ${\displaystyle v^{(n)}}$ are readily available (e.g., plain exponentials or sine and cosine, as in Laplace or Fourier transforms), and when the nth derivative of ${\displaystyle u}$ vanishes (e.g., as a polynomial function with degree ${\displaystyle (n-1)}$). The latter condition stops the repeating of partial integration, because the RHS-integral vanishes.

In the course of the above repetition of partial integrations the integrals

${\displaystyle \int u^{(0)}v^{(n)}\,dx\quad }$ and ${\displaystyle \quad \int u^{(\ell )}v^{(n-\ell )}\,dx\quad }$ and ${\displaystyle \quad \int u^{(m)}v^{(n-m)}\,dx\quad {\text{ for }}1\leq m,\ell \leq n}$

get related. This may be interpreted as arbitrarily "shifting" derivatives between ${\displaystyle v}$ and ${\displaystyle u}$ within the integrand, and proves useful, too (see Rodrigues' formula).

Tabular integration by parts

The essential process of the above formula can be summarized in a table; the resulting method is called "tabular integration"[5] and was featured in the film Stand and Deliver.[6]

For example, consider the integral

${\displaystyle \int x^\cos x\,dx\quad }$ and take ${\displaystyle \quad u^{(0)}=x^,\quad v^{(n)}=\cos x.}$

Begin to list in column A the function ${\displaystyle u^{(0)}=x^}$ and its subsequent derivatives ${\displaystyle u^{(i)}}$ until zero is reached. Then list in column B the function ${\displaystyle v^{(n)}=\cos x}$ and its subsequent integrals ${\displaystyle v^{(n-i)}}$ until the size of column B is the same as that of column A. The result is as follows:

# i Sign A: derivatives u(i) B: integrals v(ni)
0 + ${\displaystyle x^}$ ${\displaystyle \cos x}$
1 ${\displaystyle 3x^}$ ${\displaystyle \sin x}$
2 + ${\displaystyle 6x}$ ${\displaystyle -\cos x}$
3 ${\displaystyle 6}$ ${\displaystyle -\sin x}$
4 + ${\displaystyle 0}$ ${\displaystyle \cos x}$

The product of the entries in row i of columns A and B together with the respective sign give the relevant integrals in step i in the course of repeated integration by parts. Step i = 0 yields the original integral. For the complete result in step i > 0 the ith integral must be added to all the previous products (0 ≤ j < i) of the jth entry of column A and the (j + 1)st entry of column B (i.e., multiply the 1st entry of column A with the 2nd entry of column B, the 2nd entry of column A with the 3rd entry of column B, etc. ...) with the given jth sign. This process comes to a natural halt, when the product, which yields the integral, is zero (i = 4 in the example). The complete result is the following (with the alternating signs in each term):

${\displaystyle \underbrace {(+1)(x^)(\sin x)} _+\underbrace {(-1)(3x^)(-\cos x)} _+\underbrace {(+1)(6x)(-\sin x)} _+\underbrace {(-1)(6)(\cos x)} _+\underbrace {\int (+1)(0)(\cos x)\,dx} _.}$

This yields

${\displaystyle \underbrace {\int x^\cos x\,dx} _{\text}=x^\sin x+3x^\cos x-6x\sin x-6\cos x+C.}$

The repeated partial integration also turns out useful, when in the course of respectively differentiating and integrating the functions ${\displaystyle u^{(i)}}$ and ${\displaystyle v^{(n-i)}}$ their product results in a multiple of the original integrand. In this case the repetition may also be terminated with this index i.This can happen, expectably, with exponentials and trigonometric functions. As an example consider

${\displaystyle \int e^\cos x\,dx.}$
# i Sign A: derivatives u(i) B: integrals v(ni)
0 + ${\displaystyle e^}$ ${\displaystyle \cos x}$
1 ${\displaystyle e^}$ ${\displaystyle \sin x}$
2 + ${\displaystyle e^}$ ${\displaystyle -\cos x}$

In this case the product of the terms in columns A and B with the appropriate sign for index i = 2 yields the negative of the original integrand (compare rows i = 0 and i = 2).

${\displaystyle \underbrace {\int e^\cos x\,dx} _{\text}=\underbrace {(+1)(e^)(\sin x)} _+\underbrace {(-1)(e^)(-\cos x)} _+\underbrace {\int (+1)(e^)(-\cos x)\,dx} _.}$

Observing that the integral on the RHS can have its own constant of integration ${\displaystyle C'}$, and bringing the abstract integral to the other side, gives

${\displaystyle 2\int e^\cos x\,dx=e^\sin x+e^\cos x+C',}$

and finally:

${\displaystyle \int e^\cos x\,dx={\frac }\left(e^(\sin x+\cos x)\right)+C,}$

where C = C′/2.

Higher dimensions

Integration by parts can be extended to functions of several variables by applying a version of the fundamental theorem of calculus to an appropriate product rule. There are several such pairings possible in multivariate calculus, involving a scalar-valued function u and vector-valued function (vector field) V.[7]

The product rule for divergence states:

${\displaystyle \nabla {\cdot }(u\mathbf )\ =\ u\,\nabla {\cdot }\mathbf \ +\ \nabla u\cdot \mathbf .}$

Suppose ${\displaystyle \Omega }$ is an open bounded subset of ${\displaystyle \mathbb ^}$ with a piecewise smooth boundary ${\displaystyle \Gamma =\partial \Omega }$. Integrating over ${\displaystyle \Omega }$ with respect to the standard volume form ${\displaystyle d\Omega }$, and applying the divergence theorem, gives:

${\displaystyle \int _{\Gamma }u\mathbf \cdot {\hat {\mathbf }}\,d\Gamma \ =\ \int _{\Omega }\nabla \cdot (u\mathbf )\,d\Omega \ =\ \int _{\Omega }u\,\nabla {\cdot }\mathbf \,d\Omega \ +\ \int _{\Omega }\nabla u\cdot \mathbf \,d\Omega ,}$

where ${\displaystyle {\hat {\mathbf }}}$ is the outward unit normal vector to the boundary, integrated with respect to its standard Riemannian volume form ${\displaystyle d\Gamma }$. Rearranging gives:

${\displaystyle \int _{\Omega }u\,\nabla {\cdot }\mathbf \,d\Omega \ =\ \int _{\Gamma }u\mathbf \cdot {\hat {\mathbf }}\,d\Gamma -\int _{\Omega }\nabla u\cdot \mathbf \,d\Omega ,}$

or in other words

${\displaystyle \int _{\Omega }u\,\operatorname (\mathbf )\,d\Omega \ =\ \int _{\Gamma }u\mathbf \cdot {\hat {\mathbf }}\,d\Gamma -\int _{\Omega }\operatorname (u)\cdot \mathbf \,d\Omega .}$

The regularity requirements of the theorem can be relaxed. For instance, the boundary ${\displaystyle \Gamma =\partial \Omega }$ need only be Lipschitz continuous, and the functions u, v need only lie in the Sobolev space H1(Ω).

First Green's identity

Consider the continuously differentiable vector fields ${\displaystyle \mathbf =u_\mathbf _+\cdots +u_\mathbf _}$ and ${\displaystyle v\mathbf _,\ldots ,v\mathbf _}$, where ${\displaystyle \mathbf _}$is the i-th standard basis vector for ${\displaystyle i=1,\ldots ,n}$. Now apply the above integration by parts to each ${\displaystyle u_}$ times the vector field ${\displaystyle v\mathbf _}$:

${\displaystyle \int _{\Omega }u_{\frac {\partial v}{\partial x_}}\,d\Omega \ =\ \int _{\Gamma }u_v\,\mathbf _\cdot {\hat {\mathbf }}\,d\Gamma -\int _{\Omega }{\frac {\partial u_}{\partial x_}}v\,d\Omega .}$

Summing over i gives a new integration by parts formula:

${\displaystyle \int _{\Omega }\mathbf \cdot \nabla v\,d\Omega \ =\ \int _{\Gamma }v\mathbf \cdot {\hat {\mathbf }}\,d\Gamma -\int _{\Omega }v\,\nabla {\cdot }\mathbf \,d\Omega .}$

The case ${\displaystyle \mathbf =\nabla u}$, where ${\displaystyle u\in C^({\bar {\Omega }})}$, is known as the first Green's identity:

${\displaystyle \int _{\Omega }\nabla u\cdot \nabla v\,d\Omega \ =\ \int _{\Gamma }v\,\nabla u\cdot {\hat {\mathbf }}\,d\Gamma -\int _{\Omega }v\,\nabla ^\!u\,d\Omega .}$