\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}

\begin{document}
\centerline{MATH 136 -- Calculus 2}
\centerline{Practice Days on Partial Fractions}
\centerline{February 17 and 18, 2020}
\vskip 10pt
\noindent
{\it Background}
\vskip 10pt
Every rational function (quotient of polynomials) can 
be written as {\it a polynomial plus a sum of one or more terms of the following 
forms}:
$$\frac{C}{(x + a)^k}, \qquad \frac{Ax+B}{(x^2+bx+c)^k},$$
where in the second case $x^2 + bx + c = 0$ has no real roots.
A rational function expressed this way is said to be {\it decomposed
into partial fractions}.  The process of finding this decomposition
is as follows:  Given a rational function $\frac{f(x)}{g(x)}$,
\vskip 10pt
\begin{enumerate}
\item  First, if the degree of $g$ is larger already, just
proceed to step 2 with $\frac{f(x)}{g(x)}$.  
Otherwise, if the degree of $f(x)$ is greater than or equal to the 
degree of $g(x)$, {\it divide} $g(x)$ into $f(x)$ using polynomial
long division and write $f(x) = q(x)g(x) + r(x)$ for some
quotient $q(x)$ and remainder $r(x)$.  Then 
$$\frac{f(x)}{g(x)} = q(x) + \frac{r(x)}{g(x)}$$
and the degree of $r(x)$ is less than the degree of $g(x)$.  Continue 
to step 2 with $\frac{r(x)}{g(x)}$.  
\item  {\it Factor} $g(x)$ completely into a product of 
powers of linear polynomials and powers of quadratic
polynomials with no real roots (``irreducible'' quadratics).  
(The fact that this can always be done is one
form of the so-called ``Fundamental Theorem of Algebra''.  The
famous mathematician and physicist Carl Friedrich Gauss gave the first
complete proof of this result in 1799.)
\item  Assemble the partial fractions:  For each $(x + a)^m$ appearing 
in the factorization of $g(x)$, include a {\it group of terms}
$$\frac{C_1}{(x + a)} + \frac{C_2}{(x + a)^2} + \cdots + \frac{C_m}{(x + a)^m}$$
For each power $(x^2+bx+c)^n$ of an irreducible quadratic appearing 
in the factorization of $g(x)$, include a {\it group of terms}:
$$\frac{A_1x+B_1}{x^2+bx+c} + \frac{A_2x+B_2}{(x^2+bx+c)^2} + \cdots + \frac{A_n x+B_n}{(x^2+bx+c)^n}$$
\item  Set the rational function from step 1 (either the original
$f/g$ or $r/g$ as appropriate) equal to the sum of the partial fractions,
clear denominators, and solve for the coefficients.  
This last step can be done either by substituting well-chosen $x$-values,
or by equating coefficients of like powers of $x$ on both sides
and solving the resulting system of equations.
\item Integrate the polynomial quotient and the partial fractions.  The integrals of the partial fractions of the 
form $\frac{C}{(x + a)^k}$ are easy $u$-substitution forms; the integrals of the partial
fractions of the form $\frac{Ax + B}{(x^2 + bx + c)^k}$ can be done with a combination of $u$- and trigonometric (tangent) substitutions.  
The most general form after integration contains a logarithm term plus an inverse tangent term.
\end{enumerate}
\vskip 10pt
\noindent
{\it Questions}
\vskip 10pt
\begin{enumerate}
\item $\displaystyle \int \frac{x^4+1}{x^3 + 25x}\ dx$
\item[] {\it Solution:} The degree of the top is greater than the degree of the bottom, so we
need to begin by dividing:
$$x^4 + 1 = x(x^3 + 25x) + (-25x^2 + 1)$$
(that is, the quotient is $q(x) = x$ and the remainder is $r(x) = -25x^2 + 1$.  Then,
remembering that the eventual integral will include $\int x\ dx = \frac{x^2}{2}$, we
proceed with the partial fractions on 
$$\frac{-25 x^2 + 1}{x^3 + 25x} = \frac{-25x^2 + 1}{x(x^2 + 25)}$$
By the general recipe above we want 
$$\frac{-25x^2 + 1}{x(x^2 + 25)} = \frac{A}{x} + \frac{Bx + C}{x^2 + 25}$$
and this says
$$-25x^2 + 1 = A(x^2 + 25) + (Bx + C)x = (A + B)x^2 + Cx + 25A$$
after clearing denominators.  Equating coefficients of powers of $x$, we have
$25A = 1$, $C = 0$, $A + B = -25$, so $A = \frac{1}{25}$ and 
$$B = -25 - \frac{1}{25} = \frac{-626}{25}.$$
Putting everything together and using a $u$-substitution on
the final integral below, we have
\begin{align*}
\int \frac{x^4+1}{x^3 + 25x}\ dx &= \int x\ dx + \int\frac{1/25}{x}\ dx + 
\int\frac{(-626/25)x}{x^2 + 25}\ dx\\
&= \frac{x^2}{2} + \frac{1}{25}\ln|x| - \frac{313}{25}\ln|x^2 + 25| + C.
\end{align*} 
(Note that if $C \ne 0$, in one of these integrals, the final answer would also
contain an inverse tangent term.)
\item $\displaystyle \int \frac{x + 2}{x^2 + 4x + 3} \ dx$
\item[] {\it Solution:}  We don't need to divide here.   The bottom factors
as $(x + 1)(x + 3)$, so the partial fractions have the form
$$\frac{x + 2}{x^2 + 4x + 3} = \frac{A}{x + 1} + \frac{B}{x + 3}$$
Clearing denominators we get 
$$x + 2 = A(x + 3) + B(x + 1)$$
We could equate coefficients as in the first integral.  But there is an
easier way in cases like this where the bottom is a product of linear
factors.  Namely, this is supposed to be an equality of functions, valid
for all real $x$.  If we substitute $x = -1$ then we can isolate the term
with $A$ and solve for that coefficient:  $(-1) + 2 = A((-2) + 3)$, so $A = \frac{1}{2}$.
Similarly, with $x = -3$, we have $(-3) + 2 = B((-3) + 1)$, so $B = \frac{1}{2}$.
Then 
\begin{align*}
\int \frac{x + 2}{x^2 + 4x + 3} \ dx &= \int\frac{1/2}{x + 1}\ dx + \int\frac{1/2}{x + 3}\ dx\\
&= \frac{1}{2}\ln|x + 1| + \frac{1}{2}\ln|x + 3| + C.
\end{align*}
Using properties of logarithms, the integral can also be written as
$$\ln\left(\sqrt{|x^2 + 4x + 3|}\right) + C, $$
do you see why?
\item $\displaystyle \int \frac{x^4+1}{x^4 + 3x^3 + 2x^2}\ dx$
\item[] {\it Solution:}  This is another one where we need to divide first:
$$x^4 + 1 = (1)(x^4 + 3x^3 + 2x^2) - 3x^3 - 2x^2 + 1$$
so 
$$\frac{x^4+1}{x^4 + 3x^3 + 2x^2} = 1 + \frac{-3x^3 - 2x^2 + 1}{x^4 + 3x^3 + 2x^2}.$$
We decompose the last term in partial fractions:
$$\frac{-3x^3 - 2x^2 + 1}{x^4 + 3x^3 + 2x^2} = \frac{-3x^3 - 2x^2 + 1}{x^2(x+1)(x+2)}
 = \frac{A}{x^2} + \frac{B}{x} + \frac{C}{x+1} + \frac{D}{x+2}.$$
Clearing denominators:
$$-3x^3 - 2x^2 + 1 = A(x+1)(x+2) + Bx(x+1)(x+2) + Cx^2(x+2) + Dx^2(x+1)$$
If we substitute $x = 0$ we get $1 = 2A$, so $A = \frac{1}{2}$.  Then with $x = -1$,
we get $2 = C$.  With $x = -2$, we get $17 = -4D$, so $D = \frac{-17}{4}$.  Finally, from 
the coefficients of $x^3$ on both sides we get $-3 = B + C + D$, so $-3 = B + 2 - \frac{17}{4}$,
so $B = \frac{-3}{4}$.  This gives 
\begin{align*}
 \int \frac{x^4+1}{x^4 + 3x^3 + 2x^2}\ dx &= \int\ dx + \int\frac{1/2}{x^2}\ dx 
+ \int \frac{-3/4}{x}\ dx\\ 
&\qquad + \int \frac{2}{x+1}\ dx + \int\frac{-17/4}{x+2}\ dx\\
&= x - \frac{1}{2x} - \frac{3}{4}\ln|x| + 2\ln|x+1| - \frac{17}{4} \ln|x+2| + C.
\end{align*} 
\item $\displaystyle \int \frac{1}{x^4 + 5x^2 + 6}\ dx$\qquad  (Factor the bottom!)
\item[] {\it Solution:}  The bottom factors as 
$$(x^2 + 2)(x^2 + 3)$$
so the partial fractions look like 
$$ \frac{1}{x^4 + 5x^2 + 6} = \frac{Ax + B}{x^2 + 2} + \frac{Cx+D}{x^2 + 3}$$
Clearing denominators, 
\begin{align*}
1 &= (Ax + B)(x^2 + 3) + (Cx + D)(x^2 + 2)\\
&= (A + C)x^3 + (B + D)x^2 + (3A + 2C)x + 3B + 2D
\end{align*}
Equating coefficients gives $A + C = 0$ and $3A + 2C = 0$, so $A = C = 0$ and 
$B + D = 0, 3B + 2D = 1$, so $B = 1$ and $D = -1$.  The integral is
$$\int \frac{1}{x^2 + 2}\ dx - \int\frac{1}{x^2 + 3}\ dx = 
\frac{1}{\sqrt{2}} \tan^{-1}(x/\sqrt{2}) - \frac{1}{\sqrt{3}} \tan^{-1}(x/\sqrt{3}) + C$$ 
\end{enumerate}
\end{document}

\begin{figure}
\begin{center}
\includegraphics[width=.8\linewidth]{needleregion.png}
\end{center}
\caption{The region for problem 4.}
\end{figure}

\end{document}



