\documentclass[letter,12pt]{article}
\usepackage[margin=0.5in,hmargin=4cm]{geometry}
\pagestyle{headings}
\usepackage{amssymb,amsmath,hyperref,enumerate}
\usepackage{graphicx}
\begin{document}
\providecommand{\R}{\mathbb{R}}
\providecommand{\at}{\restriction}
\providecommand{\evalat}[3]{\left[ #1 \right]_{#2}^{#3}}
\providecommand{\dx}{\operatorname{dx}}
\providecommand{\dy}{\operatorname{dy}}
\providecommand{\dt}{\operatorname{dt}}
\providecommand{\dth}{\operatorname{d}\theta}
\providecommand{\du}{\operatorname{du}}
\providecommand{\dv}{\operatorname{dv}}
\providecommand{\ddx}{\frac{d}{\dx}}
\providecommand{\dydx}{\frac{\dy}{\dx}}
\providecommand{\dudx}{\frac{\du}{\dx}}
\providecommand{\dthdx}{\frac{\dth}{\dx}}
\providecommand{\dxdth}{\frac{\dx}{\dth}}
\renewcommand{\o}{\circ}
\providecommand{\rcp}[1]{\frac{1}{#1}}
\providecommand{\dom}{\operatorname{dom}}
\def\dividelen#1#2{\@tempdima=#1 \divide\@tempdima by #2 \@tempdima}

## Partial fractions

Definition:
    A _rational function_ is one of the form $\frac{P(x)}{Q(x)}$ where P and Q
    are polynomials.

    e.g. $\frac{x^3-2x+1}{x^2-7}, x^2, \frac{1}{x^9+1}$

We already know how to integrate some of these.

Recall:
    ***) $\int x^n \dx = \frac{x^{n+1}}{n+1} + C$ if $n != -1$
    ** $\int \rcp{x} \dx = \ln|x| + C$
    ** $\int \rcp{x^2+1} \dx = \arctan x + C$
    ** $\int \frac{2x}{x^2+1} \dx = \int \rcp{u} du = \ln|x^2+1| + C$
    *e)*

How about $\int \rcp{x^2-1} \dx$?

*\[a* \int \rcp{x^2-1} \dx &= \int \rcp{(x+1)(x-1)} \dx \\
&= \int \rcp{2} (\frac{1}{x-1} - \frac{1}{x+1}) \dx \\
&= \rcp{2} (\int\rcp{x-1}\dx - \int\rcp{x+1})\dx \\
&= \rcp{2} (\ln|x-1| - \ln|x+1|) \\
&= \ln\sqrt{\frac{|x-1|}{|x+1|}} *a\]*

The key trick here was to recognise the rational function $\rcp{(x+1)(x-1)}$ as being a
linear combination of simpler rational functions \(``partial fractions''\), namely
$\rcp{2}(\rcp{x-1}-\rcp{x+1})$.

We will see that this technique, along with the integrals recalled above and
polynomial division, allows us to integrate #any# rational function.

Example of using polynomial division:
    *\[a* \int \frac{x^3+1}{x^2+1} \dx &= \int \frac{x(x^2+1) - x + 1}{x^2+1} \\
    &= \int (x + \frac{1-x}{x^2+1}) \dx \\
    &= \int (x + \rcp{x^2+1} - \frac{x}{x^2+1}) \dx\\
    &= \frac{x^2}{2} + \arctan(x) - \frac{\ln|x^2+1|}{2} + C
    *a\]*

Fact I:
    Any polynomial over the reals can be factored as a product of linear and
    quadratic factors.
Proof:
    Consequence of the ``Fundamental Theorem of Algebra'' - ask your 1ZC3
    lecturer about it next semester.

Examples:
    ***) $x^3+1 = (x+1)(x^2-x+1)$
    ** $x^4-1 = (x^2+1)(x^2-1) = (x^2+1)(x+1)(x-1)$
    *e)*

Fact II:
    Given $\frac{P(x)}{Q(x)}$ with $\deg(P) < \deg(Q)$, if $Q(x)$ factors into
    distinct irreducible factors
	\[ Q(x) = q_1(x)q_2(x)...q_n(x) \]
    \(each $q_i$ linear or irreducible quadratic\)
    then there exist $p_i(x)$ with $deg(p_i)<deg(q_i)$ such that
    \[ \frac{P(x)}{Q(x)} = \sum_i \frac{p_i(x)}{q_i(x)} .\]
Proof:
    Can be proven quite easily with linear algebra. Ask your 1ZC3 lecturer
    about this too!

Examples:
    ***) $\frac{1}{x^3-x}$
	\vspace{3cm}
    ** $\frac{x^2-4}{x^4-1}$
	\vspace{3cm}
    *e)*

General technique for integrating rational functions:
    ***) if the top has greater degree than the bottom, first use polynomial
	division to fix this;
    ** factor the bottom;
    ** split up in to partial fractions;
    ** integrate each.
    *e)*

Examples:
    ***) $\int\frac{x^2-4}{x^4+1} \dx$
    ** $\int\frac{x^4-x^2+1}{x^3-x} \dx$
    *e)*

Repeated factors:
    If $Q(x)$ has repeated factors, e.g. $Q(x)=x^3-2x^2+x=x(x-1)^2$, then we
    can still use partial fractions but we need a new trick:

    If $(x-a)^n$ is a factor of $Q(x)$, in the partial fractions expression we
    should use
	\[ \frac{A_1}{x-a} + \frac{A_2}{(x-a)^2} + ... + \frac{A_n}{(x-a)^n} \]

Example:
    $\int \frac{x^2+1}{x^3-2x^2+x} dx$

\end{document}
