
\chapter[Techniques of Integration IV]{Techniques of Integration IV: Inverse Trig Substitution}

The technique of ``\index{inverse trig substitution} inverse trig substitution'' is used when you want to
integrate a function involving the square root of a quadratic polynomial,
such as $\sqrt{25-x^2}$, $\sqrt{x^2-2x}$, $\sqrt{x^2+2x+2}$, etc.  It is an
``inverse'' substitution because, instead of writing a new variable $u$ as
a function of $x$ (i.e., $u=u(x)$), you write $x$ in terms of a new
variable $\theta$ (i.e., $x=x(
\theta)$), where the new variable $\theta$ stands for an angle in a right
triangle.  Here is the procedure:

\smallskip


\begin{enumerate}
\item Take the quadratic which is under the radical and write it either as a
sum of squares $A^2+B^2$ or as a difference of squares $A^2-B^2$, where one
of the terms $A$ or $B$ is a constant and the other is either $x$ or a
multiple of $x$ (or at worst an expression of the form $ax+b$).  In the
three examples above, we select $A$ and $B$ as follows:
$$25-x^2=5^2-x^2,\qquad x^2-2x=(x-1)^2-1^2,\qquad x^2
+2x+2=(x+1)^2+1^2.$$

\item Draw a right triangle, and label two of the sides $A$ and $B$.  If the
quadratic under the radical is $A^2+B^2$, then take the two sides to be the
legs of the right triangle.  If the quadratic is $A^2-B^2$, then take $A$
to be the hypotenuse and $B$ to be one of the legs.  In this way the
radical itself (i.e., $\sqrt{A^2+B^2}$ or else $\sqrt{A^2-B^2}$) will be
the third side.

\begin{center}
%%-figure MB -----------------------------
%%\trigsub{\sqrt{A^2+B^2}}{B}{A}{MB}
%\begin{psfigure}{1in}{1.5in}{figmb.eps}
%\end{psfigure}
%\pict{1}{1}{figmb.eps}
%------------------------------
\hspace{0.25 truein}
%-figure MC -----------------------------
%\trigsub{\sqrt{A^2-B^2}}{B}{A}{MC}
%\pict{3}{2}{figMC}
%------------------------------
\\
\end{center}

\item  Let $\theta$ be one of the acute angles of the right triangle (either
one will do).  Then write everything in the integral --- $x$, $dx$, and the
square root --- in terms of the new variable $\theta$ (also change the
limits of integration, if you're evaluating a definite integral).
Hopefully, the new integral with $\theta$ as the variable of integration
will be relatively easy to evaluate.

\end{enumerate}

\smallskip
We now give some examples of the use of this method.

\begin{example} 
%{\bf Example 1.} 
Find the area in the first quadrant that is bounded by the
$x$- and $y$-axes, the line $x=3$, and the circle of radius 6 centered at
the origin.

\smallskip

\begin{rightindent}{3.2 truein}
 
To evaluate $\int_0^3\sqrt{36-x^2}dx$, we go through the three steps above.
(1)~Set $A=6$ and $B=x$, so that the radical is $\sqrt{A^2-B^2}$.  (2)~Draw
a right triangle with the sides and angle labeled as shown (see the
figure at the right)
\end{rightindent}
\hfill
%-figure MD -----------------------------
%\trigsub{\sqrt{36-x^2}}{x}{6}{MD}
\pict{3}{2}{figMC}
%------------------------------

\noindent
(3)~Write $x=6\sin\theta$, so that $dx=6\cos\theta\,d\theta$.  In addition,
the square root is the adjacent side, so that $\sqrt{36-x^2}=6\cos\theta$.
Since $\theta=\arcsin(x/6)$, the limits of integration become
$\arcsin(0)=0$ and $\arcsin(3/6)=\pi/6$.  Thus,
\begin{align*} 
\int_0^3\sqrt{36-x^2}\,dx
&=\int_0^{\pi/6}(6\cos\theta)6\cos\theta\,d\theta
=36\int_0^{\pi/6}\cos^2 \theta\,d\theta\\
&=36\int_0^{\pi/6}\frac{1+\cos(2\theta)}{ 2}\,d\theta
= 36\left(\frac{1}{ 2}\theta
   +\frac{1}{ 4}\sin(2\theta)\right)\biggm|_0^{\pi/6}\\
&=3\pi+9\sin(\frac{\pi}{ 3})=3\pi+\frac{9}{ 2}\sqrt{3}.
\end{align*}

\smallskip

\begin{rightindent}{3.5 truein}
 
We could  have actually obtained the same result by some simple geometry.
The region in question is made up of a $30^\circ$ sector of a circle (i.e.,
1/12 of a circle of radius 6) and a triangle of base 3 and altitude
$3\sqrt{3}$ (see the figure at the right).  So the area is 
\[
\frac{1}{12}\pi\cdot 6^2+\frac{1}{ 2}3\cdot 3\sqrt{3}= 3\pi+\frac{9}{ 2}\sqrt{3}\,.
\]

\end{rightindent}
\hfill
%-figure ME -----------------------------
\begin{psfigure}{1.2in}{1.2in}{figME.ps}
%\putcrosshair{0,0}
\puttext{-29.2, -4.2}{\small$30^{\circ}$}
\end{psfigure}
%------------------------------

\end{example} 

\begin{example} 
%{\bf Example 2.} \index{center of mass problem}
Find the center of mass of a uniform flat plate in the
shape of one hump of the sine curve.

\smallskip
\begin{rightindent}{2.5 truein}
By considerations of symmetry, $\overline{x}$ is clearly $\pi/2$.  To find
$\overline{y}$, we must find the distance across from left to right at
height $y$.  From the diagram at the right, it should be clear that this
distance is $\pi-2\,\arcsin(y)$.  The bottom integral in $\overline{y}$ is
just the area under $y=\sin x$ from 0 to $\pi$, which is
\end{rightindent}
\hfill
%-figure MF -----------------------------
\begin{psfigure}{3.0in}{1.0in}{figMF.ps}
%\putcrosshair{0,0}
\puttext{-127., 36.}{\Small$1$}
\puttext{-127., 16}{\Small$y$}
\puttext{-65., -40.}{\Small$x$}
\puttext{-90, 24.}{\Small$\arcsin\,y$}
\puttext{70, 24.}{\Small$\arcsin\,y$}
\puttext{103., -40.}{\Small$\pi$}
\end{psfigure}
%------------------------------

\noindent
$2$. So it remains to compute the top integral
\[
\int_0^1y(\pi-2\,\arcsin\,y)\,dy
=\frac{\pi}{2}-2\int_0^1y\,\arcsin\,y\,dy\,.
\]
Using integration by parts, we transform the last integral as follows:
\[
   \int_0^1y\,\arcsin\,y\,dy
=\frac{1}{ 2}y^2\arcsin\,
  y\Bigm|_0^1 -\int_0^1\frac{1}{ 2}y^2\frac{1}{\sqrt{1-y^2}}dy
=\frac{\pi}{ 4}-\frac{1}{ 2} \int_0^1\frac{y^2 dy}{\sqrt{1-y^2}}.
\] 
We now use an inverse trig substitution, drawing our triangle so that 1 is
the hypotenuse and $y$ is the leg opposite the angle $\theta$.  We have
$y=\sin\theta$, $dy=\cos\theta\,d
\theta$, $\sqrt{1-y^2}=\cos\theta$, and the limits of integration become
$0$ to $\pi/2$.  Putting this all together, we find that the top integral
in $\overline{y}$ is equal to 
\begin{align*}
\frac{\pi}{ 2}-2\int_0^1\arcsin\,y\,dy 
&= \frac{\pi}{ 2}-2(\frac{\pi}{ 4}-\frac{1}{ 2}\int_0^1(y^2dy/\sqrt{1-y^2}))\\
&=
\int_0^1(y^2dy/\sqrt{1-y^2}),
\end{align*}
 which with the substitution $y=\sin\theta$ becomes
\begin{align*}
  \int_0^{\pi/2}\frac{\sin^2\theta\cos\theta\,d\theta}{\cos\theta}
&= \int_0^{\pi/2}\sin^2\theta\,d\theta \\
&= \int_0^{\pi/2}\frac{1-\cos(2\theta)}{ 2} d\theta
=\left(\frac{1}{ 2}\theta-\frac{1}{ 4}\sin(2\theta)\right)\Bigm|_0^{\pi/2}
=\pi/4 \,.
\end{align*}
We conclude that $\overline{y}=\pi/8=0.3927$.

\end{example}

\smallskip

Using this type of procedure --- integration by parts followed by inverse
trig substitution --- one can integrate $x^n\arcsin\,x$ for any positive
integer $n$.


\begin{example} 
%{\bf Example 3.} 
Find the antiderivative of $1/\sqrt{x^2-2x}$.

\smallskip

\begin{rightindent}{3.5 truein}

 
As shown above, we can write $x^2-2x$ as a difference of two squares:
$$
      x^2-2x=(x-1)^2-1^2\,.
$$  
So we choose the \index{hypotenuse} hypotenuse of the right triangle to
be $x-1$ and the leg opposite $\theta$ to be 1 (see the drawing at 
the right).
Then $\sin\theta=1/(x-1)$ and so $x=1+(1/\sin\theta)$,
$dx=-(\cos\theta/\sin^2\theta)\,d\theta$, and the radical is
$\cot\theta=\cos\theta/\sin\theta$.  Hence,
\end{rightindent}
\hfill
%-figure MG-----------------------------
%\trigsub{\sqrt{x^2-2x}}{1}{x-1}
%------------------------------

\[
\int\frac{dx}{\sqrt{x^2-2x}}
=\int\frac{-(\cos\theta/\sin^2\theta)d\theta}{ \cos\theta/\sin\theta}
=-\int\frac{d\theta}{\sin\theta}.
\]

This integral is very similar to Problem 3 in the last homework set (just
reverse the roles of sin and cos).  The result (taking into account the
minus sign in front of the integral) is: $\frac{1}{ 2}\ln\frac{1+\cos\theta}{
1-\cos\theta}+C$.  Finally, we can write the answer in terms of $x$ by
reading $\cos\theta$ off the triangle: $\cos\theta=\sqrt{x^2-2x}/(x-1)$.
(Note: The answer can be simplified algebraically, using the properties of
$\ln$; the result is: $\,\ln|x-1+\sqrt{x^2-2x}|+C$.)

\end{example}

\begin{example}
%{\bf Example 4.} 
Find $\int x\,dx/\sqrt{x^2+2x+2}$.

\smallskip

\begin{rightindent}{3 truein}
 
As mentioned earlier, we can write $x^2+2x+2$ as a sum of two squares:
$x^2+2x+2=(x+1)^2+1^2$.  So we choose $x+1$ to be one leg (say, the leg
opposite $\theta$) and $1$ to be the other leg of the right triangle.  Then
$x+1=\tan\theta$, and so $x=\tan\theta-1$, $dx=\sec^2\theta\,d\theta$.  In
addition, $\sqrt{x^2+2x+2}$ is the hypotenuse of the triangle, which is
$\sec\theta$.  So our integral becomes
\end{rightindent}
\hfill
%-figure MH -----------------------------
%\trigsub{1}{x+1}{\sqrt{x^2+2x+2}}
%------------------------------

\[
\int\frac{(\tan\theta-1)\sec^2\theta\,d\theta}{\sec\theta}
=\int \tan\theta\sec\theta\,d\theta-\int\sec\theta\,d\theta.
\]
The function inside the first integral happens to be the derivative of
$\sec\theta$.  (If you didn't notice this, you could convert the integral
to sines and cosines, i.e., to $\int\sin\theta\,d\theta/\cos^2\theta$, and
use the \index{substitution $u=\cos\theta$} substitution $u=\cos\theta$.)  The second integral is Problem 3 of
the last homework set.  Putting this together (and using the fact that
$\sec\theta=\sqrt{x^2+2x+2}$ and $\sin\theta= (x+1)/\sqrt{x^2+2x+2}$), we
obtain the following answer:
\[
\int\frac{x\,dx}{\sqrt{x^2+2x+2}}
=\sqrt{x^2+2x+2}
 +\frac{1}{ 2}\ln \frac{\sqrt{x^2+2x+2}+x+1}{\sqrt{x^2+2x+2}-(x+1)}+C.
\]
\end{example}


\begin{example} (Force of repulsion from a line source of electric charge.)
%{\bf Example 5.}

Suppose that we have a long straight wire with an electric charge uniformly
distributed along it.  Our purpose is to determine how the \index{force of
repulsion} force of
repulsion exerted on a similarly charged particle drops off as the particle
moves away from the wire.

\smallskip

The basic physical law needed here is: {\it the force of repulsion between
two particles of charge $q_1$ and $q_2$ has magnitude
$k\,q_1q_2/\text{distance}^2$, where $k$ is a universal constant.} Before
doing this example, we should review Example 9.7 in the section on improper
integrals (noise from the freeway).  There also we had an inverse square
law.  As in the noise example, we set up our wire as the $x$-axis, taking 0
to be the point at the foot of the perpendicular drawn from the charged
particle.  If $c$ stands for the amount of charge per unit distance along
the wire, then the contribution to the force of repulsion coming from the
small segment of wire between $x$ and $x+\Delta x$ is $k\,q_1(c\Delta
x)/$distance${}^2= K\Delta x/(r^2+x^2)$, where we have set $K=kq_1c$.  (See
the diagram in the freeway example.)

\smallskip

However, there is one basic difference between the two examples.  In the
\index{freeway problem} freeway problem we were dealing with a {\bf scalar} (amount of noise)
rather than force, which is a {\bf vector} (it has both magnitude and
direction).  This means that the force contributed by the segment of the
wire between $x$ and $x+\Delta x$ points at an angle away from the
vertical.  What is that angle?  You should convince yourself that the angle
is $\arctan(x/r)$. The second diagram to the right below shows the force vector
contributed by the part of the wire between $x$ and $x+\Delta x$.

\begin{rightindent}{3.0 truein}

The horizontal component of this force (i.e., the component
parallel to the wire) is canceled by the force contributed from the
opposite segment (the segment between $-x$ and $-x-\Delta x$).  So the
contribution to the force of repulsion (the component pointing away from
the wire) is only a portion of $K\Delta x/(r^2+x^2)$.  The portion can be
determined by similar triangles (see the diagram at the right).  Comparing
the two triangles, we find that the side ``?'' which we want to find has
the same ratio to $K\Delta x/(r^2+x^2)$ as $r$ does to $\sqrt{r^2+x^2}$.
Thus, the contribution of the small segment is equal to:
$$
\frac{r}{\sqrt{r^2+x^2}}\cdot\frac{K\Delta x}{ r^2+x^2}=\frac{Kr\Delta x}{
\left(r^2+x^2\right)^{3/2}}.
$$
\end{rightindent}
\hfill
%-figure MI-----------------------------
\begin{psfigure}{2in}{2.5in}{figMI.ps}
%\putcrosshair{0,0}
\puttext{16., 50}{\Small$x$}
\puttext{-3.3, 38.}{\Small$r$}
\puttext{22., 28}{\Small$\sqrt{r^2+x^2}$}
\puttext{0., -27}{\Small$\displaystyle \frac{K\Delta x}{r^2+x^2}$}
\puttext{22, -40}{\Small ?}

\end{psfigure}
%------------------------------


Proceeding as in the freeway example and making the simplifying assumption
that the wire extends from $-\infty$ to $\infty$, we obtain the following
definite integral for the force of repulsion: $\int_{-\infty}^\infty
Kr\,dx/\left(r^2+x^2\right)^{3/2}$.  This is an integral that can be
evaluated by an \index{inverse trig substitution} inverse trig substitution, taking $x$ and $r$ to be the
legs of the right triangle (say, $x$ is the leg opposite $\theta$).  Then
$x=r\tan\theta$, $dx=r\sec^2\theta\,d\theta$, $\sqrt{r^2+x^2}=r\sec\theta$.
The limits of integration become $-\pi/2$ to $\pi/2$, so we obtain:
$$
\int_{-\infty}^\infty\frac{Kr\,dx}{\left(\sqrt{r^2+x^2}\right)^3}
=
\int_{-\pi/2}^{\pi/2}\frac{Kr^2\sec^2\theta\,d\theta}{(r\sec\theta)^3}
=
\frac{K}{ r}\int_{-\pi/2}^{\pi/2}\cos\theta\,d\theta=\frac{2K}{ r}.
$$ 
Hence we conclude (as in the freeway example) that the force drops off
proportionally to the distance (not the square of the distance).

\end{example}



\section{A Final Word} 

Before leaving the subject of techniques of integration, we should point
out that sometimes you have a choice of techniques, and your answer using
one technique might at first glance seem to be different from your answer
if you use a different technique.

\smallskip
\begin{example}
%{\bf Example 5.} 
Find $\int\sin x\cos x\,dx$.

\smallskip

{\it First method.} Substitute $u=\sin x$, so that $du=\cos x\,dx$.  We
obtain: $\int u\,du=\frac{1}{ 2}u^2+C=\frac{1}{ 2}\sin^2x+C$.

\smallskip

{\it Another method.} Substitute $u=\cos x$, so that $du=-\sin x\,dx$.
Then we get: $-\int u\,du=-\frac{1}{ 2}u^2+C=-\frac{1}{ 2}\cos^2x+C$.

\smallskip

{\it A third method.} Use the trig identity for the sine of twice an angle:
$\sin(2x)=2\sin x\cos x$.  We can thus rewrite our integral as $\int\frac{1}{
2}\sin(2x)dx=-\frac{1}{ 4}\cos(2x)+C$.

\smallskip

Why three different answers?  The point is that the three answers are not
really different.  Namely, the second answer can be written $-\frac{1}{
2}(1-\sin^2x)+C=\frac{1}{ 2}\sin^2x+C-\frac{1}{ 2}$; and the third answer (if
we use the cosine double angle formula $\cos(2x)=\cos^2x-\sin^2x
=1-2\sin^2x$) can be written as follows: $-\frac{1}{ 4}(1-2\sin^2x)+C=
\frac{1}{ 2}\sin^2x+C-\frac{1}{ 4}$.  So the second and third answers differ
from the first only by constants.  But remember that the meaning of
``$+C$'' in the answer to an indefinite integral is that if you add any
constant to the answer, you still have an antiderivative, i.e., the new
function is still a correct answer.

\end{example}
%%------------------------------------------------------
