Skip to content

05. Indefinite Integrals

$\gdef \N{\mathbb{N}} \gdef \Z{\mathbb{Z}} \gdef \Q{\mathbb{Q}} \gdef \R{\mathbb{R}} \gdef \C{\mathbb{C}} \gdef \setcomp#1{\overline{#1}} \gdef \sseq{\subseteq} \gdef \pset#1{\mathcal{P}(#1)} \gdef \covariant{\operatorname{Cov}} \gdef \of{\circ} \gdef \p{^{\prime}} \gdef \pp{^{\prime\prime}} \gdef \ppp{^{\prime\prime\prime}} \gdef \pn#1{^{\prime\times{#1}}} $

June 5 Lecture. Links to the board and recording.

Introduction

Definition:
An indefinite integral is the antiderivative of a function.
I.e., given a function \(f(x)\), can we find a function \(F(x)\) such that \(F^\prime(x)=f(x)\)? \(F(x)\) is called the antiderivative of \(f\).

Example of antiderivative

\(f(x)=x^2\implies F(x)=\frac{x^3}{3}\) or \(\frac{x^3}{3}-17\) or \(\frac{x^3}{3}+15\)
In general, \(F(x)=\frac{x^3}{3}+C\quad (C\in\R)\)

Notation:
We use the symbolic notation:

\[\int{f(x)}\;dx=F(x)+C\]

\(f(x)\) is called the integrand.

Basic Integrals — Very Important

  • \(\int{\cos x}\;dx=\sin x+C\)
  • \(\int{\sin x}\;dx=-\cos x+C\)
  • \(\int{\tan x}\;dx=-\ln|\cos(x)|+C\)
  • \(\int{e^x}\;dx=e^x+C\)
  • \(\int{a^x}\;dx=\frac{a^x}{ln(a)}+C\)
  • \(\int{x^n}\;dx=\frac{x^{n+1}}{n+1}+C\)
    • For \(n\not=-1\)
  • \(\int{x^{-1}}\;dx=\int{\frac1x}\;dx=\ln{|x|}+C\)
  • \(\int{\frac1{1+x^2}}\;dx=\arctan x+C\)
  • \(\int{\frac1{\cos^2x}}\;dx=\tan x+C\)
  • \(\int{\frac{1}{\sin^2x}}\;dx=-\cot x+C\)
  • \(\int{k}\;dx=kx+C\)
  • \(\int{\ln x}\;dx=x\ln(x)-x\)
Basic Properties
  1. Suppose \(\int f = F, \int g = G\).
    \(\int{\left[f(x)+g(x)\right]}\;dx=F(x)+G(x)+C\)
    The derivative of a sum is the sum of the derivatives. Therefore, the integral of a sum is equal to the sum of the integrals. Basically, this means you can split up the integral where there are terms being added or subtracted.
  2. Suppose \(\int f = F, k\in\R\).
    \(\int{(kf)(x)}\;dx=k\cdot\int{f(x)}\;dx=kF(x)+C\)
    The integral of a product of a constant and a function is the product of a constant and the integral of the function. Basically, this means you can pull constant coefficients outside of the integrand.
    E.g, \(\int{5x^3}\;dx=5\cdot\int{x^3}\;dx=5\cdot\frac{x^4}{4}+C=\frac{5x^4}{4}+C\)
  3. Combining properties 1 & 2, we get “linearity of the integral”:
    • \(\int\big[af(x)+bg(x)\big]\;dx=aF(x)+bG(x)\)

Example: Exercise 6, Q1/1

\[\begin{array}{l}\int{\left(2x^3+\frac3x\right)}\;dx &=\int{2x^3}\;dx\;&+\;\int{\frac3x}\;dx\\ &=2\int{x^3}\;dx\;&+\;3\int{\frac1x}\;dx\\ &=2\cdot\frac{x^4}{4}+C&+\ 3\cdot\ln|x|+C\\ =\frac{x^4}{2}+3\ln|x|+C \end{array}\]
Integration by Substitution

Reversing the Chain Rule.
Rule:
Suppose \(F^\prime=f\). Then by the chain rule, \({[F(u(x))]}^\prime=f(u(x))\cdot u^\prime(x)\). When we reverse the process, \(\int{f(u(x))\cdot u^\prime(x)}\;dx=F(u(x))+C\)
Therefore, we deduce the following rule:

\[\int{\Big[f\big(u(x)\big)\cdot u^\prime(x)\Big]}\;dx=F\big(u(x)\big)+C\]

The key is to identify one factor of the integrand as the derivative of another part of the integrand; this other part will be your \(u^\prime(x)\).
Another way to say that is to find a composed function \((f\of g)(x)\) within the integrand such that \(g^\prime(x)\) is being multiplied by the composed function

Example of Reversing the Chain Rule

\[\int{\underbrace{3\sin^2x}_{\textcolor{blue}{f\big(\textcolor{orange}{u(x)}\big)}}}\ \underbrace{\cos x}_{\textcolor{green}{u^\prime(x)}}\;dx=\underbrace{\sin^3x}_{\textcolor{red}{F\big(\textcolor{orange}{u(x)}\big)}}+C\]

Where,

  • The composed function is \(\textcolor{blue}{3}\textcolor{orange}\sin\textcolor{blue}{^2}\textcolor{orange}x\)
  • \(\textcolor{red}{F(x)}=x^3\)
  • \(\textcolor{blue}{f(x)}=F^\prime(x)=3x^2\)
  • \(\textcolor{orange}{u(x)}=\sin x\)

We use substitution to make this method technically easier:

Substitution

Denote \(u^\prime(x)dx\) as \(du\), and write \(f\big(u(x)\big)\) as \(f(u)\).
I.e., remove \(x\) from the integral entirely, rewrite it as an integral in the variable \(u\).

\[\int \underbrace{f(u(x))}_{f(u)}\ \underbrace{u^\prime(x)\;dx}_{du}=\int f(u)\;du=F(u)+C=F\big(u(x)\big)+C\]

Example of Using Substitution \(\int{3\sin^2x\cos x}\;dx\)

\[\int{3\sin^2x\cos x}\;dx=\int{3u^2}\;du\]

Where,

  • We substitute \(u(x)=\sin x\),
    which gives us \(u^\prime(x)\;dx=\cos x\;dx\)

  • Solve the simplified integral:

\[\int{3u^2}\;du=u^3+C\]
  • Replace the substitution:
\[u^3+C=\sin^3x+C\]

June 5 Tirgul. Links to the board and the recording.
The key is to find the appropriate \(u(x)\), see above rule.

General Rule

\[\int{\frac{1}{x^2+a}}dx=\frac{1}{\sqrt a}\arctan\left(\frac x{\sqrt a}\right)\]

Useful Trigonometric Identities

\[\begin{aligned} \sin(x)\sin(y)&=\frac{\cos(y-x)-\cos(y+x)}2\\ \cos(x)\cos(y)&=\frac{\cos(y-x)+\cos(y+x)}2\\ \sin(x)\cos(y)&=\frac{\sin(y+x)-\sin(y-x)}2\\ \cos(x)\sin(x)&=\frac{\sin(2x)}2 \\ \sin^2(x)&=\frac{1-\cos(2x)}2=1-\cos^2x\\ \cos^2(x)&=\frac{1+\cos(2x)}2=1-\sin^2x\\ \end{aligned}\]
Integration by Parts

Reversing the Product Rule
Recall the Product Rule:
\({(f\cdot g)}^\prime=f\cdot g^\prime+f^\prime\cdot g\)
Moving things around, we get this:
\(f\cdot g^\prime={(f\cdot g)}^\prime-f^\prime\cdot g\)
Integrating both sides gives us this rule:

\[\int{u\cdot v^\prime}\;dx=uv-\int{u^\prime\cdot v}\;dx\]

This is helpful when the integrand can be expressed as \(u\cdot v^\prime\), where \(u^\prime\cdot v\) is easier to integrate.
Picking an appropriate \(u\) and \(v^\prime\):
\(u\) should become simpler - or at least, not more complicated when differentiating.
\(v^\prime\) should become simpler - or at least, not more complicated when integrating.
Generally, but not always, you usually want to avoid having an exponential function as \(v^\prime\).
Specifically: \(x^n\) should be \(u\), not \(v^\prime\).

Example of Integration by Parts: \(\int{xe^x}\;dx\)

Given \(\int{xe^x}\;dx\).
We want to express \(xe^x\) as \(u\cdot v^\prime\), so we choose \(u=x\), and \(v^\prime=e^x\).

\(u=x\) \(v=e^x\)
\(u^\prime=1\) \(v^\prime=e^x\)

Applying the above formula, we get:

\[xe^x-\int{e^x}\;dx=xe^x=e^x+C\]

June 7 Lecture. Links to the board and the recording.

Algebraic Methods for Integrating a Rational Function
\[\int\frac{P(x)}{Q(x)}\;dx\]

First, let’s look at simple rationals that don’t need any special methods:

Simple example: \(\int{\frac{x+4}{x^2+7}}\;dx\)

Break up \(\frac{x+4}{x^2+7}\):

\[\frac{x+4}{x^2+7}=\frac{x}{x^2+7}+\frac{4}{x^2+7}\]

Therefore,

\[\int{\frac{x+4}{x^2+7}}\;dx=\int{\frac{x}{x^2+7}}\;dx+\int{\frac{4}{x^2+7}}\;dx\]

Simple example: \(\int{\frac{x+x^3}{x^4+2x^2}}\;dx\)

Notice that the derivative of the denominator is \(4x^3+4x=4(x+x^3)\), which is \(4\) times the numerator.

\[\int{\frac{x+x^3}{x^4+2x^2}}\;dx=\frac14\int{\frac{4(x+x^3)}{x^4+2x^2}}\;dx\]

Substitute \(u=x^4+2x^2,\; du=4(x+x^3)dx\)

\[\frac14\int{\frac{du}{u}}=\frac14\ln|u|+C\]

Un-substitute

\[\frac14\ln|u|+C=\frac14\ln|x^4+2x^2|+C=\frac14\ln(x^4+2x^2)+C\]

Simple: When it works, just do it.

The last two examples are “easy” methods when they work:

  • Split the integrand into the sum of two ‘easier’ ones
  • Notice that the numerator is a derivative (or multiple thereof) of the denominator

However, it won’t always be so easy.

Cases where it’s not so simple:

  • The degree of the numerator is equal to or larger than the degree of the denominator
  • The denominator is a quadratic equation

deg P ≥ deg Q
When the numerator has a higher or equal degree than the denominator, first actually do the division:

Not-So-Simple Example \(\int\frac{x^4}{x^2+4}\)

First divide: \(\frac{x^4}{x^2+4}=x^2-4+\frac{16}{x^2+4}\)
Then integrate:

\[\int{x^2-4+\frac{16}{x^2+4}}\;dx=\int{x^2}\;dx-\int4\;dx+16\int{\frac{1}{x^2+4}}\;dx\]

These are now simple integrals that we know how to solve.

Not-So-Simple Example \(\int{\frac{3x-4}{x^2+2x+5}}\;dx\)

We “complete the square” in the denominator, so we get the form \(\int\frac{3x+4}{(x+a)^2+b}\)
\(x^2+2x+5=(x^2+2x+1)+4=(x+1)^2+4\)
Substitute \(u=x+1\;du=1dx\)
\(x=u-1\implies3x-4=3(u-1)-4=3u-7\)

\[\int{\frac{3x-4}{x^2+2x+5}}\;dx=\int{\frac{3u-7}{u^2+4}}\;du\]

Summary of method:
Complete the square in the denominator to change it from \(x^2+ax+b\) to \(u^2+c\)
This only works if the denominator \(Q(x)>0\) for all \(x\) — i.e., it doesn’t break down into factors. When this condition is not met, we use Decomposition (see below).

Decomposition into Partial Fractions

A rational function of the form \(\frac{Ax+B}{(Cx+D)(Mx+N)}\) can be broken down as \(\frac P{Cx+D}+\frac Q{Mx+N}\), where the degrees of the numerators are less than that of the denominators.
If the numerator has a degree of 0 or 1, the denominator has a degree of 2.

Example

\[\frac{20}{(2x+1)(x-2)}=\frac{P(x-2)}{2x+1}+\frac{Q(2x-1)}{(x-2)}=\frac{(P+2Q)x+(-2P+Q)}{(2x+1)(x-2)}\]

Therefore, \((P+2Q)x+(-2P+Q)=20\)
Comparing coefficients across numerators, we get:

\[\begin{aligned}P+2Q&=0\\-2P+Q&=20\end{aligned}\]

Solving for \(P\) and \(Q\), we get \(Q=4,\;P=-8\). Plugging them into our desired form:

\[\frac{20}{(2x+1)(x-2)}=\frac{-8}{2x+1}+\frac{4}{x-2}\]

The integrals of the summands are much easier to calculate.

If the denominator has more than two factors:

\(\frac{Ax+B}{(Cx+D)(Mx+N)(Sx+T)}=\frac P{Cx+D}+\frac Q{Mx+N}+\frac R{Sx+T}\)

In each summand, the numerator can be of degree up to one less than that of the denominator. \({(\text{deg}(numerator)≤\text{deg}(denominator)-1)}\). If the denominator is an irreducible polynomial of degree 2, set the numerator as degree 1. (\(Ax+B\))