% ----------------------------------------------------------------------

\chapter{Integration techniques}
\label{inttx}
\index{integration techniques}

Equation~(\ref{drvtv:defz}) implies a general technique for calculating
a derivative symbolically.  Its counterpart~(\ref{integ:def}),
unfortunately, implies a general technique only for calculating an
integral \emph{numerically}---and even for this purpose it is imperfect;
for, when it comes to adding an infinite number of infinitesimal
elements, how is one actually to do the sum?

It turns out that there is no one general answer to this question.  Some
functions are best integrated by one technique, some by another.  It is
hard to guess in advance which technique might work best.

This chapter surveys several weapons of the intrepid mathematician's
arsenal against the integral.

% ----------------------------------------------------------------------

\section{Integration by antiderivative}
\label{inttx:210}
\index{integration!by antiderivative}
\index{antiderivative}

\index{integrand}
The simplest way to solve an integral is just to look at it, recognizing
its integrand to be the derivative of something already known:%
\footnote{
  The notation $f(\tau)|_a^z$ or $[f(\tau)]_a^z$ means $f(z)-f(a)$.
}
\bq{inttx:antider}
  \int_a^z \frac{df}{d\tau} \,d\tau = f(\tau)|_a^z.
\eq
For instance,
\[
  \int_1^x \frac{1}{\tau} \,d\tau = \ln\tau|_1^x = \ln x.
\]
One merely looks at the integrand $1/\tau$, recognizing it to be the
derivative of $\ln\tau$, and then directly writes down the solution $\ln
\tau|_1^x$.  Refer to \S~\ref{integ:230}.

{
  \nc\tta[1]{\ensuremath
    \int_{1/2}^x \frac{1}{\sqrt{1-\tau^2}} \,d\tau
      = \arcsin \tau|_{1/2}^x = \arcsin x - \frac{2\pi}{\mbox{#1}}%
  }
  Again for instance, \[\tta{0xC},\]
  or, if you prefer decimal notation, \[\tta{12}.\]
  Refer to Table~\ref{trig:hourtable} and, more importantly, to
  Table~\ref{cexp:drvi}.
}

The technique by itself is pretty limited.  However, the frequent object
of other integration techniques is to transform an integral into a form
to which this basic technique can be applied.

\index{derivative!of $z^a/a$}
Besides the essential
\bq{inttx:210:10}
  \tau^{a-1} = \frac{d}{d\tau} \left(\frac{\tau^a}{a}\right),
\eq
Tables~\ref{integ:basic-antider}, \ref{cexp:drv}, \ref{cexp:drvi}
and~\ref{inttx:470:tbl} provide several further good derivatives this
antiderivative technique can use.

\index{natural logarithm!and the antiderivative}
\index{logarithm, natural!and the antiderivative}
\index{antiderivative!and the natural logarithm}
One particular, nonobvious, useful variation on the antiderivative
technique seems worth calling out specially here.  If $z=\rho
e^{i\phi}$, then~(\ref{taylor:350:31}) and~(\ref{taylor:350:32}) have that
\bq{inttx:intinvz}
  \int_{z_1}^{z_2} \frac{dz}{z}
    = \ln\frac{\rho_2}{\rho_1} + i(\phi_2-\phi_1).
\eq
This helps, for example, when~$z_1$ and~$z_2$ are real but negative
numbers.

% ----------------------------------------------------------------------

\section{Integration by substitution}
\label{inttx:220}
\index{integration!by substitution}

Consider the integral
\[
  S \equiv \int_{x_1}^{x_2}\frac{x\,dx}{1+x^2}.
\]
This integral is not in a form one immediately recognizes.  However,
with the change of variable
\[
  u \la 1 + x^2,
\]
whose differential is (by successive steps)
\bqb
  d(u) &=& d(1+x^2), \\
  du &=& 2x\,dx,
\eqb
the integral is
\bqb
  S &=& \int_{x=x_1}^{x_2}\frac{x\,dx}{u}
  \\&=& \int_{x=x_1}^{x_2}\frac{2x\,dx}{2u}
  \\&=& \int_{u=1+x_1^2}^{1+x_2^2}\frac{du}{2u}
  \\&=& \left.\frac 1 2 \ln u\right|_{u=1+x_1^2}^{1+x_2^2}
  \\&=& \frac 1 2 \ln\frac{1+x_2^2}{1+x_1^2}.
\eqb
To check the result, we can take the derivative per \S~\ref{integ:245}
of the final expression with respect to~$x_2$:
\bqb
  \left. \ppx{x_2} \frac 1 2 \ln\frac{1+x_2^2}{1+x_1^2} \right|_{x_2=x}
  &=& \left[
    \frac 1 2 \ppx{x_2} \left\{ \ln\left(1+x_2^2\right) - \ln\left(1+x_1^2\right) \right\}
  \right]_{x_2=x}
  \\&=& \frac{x}{1+x^2},
\eqb
which indeed has the form of the integrand we started with.

The technique is \emph{integration by substitution.}  It does not solve
all integrals but it does solve many, whether alone or in combination
with other techniques.

% ----------------------------------------------------------------------

% diagn: new section wants review
\section[Reversal and scaling]{Reversal and scaling of the independent variable}
\label{inttx:reversal}

\index{integration!by reversal of the independent variable}
\index{reversal of the independent variable}
\index{independent variable!reversal of}
\index{variable!independent, reversal of}
Section~\ref{inttx:220} has introduced integration by substitution.
Many substitutions are possible but the simple change of variable
\bq{inttx:reversal:10}
  \begin{split}
    -u &\la x, \\
    -du &= dx,
  \end{split}
\eq
is so easy a substitution, and is so often helpful, that it merits a
section of its own.

If
\bq{inttx:reversal:20}
  S \equiv \int_{x=a}^{b} f(x) \,dx,
\eq
where $f(x)$ is a function one wishes to integrate, then
changing variables according to~(\ref{inttx:reversal:10}) gives that
\[
  S = \int_{-u=a}^{b} f(-u) (-du)
    = -\int_{u=-a}^{-b} f(-u) \,du,
\]
which is that
\bq{inttx:reversal:30}
  S = \int_{u=-b}^{-a} f(-u) \,du.
\eq

Even easier is the case that $a=-\infty$, $b=\infty$, in which
\bq{inttx:reversal:40}
  \int_{-\infty}^{\infty} f(x) \,dx =
  \int_{-\infty}^{\infty} f(-u) \,du.
\eq

The technique of reversal of the independent variable seldom
solves an integral on its own but can put an integral in a form
to which other techniques can be applied, as for example in
\S~\ref{fouri:110.30}.

\index{integration!by scaling of the independent variable}
\index{scaling of the independent variable}
\index{independent variable!scaling of}
\index{variable!independent, scaling of}
Related is the change of variable
\bq{inttx:reversal:50}
  \begin{split}
    ku &\la x, \\
    k\,du &= dx, \\
    \Im(k) &= 0,
  \end{split}
\eq
by which
\bq{inttx:reversal:60}
  S = k\int_{u=a/k}^{b/k} f(ku) \,du.
\eq
In the case that $a=-\infty$, $b=\infty$,
\bq{inttx:reversal:70}
  \int_{-\infty}^{\infty} f(x) \,dx =
  |k| \int_{-\infty}^{\infty} f(ku) \,du.
\eq

% ----------------------------------------------------------------------

\section{Integration by parts}
\label{inttx:230}
\index{integration!by parts}

\index{product rule, derivative}
\index{derivative!product rule for}
Integration by parts is a curious but very broadly applicable technique
which begins with the derivative product rule~(\ref{drvtv:prod2}),
\[
  d(uv) = u\,dv + v\,du,
\]
where $u(\tau)$ and $v(\tau)$ are functions of an independent variable~$\tau$.
Reordering terms,
\[
  u\,dv = d(uv) - v\,du.
\]
Integrating,
\bq{inttx:parts}
  \int_{\tau=a}^b u\,dv = \left. uv \right|_{\tau=a}^b - \int_{\tau=a}^b v\,du.
\eq
Equation~(\ref{inttx:parts}) is the rule of \emph{integration by parts.}

For an example of the rule's operation, consider the integral
\[
  S(x) = \int_0^x \tau\cos\alpha\tau\,d\tau.
\]
Unsure how to integrate this, we can begin by integrating \emph{part} of
it.  We can begin by integrating the $\cos\alpha\tau\,d\tau$ part.
Letting
\[
  \begin{split}
    u  &\la \tau, \\
    dv &\la \cos\alpha\tau\,d\tau,
  \end{split}
\]
we find that%
\footnote{
  The careful reader will observe that $v=(\sin\alpha\tau)/\alpha + C$
  matches the chosen~$dv$ for any value of~$C$, not just for $C=0$.
  This is true.  However, nothing in the integration by parts technique
  requires us to consider all possible~$v$.  Any convenient~$v$
  suffices.  In this case, we choose $v=(\sin\alpha\tau)/\alpha$.
}
\[
  \begin{split}
    du &= d\tau, \\
    v  &= \frac{\sin\alpha\tau}{\alpha}.
  \end{split}
\]
According to~(\ref{inttx:parts}), then,
\[
  S(x) = \left. \frac{\tau\sin\alpha\tau}{\alpha} \right|_0^x
    - \int_0^x \frac{\sin\alpha\tau}{\alpha} \,d\tau
  = \frac{x}{\alpha} \sin\alpha x + \cos\alpha x - 1.
\]

Though integration by parts is a powerful technique, one should understand
clearly what it does and does not do.  The technique does not just integrate each
part of an integral separately.  It isn't that simple.  What it does is
to integrate one part of an integral separately---whichever part one has
chosen to identify as~$dv$---while contrarily differentiating the other
part~$u$, upon which it rewards the mathematician only with a whole new
integral $\int v\,du$.  The new integral may or may not be easier to
integrate than was the original $\int u\,dv$.  The virtue of the
technique lies in that one often can find a part~$dv$ which does yield
an easier $\int v\,du$.  The technique is powerful for this reason.

\index{gamma function}
\index{factorial}
For another kind of example of the rule's operation, consider the
definite integral%
\footnote{\cite{Lebedev}}
\bq{inttx:230:gamma}
  \Gamma(z) \equiv \int_0^\infty e^{-\tau} \tau^{z-1} \,d\tau,
  \ \ \Re(z) > 0.
\eq
Letting
\[
  \begin{split}
    u &\la e^{-\tau}, \\
    dv &\la \tau^{z-1} \,d\tau,
  \end{split}
\]
we evidently have that
\[
  \begin{split}
    du &= -e^{-\tau} \,d\tau, \\
    v &= \frac{\tau^z}{z}.
  \end{split}
\]
Substituting these according to~(\ref{inttx:parts})
into~(\ref{inttx:230:gamma}) yields that
\bqb
  \Gamma(z) &=& \left[ e^{-\tau}\frac{\tau^z}{z} \right]_{\tau=0}^{\infty}
  - \int_0^\infty \left(\frac{\tau^z}{z}\right) \left(-e^{-\tau} \,d\tau\right)
  \\&=& [0-0] +
  \int_0^\infty \frac{\tau^z}{z} e^{-\tau} \,d\tau
  \\&=& \frac{\Gamma(z+1)}{z}.
\eqb
When written as
\bq{inttx:230:20}
  \Gamma(z+1) = z\Gamma(z),
\eq
this is an interesting result.  Since per~(\ref{inttx:230:gamma})
\[
  \Gamma(1) = \int_0^\infty e^{-\tau} \,d\tau = \left[
    -e^{-\tau}
  \right]_0^\infty = 1,
\]
it follows by induction on~(\ref{inttx:230:20}) that
\bq{inttx:230:30}
  (n-1)! = \Gamma(n).
\eq
Thus~(\ref{inttx:230:gamma}), called the \emph{gamma function,} can be
taken as an extended definition of the factorial $(z-1)!$ for all~$z$,
$\Re(z) > 0$.  Integration by parts has made this finding possible.

% ----------------------------------------------------------------------

\section{Integration by unknown coefficients}
\label{inttx:240}
\index{coefficient!unknown}
\index{unknown coefficient}
\index{integration!by unknown coefficients}

One of the more powerful integration techniques is relatively inelegant,
yet it easily cracks some integrals that give other techniques trouble.
The technique is the \emph{method of unknown coefficients,} and it is
based on the antiderivative~(\ref{inttx:antider}) plus intelligent
guessing.  It is best illustrated by example.

\index{guessing the form of a solution}
\index{solution!guessing the form of}
\index{antiderivative!guessing}
Consider the integral (which arises in probability theory)
\bq{inttx:240:21}
  S(x) = \int_0^x e^{-(\rho/\sigma)^2/2} \rho \,d\rho.
\eq
If one does not know how to solve the integral in a more elegant way,
one can \emph{guess} a likely-seeming antiderivative form, such as
\[
  e^{-(\rho/\sigma)^2/2} \rho = \frac{d}{d\rho}ae^{-(\rho/\sigma)^2/2},
\]
where the~$a$ is an \emph{unknown coefficient.}  Having guessed, one has
no guarantee that the guess is right, but see: if the guess \emph{were}
right, then the antiderivative would have the form
\bqb
  e^{-(\rho/\sigma)^2/2} \rho
    &=& \frac{d}{d\rho}ae^{-(\rho/\sigma)^2/2} \\
    &=& -\frac{a\rho}{\sigma^2} e^{-(\rho/\sigma)^2/2},
\eqb
implying that
\[
  a = -\sigma^2
\]
(evidently the guess is right, after all).  Using this value for~$a$,
one can write the specific antiderivative
\[
  e^{-(\rho/\sigma)^2/2} \rho
    = \frac{d}{d\rho}\left[-\sigma^2e^{-(\rho/\sigma)^2/2}\right],
\]
with which one can solve the integral, concluding that
\bq{inttx:240:22}
  S(x) = \left[-\sigma^2 e^{-(\rho/\sigma)^2/2}\right]_0^x
  = \left(\sigma^2\right)\left[1-e^{-(x/\sigma)^2/2}\right].
\eq

\index{differential equation}
\index{differential equation!solution of by unknown coefficients}
\index{boundary condition}
\index{loan}
\index{borrower}
\index{interest}
\index{payment rate}
\index{amortization}
The same technique solves differential equations, too.  Consider for
example the differential equation
\bq{inttx:240:26}
  dx = (Ix-P)\,dt, \ \ x|_{t=0} = x_o,\ x|_{t=T} = 0,
\eq
which conceptually represents%
\footnote{
  Real banks (in the author's country, at least) by law or custom
  actually use a needlessly more complicated formula---and not only more
  complicated, but mathematically slightly incorrect, too.
}
the changing balance~$x$ of a bank loan account over time~$t$, where~$I$
is the loan's interest rate and~$P$ is the borrower's payment rate.  If
it is desired to find the correct payment rate~$P$ which pays the loan
off in the time~$T$, then (perhaps after some bad guesses) we guess the
form
\[
  x(t) = Ae^{\alpha t} + B,
\]
where~$\alpha$, $A$ and~$B$ are unknown coefficients.  The
guess' derivative is
\[
  dx = \alpha Ae^{\alpha t}\,dt.
\]
Substituting the last two equations into~(\ref{inttx:240:26}) and
dividing by~$dt$ yields that
\[
  \alpha Ae^{\alpha t} = IAe^{\alpha t} + IB - P,
\]
which at least is satisfied if both of the equations
\[
  \begin{split}
    \alpha Ae^{\alpha t} &= IAe^{\alpha t}, \\
    0 &= IB - P,
  \end{split}
\]
are satisfied.  Evidently good choices for~$\alpha$ and~$B$, then, are
\[
  \begin{split}
    \alpha &= I, \\
    B &= \frac{P}{I}.
  \end{split}
\]
Substituting these coefficients into the $x(t)$ equation above yields
the general solution
\bq{inttx:240:27}
  x(t) = Ae^{It} + \frac{P}{I}
\eq
to~(\ref{inttx:240:26}).  The constants~$A$ and~$P$, we establish by
applying the given \emph{boundary conditions}
$x|_{t=0} = x_o$ and $x|_{t=T} = 0$.
For the former condition,~(\ref{inttx:240:27}) is
\[
  x_o = Ae^{(I)(0)} + \frac{P}{I} = A + \frac{P}{I};
\]
and for the latter condition,
\[
  0 = Ae^{IT} + \frac{P}{I}.
\]
Solving the last two equations simultaneously, we have that
\bq{inttx:240:29}
  \begin{split}
    A &= \frac{-e^{-IT}x_o}{1-e^{-IT}}, \\
    P &= \frac{Ix_o}{1-e^{-IT}}.
  \end{split}
\eq
Applying these to the general solution~(\ref{inttx:240:27}) yields the
specific solution
\bq{inttx:240:28}
  x(t) = \frac{x_o}{1-e^{-IT}}
  \left[1-e^{(I)(t-T)}\right]
\eq
to~(\ref{inttx:240:26}) meeting the boundary conditions, with
the payment rate~$P$ required of the borrower given
by~(\ref{inttx:240:29}).

The virtue of the method of unknown coefficients lies in that it permits
one to try an entire family of candidate solutions at once, with the
family members distinguished by the values of the coefficients.  If a
solution exists anywhere in the family, the method usually finds it.

The method of unknown coefficients is an elephant.  Slightly inelegant
the method may be, but it is pretty powerful, too---and it has surprise
value (for some reason people seem not to expect it).  Such are the
kinds of problems the method can solve.

% ----------------------------------------------------------------------

\section{Integration by closed contour}
\label{inttx:250}
\index{Cauchy's integral formula}
\index{Cauchy, Augustin Louis (1789--1857)}
\index{integral!closed complex contour}
\index{contour integration!closed complex}
\index{integration!by closed contour}

\index{dummy variable}
We pass now from the elephant to the falcon, from the inelegant to the
sublime.  Consider the definite integral%
\footnote{\cite[\S~1.2]{Lebedev}}
\[
  S \equiv \int_0^\infty \frac{\tau^a}{\tau+1} \,d\tau, \ \ -1 < a < 0.
\]
This is a hard integral.  No obvious substitution, no evident factoring
into parts, seems to solve the integral; but there is a way.
The integrand has a pole at $\tau=-1$.  Observing that~$\tau$ is only a
dummy integration variable, if one writes the same integral using the
complex variable~$z$ in place of the real variable~$\tau$, then Cauchy's
integral formula~(\ref{taylor:cauchy}) has that integrating once
counterclockwise about a closed complex contour, with the contour
enclosing the pole at $z=-1$ but shutting out the branch point at $z=0$,
yields that
\[
  I = \oint \frac{z^a}{z+1} \,dz
  = i2\pi z^a|_{z=-1}
  = i2\pi \left(e^{ i2\pi/2 }\right)^a
  = i2\pi e^{ i2\pi a/2}.
\]

The trouble, of course, is that the integral~$S$ does not go about
a closed complex contour.  One can however construct a closed complex
contour~$I$ of which~$S$ is a part, as in Fig~\ref{inttx:250:fig1}.
\begin{figure}
  \caption{Integration by closed contour.}
  \label{inttx:250:fig1}
  \index{contour!complex}
  \bc
    {
      \nc\xax{-5}
      \nc\xbx{-3}
      \nc\xcx{ 5}
      \nc\xdx{ 3}
      \begin{pspicture}(\xax,\xbx)(\xcx,\xdx)
        \psset{dimen=middle}
        \small
        %\psframe[linewidth=0.5pt](\xax,\xbx)(\xcx,\xdx)
        \nc\xx{2.5}
        \nc\xxr{2.2361}
        \nc\xxra{2.561} \nc\xxrb{357.8}
        \nc\xxrr{0.30}
        \nc\xxrra{18.435} \nc\xxrrb{341.565} \nc\xxrc{60}
        \nc\xxa{0.62}
        \nc\xxb{0.10}
        \nc\xxba{0.2846} \nc\xxbb{2.2338}
        \nc\xxs{2.6}
        \nc\polexy{0.10}
        \nc\pole{
          {
            \psset{linewidth=1.0pt}
            \psline(-\polexy,-\polexy)( \polexy, \polexy)
            \psline( \polexy,-\polexy)(-\polexy, \polexy)
          }
        }
        \psline[linewidth=0.5pt](-\xx,0)(\xx,0)
        \psline[linewidth=0.5pt](0,-\xx)(0,\xx)
        \psarc[linewidth=2.0pt]{cc-cc}(0,0){\xxr}{\xxra}{\xxrb}
        \psarc[linewidth=2.0pt]{cc->}(0,0){\xxr}{\xxra}{\xxrc}
        \psline[linewidth=2.0pt]{c-c}( \xxba, \xxb)(\xxbb, \xxb)
        \psline[linewidth=2.0pt]{c-c}( \xxba,-\xxb)(\xxbb,-\xxb)
        \psarc[linewidth=2.0pt]{cc-cc}(0,0){\xxrr}{\xxrra}{\xxrrb}
        \rput(-\xxa,0){
          \pole
          \rput{15}(0,0){
            \psline[linewidth=0.5pt](0,0.16)(0,0.70)
            \rput{*0}(0,0.90){$z=-1$}
          }
        }
        \rput[l](\xxs,0){$\Re(z)$}
        \rput[b](0,\xxs){$\Im(z)$}
        \rput(1.15,0.35){$I_1$}
        \rput(1.20,2.20){$I_2$}
        \rput(1.15,-0.39){$I_3$}
        \rput(-0.30,-0.45){$I_4$}
      \end{pspicture}
    }
  \ec
\end{figure}
If the outer circle in the figure is of infinite radius and the inner,
of infinitesimal, then the closed contour~$I$ is composed of the four
parts
\bqb
  I &=& I_1 + I_2 + I_3 + I_4 \\
    &=& (I_1 + I_3) + I_2 + I_4.
\eqb
%
The figure tempts one to make the mistake of writing that $I_1=S=-I_3$,
but besides being incorrect this defeats the purpose of the closed
contour technique.  More subtlety is needed.  One must take care to
interpret the four parts correctly.  The integrand $z^a/(z+1)$ is
multiple-valued; so, in fact, the two parts $I_1 + I_3 \neq 0$ do not
cancel.  The integrand has a branch point at $z=0$, which, in passing
from~$I_3$ through~$I_4$ to~$I_1$, the contour has circled.  Even
though~$z$ itself takes on the same values along~$I_3$ as along~$I_1$,
the multiple-valued integrand $z^a/(z+1)$ does not.  Indeed,
\[
  \renewcommand\arraystretch{2.2}
  \br{rclcrcl}
  \ds I_1
    &=& \ds \int_0^\infty
      \frac{(\rho e^{i0})^a}{(\rho e^{i0})+1} \,d\rho
    &=& \ds \int_0^\infty
      \frac{\rho^a}{\rho+1} \,d\rho
    &=& \ds S, \\
  \ds -I_3
    &=& \ds \int_0^\infty
      \frac{(\rho e^{i2\pi})^a}{(\rho e^{i2\pi})+1} \,d\rho
    &=& \ds e^{i2\pi a} \int_0^\infty
      \frac{\rho^a}{\rho+1} \,d\rho
    &=& \ds e^{i2\pi a}S.
  \er
\]
Therefore,
\bqb
  I &=& I_1 + I_2 + I_3 + I_4 \\
    &=& (I_1 + I_3) + I_2 + I_4 \\
    &=& (1-e^{i2\pi a}) S
      + \lim_{\rho\ra\infty} \int_{\phi=0}^{2\pi} \frac{z^a}{z+1} \,dz
      - \lim_{\rho\ra 0} \int_{\phi=0}^{2\pi} \frac{z^a}{z+1} \,dz \\
    &=& (1-e^{i2\pi a}) S
      + \lim_{\rho\ra\infty} \int_{\phi=0}^{2\pi} z^{a-1} \,dz
      - \lim_{\rho\ra 0} \int_{\phi=0}^{2\pi} z^a \,dz \\
    &=& (1-e^{i2\pi a}) S
      + \lim_{\rho\ra\infty} \left.\frac{z^a}{a} \right|_{\phi=0}^{2\pi}
      - \lim_{\rho\ra 0} \left.\frac{z^{a+1}}{a+1}
      \right|_{\phi=0}^{2\pi}.
\eqb

Since $a<0$, the first limit vanishes; and because $a>-1$, the second
limit vanishes, too, leaving
\[
  I = (1-e^{i2\pi a}) S.
\]
But by Cauchy's integral formula we have already found an expression for~$I$.
Substituting this expression into the last equation yields, by
successive steps,
\bqb
  i2\pi e^{ i2\pi a/2} &=& (1-e^{i2\pi a}) S, \\
  S &=& \frac{i2\pi e^{ i2\pi a/2}}{1-e^{i2\pi a}}, \\
  S &=& \frac{i2\pi}{e^{-i2\pi a/2}-e^{i2\pi a/2}}, \\
  S &=& -\frac{2\pi/2}{\sin(2\pi a/2)}.
\eqb
That is,
\bq{inttx:250:20}
  \int_0^\infty \frac{\tau^a}{\tau+1} \,d\tau
   = -\frac{2\pi/2}{\sin(2\pi a/2)}, \ \ -1 < a < 0,
\eq
an astonishing result.%
\footnote{
  So astonishing is the result, that one is unlikely to believe it at
  first encounter.  However, straightforward (though computationally
  highly inefficient) numerical integration per~(\ref{integ:def})
  confirms the result, as the interested reader and his computer can
  check.  Such results vindicate the effort we have spent in deriving
  Cauchy's integral formula~(\ref{taylor:cauchy}).
}

Another example%
\footnote{\cite{Kohler-lecture}}
is
\[
  T \equiv \int_0^{2\pi} \frac{d\theta}{1+a\cos\theta},
  \ \ \Im(a)=0,\ \left|\Re(a)\right| < 1.
\]
As in the previous example, here again the contour is not closed.
The previous example closed the contour by extending it,
excluding the branch point.  In this example there is no branch
point to exclude, nor need one extend the
contour.  Rather, one changes the variable
\[
  z \la e^{i\theta}
\]
and takes advantage of the fact that~$z$,
unlike~$\theta$, \emph{begins and ends the integration at the
same point.}  One thus obtains the equivalent integral
\bqb
  T &=& \oint \frac{dz/iz}{1+(a/2)(z+1/z)}
  = -\frac{i2}{a} \oint \frac{dz}{z^2+2z/a+1}
  \\&=& -\frac{i2}{a} \oint
  \frac{dz}{
    \left[z-\left(-1+\sqrt{1-a^2}\right)/a\right]
    \left[z-\left(-1-\sqrt{1-a^2}\right)/a\right]
  },
\eqb
whose contour is the unit circle in the Argand plane.
The integrand evidently has poles at
\[
  z = \frac{-1\pm\sqrt{1-a^2}}{a},
\]
whose magnitudes are such that
\[
  \left|z\right|^2 = \frac{
    2-a^2 \mp 2\sqrt{1-a^2}
  }{a^2}.
\]
One of the two magnitudes is less than unity and one is greater,
meaning that one of the two poles lies within the contour and one lies
without, as is seen by the successive steps%
\footnote{
  These steps are perhaps best read from bottom to top.  See
  chapter~\ref{noth}'s footnote~\ref{noth:420:85}.
}
\[
  \renewcommand{\arraystretch}{1.5}
  \settowidth\tla{$-(1-a^2)$}
  \br{rcccl}
    a^2 &<& \multicolumn{1}{l}{\makebox[\tla][l]{$1,$}} && \\
    0 &<& \multicolumn{1}{l}{\makebox[\tla][l]{$1 - a^2,$}} && \\
    (-a^2)(0) &>& \multicolumn{1}{l}{\makebox[\tla][l]{$(-a^2)(1 - a^2),$}} && \\
    0 &>& \multicolumn{1}{l}{\makebox[\tla][l]{$-a^2 + a^4,$}} && \\
    1-a^2 &>& \multicolumn{1}{l}{\makebox[\tla][l]{$1 - 2a^2 + a^4,$}} && \\
    1-a^2 &>& \multicolumn{1}{l}{\makebox[\tla][l]{$\left(1 - a^2\right)^2,$}} && \\
    \sqrt{1-a^2} &>& \multicolumn{1}{l}{\makebox[\tla][l]{$1 - a^2,$}} && \\
    -\sqrt{1-a^2} &<& -(1 - a^2) &<& \sqrt{1-a^2}, \\
    1 - \sqrt{1-a^2} &<& a^2 &<& 1 + \sqrt{1-a^2}, \\
    2 - 2\sqrt{1-a^2} &<& 2a^2 &<& 2 + 2\sqrt{1-a^2}, \\
    2 -a^2 - 2\sqrt{1-a^2} &<& a^2 &<& 2 -a^2 + 2\sqrt{1-a^2}, \\
    \ds \frac{2 -a^2 - 2\sqrt{1-a^2}}{a^2} &<& 1 &<& \ds \frac{2 -a^2 + 2\sqrt{1-a^2}}{a^2}.
  \er
\]
Per Cauchy's integral formula~(\ref{taylor:cauchy}), integrating
about the pole within the contour yields that
\[
  T = \left.
    i2\pi \frac{-i2/a}{
      z-\left(-1-\sqrt{1-a^2}\right)/a
    }\right|_{z=\left(-1+\sqrt{1-a^2}\right)/a}
  = \frac{2\pi}{
      \sqrt{1-a^2}
    }.
\]

Observe that by means of a complex variable of integration, each example
has indirectly evaluated an integral whose integrand is purely real.  If
it seems unreasonable to the reader to expect so flamboyant a technique
actually to work, this seems equally unreasonable to the writer---but work
it does, nevertheless.  It is a great technique.

The technique, \emph{integration by closed contour,} is found
in practice to solve many integrals other techniques find almost
impossible to crack.  The key to making the technique work lies in
closing a contour one knows how to treat.  The robustness of the
technique lies in that any contour of any shape will work, so long as
the contour encloses appropriate poles in the Argand domain plane while
shutting branch points out.

\index{magnitude!of an integral}
\index{integral!magnitude of}
\index{integrand!magnitude of}
\index{triangle inequalities!complex}
The extension
\bq{inttx:250:triangle}
  \left| \int_{z_1}^{z_2} f(z) \,dz \right| \le
  \int_{z_1}^{z_2} \left| f(z) \,dz \right|
\eq
of the complex triangle sum inequality~(\ref{trig:278:triangle}) from
the discrete to the continuous case sometimes proves useful in
evaluating integrals by this section's technique, as in
\S~\ref{fours:160.35}.

% ----------------------------------------------------------------------

\section{Integration by partial-fraction expansion}
\label{inttx:260}
\index{integration!by partial-fraction expansion}
\index{partial-fraction expansion}

This section treats integration by partial-fraction expansion.  It
introduces the expansion itself first.%
\footnote{%
  \cite[appendix~F]{Phillips/Parr}%
  \cite[\S\S~2.7 and~10.12]{Hildebrand}
}
Throughout the section,
\[
  j,j',k,\ell,m,n,p,p_{(\cdot)},M,N \in \mathbb Z.
\]

\subsection{Partial-fraction expansion}
\label{inttx:260.10}
\index{partial-fraction expansion}

\index{fraction}
\index{numerator}
\index{denominator}
\index{ratio}
\index{quotient}
Consider the function
\[
  f(z) = \frac{-4}{z-1} + \frac{5}{z-2}.
\]
Combining the two fractions over a common denominator%
\footnote{
  Terminology (you probably knew this already):  A \emph{fraction} is
  the ratio of two numbers or expressions $B/A$.  In the fraction,~$B$
  is the \emph{numerator} and~$A$ is the \emph{denominator.}  The
  \emph{quotient} is $Q=B/A$.
}
yields that
\[
  f(z) = \frac{z+3}{(z-1)(z-2)}.
\]
Of the two forms, the former is probably the more amenable to analysis.
For example, using~(\ref{inttx:intinvz}),
\bqb
  \int_{-1}^0 f(\tau)\,d\tau
  &=& \int_{-1}^0\frac{-4}{\tau-1}\,d\tau
    + \int_{-1}^0\frac{5}{\tau-2}\,d\tau \\
  &=& \left[ -4\ln(1-\tau) +5\ln(2-\tau) \right]_{-1}^0.
\eqb
The trouble is that one is not always given the function in the amenable
form.

\index{residue}
\index{function!rational}
\index{rational function}
Given a \emph{rational function}
\bq{inttx:260:10}
  f(z) = \frac{
    \sum_{k=0}^{N-1} b_k z^k
  }{
    \prod_{j=1}^N (z-\alpha_j)
  }
\eq
in which no two of the several poles~$\alpha_j$ are the same,
the \emph{partial-fraction expansion} has the form
\bq{inttx:260:20}
  f(z) = \sum_{k=1}^N \frac{A_k}{z-\alpha_k},
\eq
where multiplying each fraction of~(\ref{inttx:260:20}) by
\[
  \frac{\left[\prod_{j=1}^N (z-\alpha_j)\right]/(z-\alpha_k)}
       {\left[\prod_{j=1}^N (z-\alpha_j)\right]/(z-\alpha_k)}
\]
puts the several fractions over a common denominator,
yielding~(\ref{inttx:260:10}).  Dividing~(\ref{inttx:260:10})
by~(\ref{inttx:260:20}) gives the ratio
\[
  1 = \left. \frac{
    \sum_{k=0}^{N-1} b_k z^k
  }{
    \prod_{j=1}^N (z-\alpha_j)
  } \right/
  \sum_{k=1}^N \frac{A_k}{z-\alpha_k}.
\]
In the immediate neighborhood of $z=\alpha_m$, the $m$th term
$A_m/(z-\alpha_m)$ dominates the summation of~(\ref{inttx:260:20}).
Hence,
\[
  1 = \lim_{z\ra\alpha_m}
  \left. \frac{
    \sum_{k=0}^{N-1} b_k z^k
  }{
    \prod_{j=1}^N (z-\alpha_j)
  } \right/
  \frac{A_m}{z-\alpha_m}.
\]
Rearranging factors, we have that
\bq{inttx:260:25}
  A_m = \left.\frac{
    \sum_{k=0}^{N-1} b_k z^k
  }{
    \left[ \prod_{j=1}^N (z-\alpha_j) \right] / (z-\alpha_m)
  }\right|_{z=\alpha_m}
  = \lim_{z \ra \alpha_m} \left[ (z-\alpha_m) f(z) \right],
\eq
where~$A_m$, the value of $f(z)$ with the pole canceled, is called the
\emph{residue} of $f(z)$ at the pole $z=\alpha_m$.
Equations~(\ref{inttx:260:20}) and~(\ref{inttx:260:25}) together give
the partial-fraction expansion of~(\ref{inttx:260:10})'s rational
function $f(z)$.

\subsection{Repeated poles}
\label{inttx:260.20}
\index{pole!double}
\index{pole!multiple}
\index{pole!repeated}
\index{double pole}
\index{multiple pole}
\index{repeated pole}
\index{separation of poles}
\index{pole!separation of}
\index{perturbation}

The weakness of the partial-fraction expansion of \S~\ref{inttx:260.10}
is that it cannot directly handle repeated poles.  That is, if
$\alpha_n=\alpha_j$, $n\neq j$, then the residue
formula~(\ref{inttx:260:25}) finds an uncanceled pole remaining in its
denominator and thus fails for $A_n=A_j$ (it still works for the other~$A_m$).
The conventional way to expand a fraction with repeated poles
is presented in \S~\ref{inttx:260.50} below; but because at least to
this writer that way does not lend much applied insight, the present
subsection treats the matter in a different way.  Here, we
\emph{separate the poles.}

\index{pole!circle of}
\index{Parseval's principle}
\index{Parseval, Marc-Antoine (1755--1836)}
Consider the function
\bq{inttx:260:40}
  g(z) \equiv \sum_{k=0}^{N-1} \frac{Ce^{i2\pi k/N}}{z-\ep e^{i2\pi k/N}},
  \ \ N>1,\ 0<\ep\ll 1,
\eq
where~$C$ is a real-valued constant.  This function evidently has a
small circle of poles in the Argand plane at $\alpha_k=\ep e^{i2\pi
k/N}$.  Factoring,
\[
  g(z) = \frac{C}{z} \sum_{k=0}^{N-1}
  \frac{e^{i2\pi k/N}}{1-(\ep e^{i2\pi k/N})/z}.
\]
Using~(\ref{alggeo:228:45}) to expand the fraction,
\bqb
  g(z) &=& \frac{C}{z} \sum_{k=0}^{N-1} \left[
    e^{i2\pi k/N}
    \sum_{j=0}^{\infty}\left(\frac{\ep e^{i2\pi k/N}}{z}\right)^j
  \right] \\
  &=& C \sum_{k=0}^{N-1}
    \sum_{j=1}^{\infty}\frac{\ep^{j-1} e^{i2\pi jk/N}}{z^j} \\
  &=& C
    \sum_{j=1}^{\infty}
    \frac{\ep^{j-1}}{z^j}
    \sum_{k=0}^{N-1}
    \left(e^{i2\pi j/N}\right)^k.
\eqb
But%
\footnote{\label{inttx:260:fn1}%
  If you don't see why, then for $N=8$ and $j=3$ plot the several
  $(e^{i2\pi j/N})^k$ in the Argand plane.  Do the same for $j=2$ then
  $j=8$.  Only in the $j=8$ case do the terms add coherently; in the
  other cases they cancel.

  This effect---reinforcing when $j=nN$, canceling otherwise---is a
  classic manifestation of \emph{Parseval's principle,} which
  \S~\ref{fours:080} will formally introduce later in the book.
}
\[
  \sum_{k=0}^{N-1} \left(e^{i2\pi j/N}\right)^k =
  \begin{cases}
    N &\mbox{if}\ j = mN, \\
    0 &\mbox{otherwise},
  \end{cases}
\]
so
\[
  g(z) = NC \sum_{m=1}^{\infty} \frac{\ep^{mN-1}}{z^{mN}}.
\]
For $\left|z\right|\gg\ep$---that is, except in the immediate neighborhood of the
small circle of poles---the first term of the summation dominates.
Hence,
\[
  g(z) \approx NC \frac{\ep^{N-1}}{z^{N}}, \ \ \left|z\right|\gg\ep.
\]
Having achieved this approximation, if we strategically choose
\[
  C=\frac{1}{N\ep^{N-1}},
\]
then
\[
  g(z) \approx \frac{1}{z^{N}}, \ \ \left|z\right|\gg\ep.
\]
But given the chosen value of~$C$,~(\ref{inttx:260:40}) is
\[
  g(z) = \frac{1}{N\ep^{N-1}}
  \sum_{k=0}^{N-1} \frac{e^{i2\pi k/N}}{z-\ep e^{i2\pi k/N}},
  \ \ N>1,\ 0<\ep\ll 1.
\]
Joining the last two equations together, changing $z-z_o \la z$, and
writing more formally, we have that
\bq{inttx:260:30}
  \frac{1}{(z-z_o)^{N}} = \lim_{\ep\ra 0} \frac{1}{N\ep^{N-1}}
  \sum_{k=0}^{N-1} \frac{e^{i2\pi k/N}}{z-\left[z_o+\ep e^{i2\pi k/N}\right]},
  \ \ N>1.
\eq

The significance of~(\ref{inttx:260:30}) is that it lets one replace an
$N$-fold pole with a small circle of ordinary poles, which per
\S~\ref{inttx:260.10} we already know how to handle.  Notice
incidentally that $1/N\ep^{N-1}$ is a large number not a small.  The
poles are close together but very strong.

\subsection{An example}
\label{inttx:260.21}

An example to illustrate the technique, separating a double pole:
\bqb
  f(z) &=& \frac{z^2-z+6}{(z-1)^2(z+2)} \\
    &=& \lim_{\ep\ra 0}\frac{z^2-z+6}
      {(z-[1+\ep e^{i2\pi(0)/2}])(z-[1+\ep e^{i2\pi(1)/2}])(z+2)} \\
    &=& \lim_{\ep\ra 0}\frac{z^2-z+6}
      {(z-[1+\ep])(z-[1-\ep])(z+2)} \\
    &=& \lim_{\ep\ra 0}\blr
      \left(\frac{1}{z-[1+\ep]}\right)
        \left[\frac{z^2-z+6}{(z-[1-\ep])(z+2)}\right]_{z=1+\ep}
      \right. \\&& \left.\makebox[2.0\parindent]{} +
      \left(\frac{1}{z-[1-\ep]}\right)
        \left[\frac{z^2-z+6}{(z-[1+\ep])(z+2)}\right]_{z=1-\ep}
      \right. \\&& \left.\makebox[2.0\parindent]{} +
      \left(\frac{1}{z+2}\right)
        \left[\frac{z^2-z+6}{(z-[1+\ep])(z-[1-\ep])}\right]_{z=-2}
    \brr \\
    &=& \lim_{\ep\ra 0}\blr
      \left(\frac{1}{z-[1+\ep]}\right)
        \left[\frac{6+\ep+\ep^2}{6\ep+2\ep^2}\right]
      \right. \\&& \left.\makebox[2.0\parindent]{} +
      \left(\frac{1}{z-[1-\ep]}\right)
        \left[\frac{6-\ep+\ep^2}{-6\ep+2\ep^2}\right]
      \right. \\&& \left.\makebox[2.0\parindent]{} +
      \left(\frac{1}{z+2}\right)
        \left[\frac{\mbox{0xC}}{9-\ep^2}\right]
    \brr
\eqb
As usual when handling infinitesimals like~$\ep$, we can drop from
each sum its insignificant terms in the limit, but which terms are
insignificant depends on the ratio in which each sum is:
\bqb
  \lim_{\ep\ra 0} \frac{6\pm\ep+\ep^2}{\pm 6\ep+2\ep^2}
    &=& \lim_{\ep\ra 0}
      \blr \frac{6}{\pm 6\ep+2\ep^2} + \frac{\pm\ep}{\pm 6\ep} \brr
      = \lim_{\ep\ra 0}
      \blr \frac{\pm 1/\ep}{1\pm\ep/3} + \frac{1/6}{1} \brr \\
    &=& \lim_{\ep\ra 0}
      \blr\bigg(\pm\frac{1}{\ep}\bigg)\bigg(1\mp\frac \ep 3+\cdots\bigg)+\frac{1}{6}\brr\\
    &=& \pm\frac{1}{\ep}-\frac{1}{3}+\frac{1}{6}
      = \pm\frac{1}{\ep}-\frac{1}{6}.
\eqb
Thus,
\[
  f(z)
    = \lim_{\ep\ra 0}\left\{
      \frac{1/\ep - 1/6}{z-[1+\ep]}
      + \frac{-1/\ep-1/6}{z-[1-\ep]}
      + \frac{4/3}{z+2}
    \right\}
\]
gives the partial-fraction expansion of $f(z)$.

\index{pole!shadow}
\index{pole!proper or distinct}
\index{shadow pole}
\index{proper pole}
\index{distinct pole}
\index{lurking}
\index{hiding}
\index{alternate form}
\index{form, alternate}
Incidentally, one can recombine terms to reach the alternate form
\[
  f(z)
    = \lim_{\ep\ra 0}\left\{
      \frac{1/\ep}{z-[1+\ep]}
      + \frac{-1/\ep}{z-[1-\ep]}
      + \frac{-1/3}{z-1}
      + \frac{4/3}{z+2}
    \right\}.
\]
This alternate form is valid and, for many purposes (as in
\S~\ref{inttx:260.30}), is even handy; but one should interpret it
cautiously: counting terms in the alternate form, you would think that
$f(z)$ had four poles whereas it has in fact only three.  The pole of
the ratio $(-1/3)/(z-1)$---infinitely weaker than, yet lying infinitely
near to, the poles of the two ratios $(1/\ep)(z-[1\pm\ep])$---is indeed
a pole of the ratio $(-1/3)/(z-1)$, but it is not a proper, distinct
pole of $f(z)$.  It can be understood as a sort of shadow pole, if you
like, that lurks near or hides under the twin dominant poles that loom
over it.  To see the proper, distinct poles of $f(z)$, refer rather to
the earlier form.

However one might choose to account for and to describe the shadow pole,
one cannot merely
omit it.  If one did omit it, then recombining the remaining partial
fractions over a common denominator (try it!) would fail to recover our
original expression for $f(z)$.

\subsection{Integrating a rational function}
\label{inttx:260.30}
\index{integral!of a rational function}
\index{rational function!integral of}
\index{function!rational, integral of}

If one can find the poles of a rational function of the
form~(\ref{inttx:260:10}), then one can use~(\ref{inttx:260:20})
and~(\ref{inttx:260:25})---and, if needed,~(\ref{inttx:260:30})---to
expand the function into a sum of partial fractions, each of which one
can integrate individually.

Continuing the example of \S~\ref{inttx:260.21}, for $0\le x<1$,
\bqb
  \int_0^x f(\tau) \,d\tau &=& \int_0^x
  \frac{\tau^2-\tau+6}{(\tau-1)^2(\tau+2)} \,d\tau \\
    &=& \lim_{\ep\ra 0}\int_0^x\left\{
      \frac{1/\ep}{\tau-[1+\ep]}
      + \frac{-1/\ep}{\tau-[1-\ep]}
      + \frac{-1/3}{\tau-1}
      + \frac{4/3}{\tau+2}
    \right\} \,d\tau
    \\&=& \lim_{\ep\ra 0}\bigg\{
      \frac{1}{\ep}\ln([1+\ep]-\tau)
      - \frac{1}{\ep}\ln([1-\ep]-\tau)
    \\&&\ \ \ \ \ \ \ \ \mbox{}
      - \frac 1 3 \ln(1-\tau)
      + \frac 4 3 \ln(\tau+2)
    \bigg\}_0^x \\
    &=& \lim_{\ep\ra 0}\left\{
      \frac{1}{\ep}\ln\left(\frac{[1+\ep]-\tau}{[1-\ep]-\tau}\right)
      - \frac 1 3 \ln(1-\tau)
      + \frac 4 3 \ln(\tau+2)
    \right\}_0^x \\
    &=& \lim_{\ep\ra 0}\left\{
      \frac{1}{\ep}\ln\left(\frac{[1-\tau]+\ep}{[1-\tau]-\ep}\right)
      - \frac 1 3 \ln(1-\tau)
      + \frac 4 3 \ln(\tau+2)
    \right\}_0^x \\
    &=& \lim_{\ep\ra 0}\left\{
      \frac{1}{\ep}\ln\left(1 + \frac{2\ep}{1-\tau}\right)
      - \frac 1 3 \ln(1-\tau)
      + \frac 4 3 \ln(\tau+2)
    \right\}_0^x \\
    &=& \lim_{\ep\ra 0}\left\{
      \frac{1}{\ep}\left(\frac{2\ep}{1-\tau}\right)
      - \frac 1 3 \ln(1-\tau)
      + \frac 4 3 \ln(\tau+2)
    \right\}_0^x \\
    &=& \lim_{\ep\ra 0}\left\{
      \frac{2}{1-\tau}
      - \frac 1 3 \ln(1-\tau)
      + \frac 4 3 \ln(\tau+2)
    \right\}_0^x \\
    &=&
      \frac{2}{1-x} - 2
      - \frac 1 3 \ln(1-x)
      + \frac 4 3 \ln\left(\frac{x+2}{2}\right).
\eqb
To check per \S~\ref{integ:245} that the result is correct, we can take
the derivative of the final expression:
\bqb
  \lefteqn{
    \left[
      \frac{d}{dx}
      \left\{
        \frac{2}{1-x} - 2
        - \frac 1 3 \ln(1-x)
        + \frac 4 3 \ln\left(\frac{x+2}{2}\right)
      \right\}
    \right]_{x=\tau}
  }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ &&
  \\&=&
    \frac{2}{(\tau-1)^2}
    + \frac{-1/3}{\tau-1}
    + \frac{4/3}{\tau+2}
  \\&=& \frac{
    \tau^2 - \tau + 6
  }{
    (\tau-1)^2(\tau+2)
  },
\eqb
which indeed has the form of the integrand we started with, confirming
the result.  (Notice incidentally how much easier it is symbolically to
differentiate than to integrate!)

Section~\ref{fouri:250} exercises the technique in a more sophisticated
way, applying it in the context of chapter~\ref{fouri}'s Laplace transform
to solve a linear differential equation.

\subsection{The derivatives of a rational function}
\label{inttx:260.60}
\index{derivative!of a rational function}
\index{rational function!derivatives of}
\index{function!rational, derivatives of}

Not only the integral of a rational function interests us;
its derivatives interest us, too.  One needs no special technique to
compute such derivatives, of course, but the derivatives do bring some
noteworthy properties.

First of interest is the property that a function in the general
rational form
\bq{inttx:260:80}
  \Phi(w) = \frac{w^p h_0(w)}{g(w)}, \ \ g(0) \neq 0,
\eq
enjoys derivatives in the general rational form
\bq{inttx:260:83}
  \frac{d^k\Phi}{dw^k} = \frac{w^{p-k} h_k(w)}{\left[g(w)\right]^{k+1}},
  \ \ 0 \le k \le p,
\eq
where~$g$ and~$h_k$ are polynomials in nonnegative powers of~$w$.  The
property is proved by induction.  When $k=0$, (\ref{inttx:260:83})
is~(\ref{inttx:260:80}), so~(\ref{inttx:260:83}) is good at least for
this case.  Then, using the product rule~(\ref{drvtv:proddiv2}),
if~(\ref{inttx:260:83}) holds for $k=n-1$.
\bqb
  \frac{d^n\Phi}{dw^n}
    &=& \frac{d}{dw} \left[
      \frac{d^{n-1}\Phi}{dw^{n-1}}
    \right]
    = \frac{d}{dw} \left[
      \frac{w^{p-n+1} h_{n-1}(w)}{\left[g(w)\right]^n}
    \right]
    = \frac{w^{p-n} h_{n}(w)}{\left[g(w)\right]^{n+1}},
  \\
  h_n(w) &\equiv& wg\frac{dh_{n-1}}{dw}
    - nwh_{n-1}\frac{dg}{dw}
    + (p-n+1)gh_{n-1},
    \ \ 0 < n \le p,
\eqb
which makes~$h_n$ (like $h_{n-1}$) a polynomial in nonnegative powers
of~$w$.  By induction on this basis,~(\ref{inttx:260:83}) holds for all
$0 \le k \le p$, as was to be demonstrated.

A related property is that
\bq{inttx:260:86}
  \left.\frac{d^k\Phi}{dw^k}\right|_{w=0} = 0
  \ \ \ \ \mbox{for $0 \le k < p$}.
\eq
That is, the function and its first $p-1$ derivatives are all zero at
$w=0$.  The reason is that~(\ref{inttx:260:83})'s denominator is
$\left[g(w)\right]^{k+1} \neq 0$, whereas its numerator has
a $w^{p-k}=0$ factor, when $0 \le k < p$ and $w=0$.

\subsection{Repeated poles (the conventional technique)}
\label{inttx:260.50}
\index{pole!double}
\index{pole!multiple}
\index{pole!repeated}
\index{double pole}
\index{multiple pole}
\index{repeated pole}

Though the technique of \S\S~\ref{inttx:260.20} and~\ref{inttx:260.30}
affords extra insight, it is not the conventional technique to expand in
partial fractions a rational function having a repeated pole.  The
conventional technique is worth learning not only because it is
conventional but also because it is usually quicker to apply in
practice.  This subsection derives it.

A rational function with repeated poles,
\bqa
  f(z) &=& \frac{
    \sum_{k=0}^{N-1} b_k z^k
  }{
    \prod_{j=1}^M (z-\alpha_j)^{p_j}
  }, \label{inttx:260:50}\\
  N &\equiv& \sum_{j=1}^M p_j, \xn\\
  p_j &\ge& 0, \xn\\
  \alpha_{j'} &\neq& \alpha_j \ \ \mbox{for all $j' \neq j$}, \xn
\eqa
where~$j$, $k$, $M$, $N$ and the several~$p_j$ are integers,
cannot be expanded solely in the first-order fractions of
\S~\ref{inttx:260.10}, but can indeed be expanded if higher-order
fractions are allowed:
\settoheight\tla{\scriptsize $k$}
\settodepth \tlb{\scriptsize $p_{j}$}
\bq{inttx:260:70}
  f(z) =
    \sum_{\rule{0pt}{\tla}j=1}^{\rule[-\tlb]{0pt}{0pt}M}
    \sum_{\ell=0}^{p_j-1}
    \frac{A_{j\ell}}{(z-\alpha_j)^{p_j-\ell}}.
\eq
What the partial-fraction expansion~(\ref{inttx:260:70}) lacks are the
values of its several coefficients~$A_{j\ell}$.

One can determine the coefficients with respect to one (possibly
repeated) pole at a time.  To determine them with respect to the
$p_m$-fold pole at $z=\alpha_m$, $1 \le m \le M$, one
multiplies~(\ref{inttx:260:70}) by $(z-\alpha_m)^{p_m}$ to obtain the form
\settoheight\tla{\scriptsize $\ell$}
\settodepth \tlb{\scriptsize $p_{j}$}
\[
  (z-\alpha_m)^{p_m} f(z) =
    \sum_{
      \stackindexdecl{
        \rule{0pt}{\tla}j &=& 1, \\
        j &\neq& m
      }
    }^{\rule[-\tlb]{0pt}{0pt}M}
    \sum_{\ell=0}^{p_j-1}
    \frac{(A_{j\ell})(z-\alpha_m)^{p_m}}{(z-\alpha_j)^{p_j-\ell}}
    + \sum_{\ell=0}^{p_m-1} (A_{m\ell})(z-\alpha_m)^{\ell}.
\]
But~(\ref{inttx:260:86}) with $w=z-\alpha_m$ reveals the
double summation and its first $p_m-1$ derivatives all to be null at
$z=\alpha_m$; that is,
\settoheight\tla{\scriptsize $\ell$}
\settodepth \tlb{\scriptsize $p_{j}$}
\[
  \left.
    \frac{d^k}{dz^k}
    \sum_{
      \stackindexdecl{
        \rule{0pt}{\tla}j &=& 1, \\
        j &\neq& m
      }
    }^{\rule[-\tlb]{0pt}{0pt}M}
    \sum_{\ell=0}^{p_j-1}
    \frac{(A_{j\ell})(z-\alpha_m)^{p_m}}{(z-\alpha_j)^{p_j-\ell}}
  \right|_{z=\alpha_m} = 0, \ \ \ \ 0 \le k < p_m;
\]
so, the $(z-\alpha_m)^{p_m} f(z)$ equation's $k$th derivative
reduces at that point to
\bqb
    \frac{d^k}{dz^k} \Big[
      (z-\alpha_m)^{p_m} f(z)
    \Big] \bigg|_{z=\alpha_m}
  &=&
    \sum_{\ell=0}^{p_m-1}
    \frac{d^k}{dz^k} \Big[
      (A_{m\ell})(z-\alpha_m)^{\ell}
    \Big]
  \bigg|_{z=\alpha_m}
  \\&=&
    k!A_{mk},
    \ \ 0 \le k < p_m.
\eqb
Changing $j \la m$ and $\ell \la k$ and solving for~$A_{j\ell}$ then
produces the coefficients
\bq{inttx:260:75}
  A_{j\ell} =
    \left.
      \left( \frac{1}{\ell!} \right)
      \frac{d^\ell}{dz^\ell} \Big[
        (z-\alpha_j)^{p_j}f(z)
      \Big]
    \right|_{z=\alpha_j}
  , \ \ \ \ 0 \le \ell < p_j,
\eq
to weight the expansion~(\ref{inttx:260:70})'s partial fractions.
In case of a repeated pole, these coefficients evidently depend not only
on the residual function itself but also on its several derivatives, one
derivative per repetition of the pole.

\subsection{The existence and uniqueness of solutions}
\label{inttx:260.55}
\index{uniqueness}
\index{existence}

\index{professional mathematician}
\index{mathematician!professional}
Equation~(\ref{inttx:260:75}) has solved~(\ref{inttx:260:50})
and~(\ref{inttx:260:70}).  A professional mathematician might object
however that it has done so without first proving that a unique
solution actually exists.

Comes from us the reply, ``Why should we prove that a solution exists,
once we have actually found it?''

Ah, but the hypothetical professional's
point is that we have found the solution only
if in fact it does exist, and uniquely; otherwise what we have
\emph{found} is a phantom.  A careful review of \S~\ref{inttx:260.50}'s
logic discovers no guarantee that all of~(\ref{inttx:260:75})'s
coefficients actually come from the same expansion.  Maybe there exist
two distinct expansions, and some of the coefficients come from the one,
some from the other.  On the other hand, maybe there exists no expansion
at all, in which event it is not even clear what~(\ref{inttx:260:75})
means.

``But these are quibbles, cavils and nitpicks!'' we are inclined to
grumble.  ``The present book is a book of applied mathematics.''

Well, yes, but on this occasion let us nonetheless follow the
professional's line of reasoning, if only a short way.

\emph{Uniqueness} is proved by positing two solutions
\settoheight\tla{\scriptsize $\ell$}
\settodepth \tlb{\scriptsize $p_{j}$}
\[
  f(z) =
    \sum_{\rule{0pt}{\tla}j=1}^{\rule[-\tlb]{0pt}{0pt}M}
    \sum_{\ell=0}^{p_j-1}
    \frac{A_{j\ell}}{(z-\alpha_j)^{p_j-\ell}}
  =
    \sum_{\rule{0pt}{\tla}j=1}^{\rule[-\tlb]{0pt}{0pt}M}
    \sum_{\ell=0}^{p_j-1}
    \frac{B_{j\ell}}{(z-\alpha_j)^{p_j-\ell}}
\]
and computing the difference
\settoheight\tla{\scriptsize $\ell$}
\settodepth \tlb{\scriptsize $p_{j}$}
\[
  \sum_{\rule{0pt}{\tla}j=1}^{\rule[-\tlb]{0pt}{0pt}M}
  \sum_{\ell=0}^{p_j-1}
  \frac{B_{j\ell}-A_{j\ell}}{(z-\alpha_j)^{p_j-\ell}}
\]
between them.  Logically this difference must be zero for all~$z$ if the
two solutions are actually to represent the same function $f(z)$.  This
however is seen to be possible only if $B_{j\ell} = A_{j\ell}$ for each
$(j,\ell)$.  Therefore, the two solutions are one and the same.  (The
professional might request a further demonstration of orthogonality,
\S~\ref{mtxinv:445};
% diagn: supply the missing reference later, if such a section is added
%
% and [not yet written];
but we will leave the point in that form.)

\emph{Existence} comes of combining the several fractions
of~(\ref{inttx:260:70}) over a common denominator and comparing the
resulting numerator against the numerator of~(\ref{inttx:260:50}).  Each
coefficient~$b_k$ is seen thereby to be a linear combination of the
several~$A_{j\ell}$, where the combination's weights depend solely on the
locations~$\alpha_j$ and multiplicities~$p_j$ of $f(z)$'s several poles.
From the~$N$ coefficients~$b_k$ and the~$N$ coefficients~$A_{j\ell}$,
an $N\times N$ system of~$N$ linear equations in~$N$ unknowns
results---which might for example (if, say, $N=3$) look like
\bqb
  b_0 &=& -2A_{00} + A_{01} + 3A_{10}, \\
  b_1 &=& A_{00} + A_{01} + A_{10}, \\
  b_2 &=& 2A_{01} - 5A_{10}.
\eqb
We will show in chapters~\ref{matrix} through~\ref{eigen} that
when such a system has no solution, there always exists an alternate set
of~$b_k$ for which the same system has multiple solutions.  But
uniqueness, which we have already established, forbids such multiple
solutions in all cases.  Therefore it is not possible for the system to
have no solution---which is to say, the solution necessarily exists.

We will not often in this book prove existence and uniqueness
explicitly, but such proofs when desired tend to fit the pattern
outlined here.

% ----------------------------------------------------------------------

\section[Manipulation of a Pythagorean expression]{Integration by the
manipulation of a Pythagorean expression}
\label{inttx:440}
\index{expression!Pythagorean}
\index{Pythagorean expression}
\index{manipulation of a Pythagorean expression}
\index{integration by the manipulation of a Pythagorean expression}

In context of the chapter you are reading, a \emph{Pythagorean
expression} is an expression of the form of $\pm 1\pm\tau^2$.  This
section suggests ways to approach integrands that contain Pythagorean
expressions.

\subsection{Pythagorean radicals}
\label{inttx:440.20}
\index{radical!Pythagorean}
\index{Pythagorean radical}
\index{manipulation of a Pythagorean radical}
\index{integration by the manipulation of a Pythagorean radical}

\index{path length}
\index{length of a path}
In applications, as for instance in the path-length computation of
\S~\ref{integ:241.08}, one often meets integrands that contain
Pythagorean expressions under a radical sign, like $\sqrt{1-\tau^2}$,
$\sqrt{\tau^2-1}$ or $\sqrt{\tau^2+1}$.  An example would be
\[
  S_1(x) \equiv \int_0^x\frac{d\tau}{\sqrt{1-\tau^2}},
\]
which contains the \emph{Pythagorean radical} $\sqrt{1-\tau^2}$.  Such a
Pythagorean radical recalls the inverse trigonometrics of
Table~\ref{cexp:drvi}, whereby
\[
  S_1(x) = \arcsin \tau|_0^x = \arcsin x.
\]
Unfortunately, not every integrand that features such a radical appears
in the table; so, for example,
\[
  S_2(x) \equiv \int_0^xd\tau\,\tau\sqrt{1-\tau^2}
\]
wants a substitution like $u_2^2 \la 1-\tau^2$, $u_2\,du_2 = -\tau\,d\tau$,
by which the technique of \S~\ref{inttx:220} finds that
\[
  S_2(x) = -\int_1^{\sqrt{1-x^2}}du_2\,u_2^2
    = -\left.\frac{u_2^3}{3}\right|_1^{\sqrt{1-x^2}}
    = \frac{1-(1-x^2)^{3/2}}{3}.
\]

That's all relatively straightforward, but now try an integral like
\[
  S_3(x) \equiv \int_0^xd\tau\sqrt{1-\tau^2}.
\]
This doesn't \emph{look} harder.  Indeed, if anything, it looks slightly
easier than $S_1(x)$ or $S_2(x)$.  Notwithstanding, the techniques used
to solve those somehow don't quite seem to work on $S_3(x)$ [try it!].

As it happens, we have already met, and solved, a similar integral in
\S~\ref{integ:241.08}.  That subsection has illustrated the technique.
Applying the same technique here, we assemble by trial a small table of
potentially relevant antiderivatives,
\[
  \begin{split}
    \frac{d}{d\tau} \arcsin\tau &= \frac{1}{\sqrt{1-\tau^2}}, \\
    \frac{d}{d\tau}\sqrt{1-\tau^2} &= -\frac{\tau}{\sqrt{1-\tau^2}}, \\
    \frac{d}{d\tau}\tau\sqrt{1-\tau^2}
      &= \sqrt{1-\tau^2}-\frac{\tau^2}{\sqrt{1-\tau^2}}
      = 2\sqrt{1-\tau^2}-\frac{1}{\sqrt{1-\tau^2}}.
  \end{split}
\]
wherein the pivotal step on the last line is to have \emph{manipulated
the Pythagorean radical,} observing that
\[
  \frac{\tau^2}{\sqrt{1-\tau^2}}
    = -\frac{1-\tau^2}{\sqrt{1-\tau^2}}+\frac{1}{\sqrt{1-\tau^2}}
    = -\sqrt{1-\tau^2}+\frac{1}{\sqrt{1-\tau^2}}.
\]
Using some of the above-computed derivatives, the desired
integrand
\linebreak % bad break
$\sqrt{1-\tau^2}$ can now be built up by stages:
\[
  \begin{split}
    \frac{d}{2\,d\tau}\tau\sqrt{1-\tau^2}
      &= \sqrt{1-\tau^2}-\frac{1}{2\sqrt{1-\tau^2}}; \\
    \frac{d}{2\,d\tau} \arcsin\tau
      + \frac{d}{2\,d\tau}\tau\sqrt{1-\tau^2}
      &= \sqrt{1-\tau^2}.
  \end{split}
\]
Hence,
\[
  S_3(x)
    = \left[\frac{1}{2}\arcsin\tau+\frac{1}{2}\tau\sqrt{1-\tau^2} \right]_0^x
    = \frac{1}{2}\arcsin x+\frac{1}{2}x\sqrt{1-x^2},
\]
a result which can (and should) be checked by differentiating in the
manner of \S~\ref{integ:245}.

Here is another example of integration by the manipulation of a
Pythagorean radical:
\[
  \begin{split}
    S_4(x) &\equiv \int_1^xd\tau\,\tau^2\sqrt{\tau^2-1}; \\
    \frac{d}{d\tau} \mopx{arccosh}\tau &= \frac{1}{\sqrt{\tau^2-1}}; \\
    %\frac{d}{d\tau} \sqrt{\tau^2-1} &= \frac{\tau}{\sqrt{\tau^2-1}}; \\
    \frac{d}{d\tau} \tau\sqrt{\tau^2-1}
      &= \sqrt{\tau^2-1}+\frac{\tau^2}{\sqrt{\tau^2-1}} \\
      &= 2\sqrt{\tau^2-1}+\frac{1}{\sqrt{\tau^2-1}}; \\
    \frac{d}{d\tau} \tau^3\sqrt{\tau^2-1}
      &= 3\tau^2\sqrt{\tau^2-1}+\frac{\tau^4}{\sqrt{\tau^2-1}} \\
      &= 4\tau^2\sqrt{\tau^2-1}+\frac{\tau^2}{\sqrt{\tau^2-1}} \\
      &= (4\tau^2+1)\sqrt{\tau^2-1}+\frac{1}{\sqrt{\tau^2-1}}; \\
    \frac{d}{4\,d\tau} \tau^3\sqrt{\tau^2-1}
      &= \left(\tau^2+\frac 1 4\right)\sqrt{\tau^2-1}+\frac{1}{4\sqrt{\tau^2-1}}.
  \end{split}
\]
Having assembled the above small table of potentially relevant antiderivatives,
we proceed:
\[
  \setlength\tla{-6em}
  \begin{split}
      \lefteqn{\hspace\tla-\frac{d}{8\,d\tau} \tau\sqrt{\tau^2-1}
      + \frac{d}{4\,d\tau} \tau^3\sqrt{\tau^2-1}}\\
      &= \tau^2\sqrt{\tau^2-1}+\frac{1}{8\sqrt{\tau^2-1}}; \\
      \lefteqn{\hspace\tla-\frac{d}{8\,d\tau} \mopx{arccosh}\tau
        -\frac{d}{8\,d\tau} \tau\sqrt{\tau^2-1}
        + \frac{d}{4\,d\tau} \tau^3\sqrt{\tau^2-1}}\\
      &= \tau^2\sqrt{\tau^2-1}; \\
    S_4(x) &= \bigg[
      \mbox{$\ds-\frac{\mopx{arccosh}\tau}{8}$}\\
      &\qquad+\left(\frac{\tau^2}{4} - \frac 1 8\right)\tau\sqrt{\tau^2-1}\bigg]_1^x; \\
    &= -\frac{\mopx{arccosh}x}{8} +\left(\frac{x^2}{4} - \frac 1 8\right)x\sqrt{x^2-1}.
  \end{split}
\]
For yet more examples, consider
\[
  S_5(x) \equiv \int_1^x\frac{\tau^2\,d\tau}{\sqrt{\tau^2-1}}
    = \int_1^xd\tau\sqrt{\tau^2-1}
    + \int_1^x\frac{d\tau}{\sqrt{\tau^2-1}},
\]
to complete whose evaluation is left as an exercise, and
\[
    S_6(x) \equiv \int_0^xd\tau\sqrt{a^2-\tau^2}
    = {a^2} \int_{(\tau/a)=0}^{x/a}d\left(\frac{\tau}{a}\right)\sqrt{1-\left(\frac{\tau}{a}\right)^2}
    = a^2S_3\left(\frac x a\right).
\]

\subsection{Pythagorean nonradicals}
\label{inttx:440.40}
\index{nonradical, Pythagorean}
\index{Pythagorean nonradical}
\index{manipulation of a Pythagorean nonradical}
\index{integration by the manipulation of a Pythagorean nonradical}

Besides Pythagorean radicals, Pythagorean nonradicals occur, too.
However, these tend to be easier to solve.  For example,
\[
  \begin{split}
    S_7(x)
    &\equiv \int_0^x \frac{\tau^2\,d\tau}{1+\tau^2}
    = \int_0^x \left(1-\frac 1{1+\tau^2}\right)d\tau
    = x - \arctan x;
    \\
    S_8(x)
    &\equiv \int_0^x \frac{\tau^3\,d\tau}{1+\tau^2}
    = \int_0^x \left(\tau-\frac\tau{1+\tau^2}\right)d\tau
    = \frac{x^2}2 - \int_0^x \frac{\tau\,d\tau}{1+\tau^2},
    \\
    u_8^2 &\la 1+\tau^2,\ u_8\,du_8 = \tau\,d\tau,
    \\
    S_8(x)
    &= \frac{x^2}2 - \int_1^{\sqrt{1+x^2}} \frac{du_8}{u_8}
    = \frac{x^2 - \ln(1+x^2)}2.
  \end{split}
\]

%\subsection{Pseudo-Pythagorean expressions}
%\label{inttx:440.70}
%
%\index{expression!pseudo-Pythagorean}
%\index{pseudo-Pythagorean expression}
%\index{manipulation of a pseudo-Pythagorean expression}
%
%Sometimes one meets an integral like
%\[
%  S_9(x) \equiv \int_0^x d\tau\sqrt{\frac\tau{1+\tau}}.
%\]
%These probably arise less often in applications than the Pythagoreans do
%(though this might depend on your field of work).  When they do arise,
%you can treat them in any convenient way.  However, one way that is
%sometimes convenient is to treat them as pseudo-Pythagoreans,
%substituting $u_9^2 \la \tau$, $2u_9\,du = d\tau$, to obtain a form like
%\[
%  S_9(x) = \int_0^{\sqrt{x}} \frac{2u_9^2\,du_9}{\sqrt{1+u_9^2}},
%\]
%which, from the earlier parts of this section, we already know how to
%solve.

% ----------------------------------------------------------------------

\section{Trial derivatives}
\label{inttx:444}
\index{trial derivative}
\index{derivative!trial}

Besides the technique of the Pythagorean radical, \S~\ref{inttx:440.20}
has also incidentally demonstrated another, different technique, vaguer
but more broadly applicable.  It has incidentally demonstrated the
technique of \emph{trial
derivatives.}\footnote{See~\cite[\S~1.5]{Hildebrand}, which introduces
the technique in another guise under a different name.}

Review the $S_3(x)$ and $S_4(x)$ of \S~\ref{inttx:440.20}.  To solve
each has required us to develop a small table of potentially relevant
antiderivatives.  How did we develop each small table?  Well, we began
by copying a relevant inverse-trigonometric entry from
Table~\ref{cexp:drvi}; but then, to extend the table, we \emph{tried}
taking the derivatives of various functions that resembled the
integrand or part of the integrand.  Not all our trials gave useful
antiderivatives but some did.

\index{creativity}
\index{experience}
To decide which derivatives to try during a given integration depends on
the mathematician's creativity and experience.  However, a typical theme
is to multiply the integrand (or part of the integrand) by~$\tau$,
$\tau^2$ or maybe~$\tau^3$, taking the derivative of the product as
\S~\ref{inttx:440.20} has done.  It is not usually necessary, nor
helpful, to build up a huge table but---well, when you read
\S~\ref{inttx:440.20}, you saw how it went.

\index{feedback}
\index{artillery}
\index{19th century}
The reason to take trial \emph{derivatives,} incidentally, is that one
does not generally know very well how to take trial
\emph{antiderivatives!}  Analytically, derivatives are the easier to
take.  To seek an antiderivative by taking derivatives might (or might
not) seem counterintuitive, but it's a game of feedback and educated
guesses, like nineteenth-century artillery finding the range to its
target.  It is a game that can prosper, as we have seen.

% ----------------------------------------------------------------------

\section{Frullani's integral}
\label{inttx:460}
\index{Frullani's integral}
\index{Frullani, Giuliano (1795--1834)}

One occasionally meets an integral of the form
\[
  S = \int_0^\infty \frac{f(b\tau)-f(a\tau)}{\tau} \,d\tau,
\]
where~$a$ and~$b$ are real, positive coefficients and $f(\tau)$ is an
arbitrary complex expression in~$\tau$.  One wants to split such an
integral in two as $\int [f(b\tau)/\tau]\,d\tau - \int
[f(a\tau)/\tau]\,d\tau$, except that
% On later review, I don't remember why the following phrase was
% originally included.  Maybe there was a good reason for it?
%if $f(0^+) \neq f(+\infty)$, then
each half-integral alone may diverge.  Nonetheless, splitting the
integral in two is the right idea, provided that one first relaxes the
limits of integration as
\[
  S = \lim_{\ep\ra 0^+} \left\{
    \int_{\ep}^{1/\ep}\frac{f(b\tau)}{\tau} \,d\tau
   -\int_{\ep}^{1/\ep}\frac{f(a\tau)}{\tau} \,d\tau
  \right\}.
\]
Changing $\sigma\la b\tau$ in the left integral and $\sigma\la a\tau$ in
the right yields that
\bqb
  S &=& \lim_{\ep\ra 0^+} \left\{
    \int_{b\ep}^{b/\ep}\frac{f(\sigma)}{\sigma} \,d\sigma
   -\int_{a\ep}^{a/\ep}\frac{f(\sigma)}{\sigma} \,d\sigma
  \right\}
  \\ &=& \lim_{\ep\ra 0^+} \left\{
    \int_{a\ep}^{b\ep}\frac{-f(\sigma)}{\sigma} \,d\sigma
   +\int_{b\ep}^{a/\ep}\frac{f(\sigma)-f(\sigma)}{\sigma} \,d\sigma
   +\int_{a/\ep}^{b/\ep}\frac{f(\sigma)}{\sigma} \,d\sigma
  \right\}
  \\ &=& \lim_{\ep\ra 0^+} \left\{
    \int_{a/\ep}^{b/\ep}\frac{f(\sigma)}{\sigma} \,d\sigma
   -\int_{a\ep}^{b\ep}\frac{f(\sigma)}{\sigma} \,d\sigma
  \right\}
\eqb
(here on the face of it, we have split the integration as though $a \le b$,
but in fact it does not matter which of~$a$ and~$b$ is the greater, as
is easy to verify).  So long as each of $f(\ep)$ and $f(1/\ep)$
approaches a constant value as~$\ep$ vanishes, this is
\bqb
  S &=& \lim_{\ep\ra 0^+} \left\{
    f(+\infty)\int_{a/\ep}^{b/\ep}\frac{d\sigma}{\sigma}
   -f(0^+)\int_{a\ep}^{b\ep}\frac{d\sigma}{\sigma}
  \right\}
  \\&=& \lim_{\ep\ra 0^+} \left\{
     f(+\infty)\ln\frac{b/\ep}{a/\ep}
    -f(0^+)\ln\frac{b\ep}{a\ep}
  \right\}
  \\&=& \left[ f(\tau) \right]_0^\infty \ln \frac b a.
\eqb
Thus we have \emph{Frullani's integral,}
\bq{inttx:460:frullani}
  \int_0^\infty \frac{f(b\tau)-f(a\tau)}{\tau} \,d\tau
  = \left[ f(\tau) \right]_0^\infty \ln \frac b a,
\eq
which,
if~$a$ and~$b$ are both real and positive,
works for any $f(\tau)$ which has definite $f(0^+)$ and
$f(+\infty)$.%
\footnote{%
  \cite[\S~1.3]{Lebedev}%
  \cite[\S~2.5.1]{Andrews}%
  \cite[``Frullani's integral'']{EWW}
}

% ----------------------------------------------------------------------

\section[Products of exponentials, powers and logs]
  {Integrating products of exponentials, powers and logarithms}
\label{inttx:470}
\index{integration!of a product of exponentials, powers and logarithms}
\index{exponential!integrating a product of a power and}
\index{logarithm!integrating a product of a power and}

The products $\exp(\alpha\tau)\tau^n$ (where $n \in \mathbb Z$) and
$\tau^{a-1}\ln\tau$ tend to arise%
\footnote{
  One could write the latter product more generally as
  $\tau^{a-1}\ln\beta\tau$.  According to
  Table~\ref{alggeo:230:tbl}, however, $\ln\beta\tau = \ln\beta +
  \ln\tau$; wherein $\ln \beta$ is just a constant.
}
among other places in integrands related to special functions
(as in the book's part~\ref{part30}).
The two occur often enough to merit investigation here.

Concerning $\exp(\alpha\tau)\tau^n$, by \S~\ref{inttx:240}'s method of
unknown coefficients we guess its antiderivative to fit the form
\bqb
  \exp(\alpha\tau)\tau^n &=&
    \frac{d}{d\tau} \sum_{k=0}^n a_k \exp(\alpha\tau)\tau^k
  \\&=&
    \sum_{k=0}^n \alpha a_k \exp(\alpha\tau)\tau^k
    + \sum_{k=1}^n ka_k \exp(\alpha\tau)\tau^{k-1}
  \\&=&
    \alpha a_n \exp(\alpha\tau)\tau^n
    + \exp(\alpha\tau)\sum_{k=0}^{n-1} \left[
        \alpha a_k
        +
        (k+1)a_{k+1}
      \right] \tau^k.
\eqb
If so, then evidently
\bqb
  a_n &=& \frac{1}{\alpha}; \\
  a_k &=& - \frac{k+1}{\alpha}a_{k+1},
    \ \ 0 \le k < n.
\eqb
That is,
\[
  a_k = \frac{1}{\alpha}
    \prod_{j=k+1}^{n}(-j\alpha)
  = -\frac{n!/k!}{
    (-\alpha)^{n-k+1}
  }, \ \ 0 \le k \le n.
\]
Therefore,%
\footnote{\cite[eqn.~17.25.4]{Spiegel/Liu}\cite[appendix~2, eqn.~73]{Shenk}}
\bq{inttx:470:20}
  \exp(\alpha\tau)\tau^n =
  \frac{d}{d\tau} \left[-\exp(\alpha\tau)\sum_{k=0}^n
  \frac{n!/k!}{
    (-\alpha)^{n-k+1}
  } \tau^k\right],
  \ \ n \in \mathbb Z, \ n \ge 0, \ \alpha \neq 0.
\eq

The right form to guess for the antiderivative of $\tau^{a-1}\ln \tau$
is less obvious.  Remembering however \S~\ref{cexp:228}'s observation
that $\ln\tau$ is of zeroth order in~$\tau$, after maybe some false
tries we eventually do strike the right form
\bqb
  \tau^{a-1}\ln \tau
  &=&
    \frac{d}{d\tau}\tau^a[B\ln\tau + C]
  \\&=&
    \tau^{a-1}[aB\ln\tau + (B+aC)],
\eqb
which demands that $B=1/a$ and that $C=-1/a^2$.  Therefore,%
\footnote{\cite[eqn.~17.26.3]{Spiegel/Liu}\cite[appendix~2, eqn.~74]{Shenk}}
\bq{inttx:470:30}
  \tau^{a-1}\ln \tau
  =
  \frac{d}{d\tau}\frac{\tau^a}{a}\left(\ln\tau - \frac{1}{a}\right),
  \ \ a \neq 0.
\eq
Antiderivatives of terms like $\tau^{a-1}(\ln \tau)^2$,
$\exp(\alpha\tau)\tau^n\ln\tau$ and so on can be computed in like manner
as the need arises.

Equation~(\ref{inttx:470:30}) fails when $a=0$, but in this case with a
little imagination the antiderivative is not hard to guess:%
\footnote{\cite[eqn.~17.26.4]{Spiegel/Liu}}
\bq{inttx:470:35}
  \frac{\ln \tau}{\tau}
  =
  \frac{d}{d\tau} \frac{(\ln\tau)^2}{2}.
\eq
% The rest of this paragraph is not true as far as the writer can any
% longer tell (but maybe he is now looking at in in the wrong way?)
%If~(\ref{inttx:470:35}) seemed hard to guess nevertheless, then
%l'H\^opital's rule~(\ref{drvtv:260:lhopital}), applied
%to~(\ref{inttx:470:30}) as $a \ra 0$, with the observation
%from~(\ref{alggeo:230:316}) that
%\bq{inttx:470:40}
%  \tau^a = \exp(a\ln\tau),
%\eq
%would yield the same~(\ref{inttx:470:35}).

Table~\ref{inttx:470:tbl} summarizes.
\begin{table}
  \caption[Antiderivatives of products of exps, powers and logs.]
    {Antiderivatives of products of exponentials, powers and
      logarithms.}
  \label{inttx:470:tbl}
  \index{antiderivative!of a product of exponentials, powers and logarithms}
  \bqb
    \exp(\alpha\tau)
      &=& \frac{d}{d\tau} \left[\exp(\alpha\tau)
        \left(\frac 1 \alpha\right)
      \right] \\
    \exp(\alpha\tau)\tau
      &=& \frac{d}{d\tau} \left[\exp(\alpha\tau)
        \left(\frac\tau\alpha - \frac 1{\alpha^2}\right)
      \right] \\
    \exp(\alpha\tau)\tau^2
      &=& \frac{d}{d\tau} \left[\exp(\alpha\tau)
        \left(\frac{\tau^2}\alpha - \frac {2\tau}{\alpha^2}
        + \frac 2{\alpha^3}\right)
      \right] \\
    \exp(\alpha\tau)\tau^n
      &=& \frac{d}{d\tau} \left[-\exp(\alpha\tau)\sum_{k=0}^n
        \frac{n!/k!}{
          (-\alpha)^{n-k+1}
        } \tau^k\right] \\
      && \qquad\quad n \in \mathbb Z, \ n \ge 0, \ \alpha \neq 0 \\
    \tau^{a-1}\ln \tau
      &=& \frac{d}{d\tau}\frac{\tau^a}{a}\left(\ln\tau - \frac{1}{a}\right),
      \ \ a \neq 0 \\
    \frac{\ln \tau}{\tau}
      &=& \frac{d}{d\tau} \frac{(\ln\tau)^2}{2}
  \eqb
\end{table}

% ----------------------------------------------------------------------

\section{Integration by Taylor series}
\label{inttx:450}
\index{integration!by Taylor series}
\index{Taylor series!integration by}

\index{closed analytic form}
\index{closed form}
With sufficient cleverness the techniques of the foregoing sections
solve many, many integrals.  But not all.  When all else fails, as
sometimes it does, the Taylor series of chapter~8 and the antiderivative of
\S~\ref{inttx:210} together offer a concise, practical way to integrate
some functions, at the price of losing the functions' known closed
analytic forms.  For example,
\bqb
  \int_0^x \exp\left(-\frac{\tau^2}{2}\right) \,d\tau
    &=& \int_0^x \sum_{k=0}^{\infty} \frac{(-\tau^2/2)^k}{k!} \,d\tau
  \\&=& \int_0^x \sum_{k=0}^{\infty} \frac{(-)^k\tau^{2k}}{2^k k!} \,d\tau
  \\&=& \left[ \sum_{k=0}^{\infty} \frac{(-)^k\tau^{2k+1}}{(2k+1)2^k k!} \right]_0^x
  \\&=& \sum_{k=0}^{\infty} \frac{(-)^kx^{2k+1}}{(2k+1)2^k k!}
      = (x) \sum_{k=0}^{\infty} \frac{1}{2k+1}
        \prod_{j=1}^k \frac{-x^2}{2j}.
\eqb
The result is no function one recognizes; it is just a series.
This is not necessarily bad, however.  After all, when a Taylor series
from Table~\ref{taylor:315:tbl} is used to calculate $\sin z$, then
$\sin z$ is just a series, too.  The series above converges just as
accurately and just as fast.

Sometimes it helps to give the series a name like\footnote{%
  The $\mopx{myf}$ = ``my function,'' but you can use any name for a
  function like this.%
}
\[
  \mopx{myf} z \equiv
    \sum_{k=0}^{\infty} \frac{(-)^kz^{2k+1}}{(2k+1)2^k k!}
      = (z) \sum_{k=0}^{\infty} \frac{1}{2k+1}
        \prod_{j=1}^k \frac{-z^2}{2j}.
\]
Then,
\[
  \int_0^x \exp\left(-\frac{\tau^2}{2}\right) \,d\tau = \mopx{myf} x.
\]
The $\mopx{myf} z$ is no less a function than $\sin z$ is; it's just a
function you hadn't heard of before.  You can plot the function, or take
its derivative
\[
  \frac{d}{d\tau} \mopx{myf} \tau = \exp\left(-\frac{\tau^2}{2}\right),
\]
or calculate its value, or do with it whatever else one does with
functions.  It works just the same.

Beyond the several integration techniques this chapter has introduced, a
special-purpose technique of integration by cylindrical transformation
will surface in \S~\ref{fouri:130}.

