Skip to main content

Section A.3 Differentiation and Integration Techniques

In this section, we will cover some of the basic derivative and integral formulas that will be necessary for success in Differential Equations. In order to be able to deal with equations that involve derivatives, we need to be able to take derivatives as well as remove them.

Subsection Derivative and Integral Formulas

The following is a table of some of the basic derivative formulas covered in a Calculus 1 course.
Table A.3.1.
Function \(f(x)\) Derivative \(f'(x)\)
\(x^n\) any \(n\) \(nx^{n-1}\)
\(\ln(x)\) \(\frac{1}{x} = x^{-1}\)
\(C\) constant \(0\)
\(e^x\) \(e^x\)
\(e^{ax}\) \(ae^{ax}\)
\(\sin(x)\) \(\cos(x)\)
\(\cos(x)\) \(-\sin(x)\)
\(\tan(x)\) \(\sec^2(x)\)
\(\arctan(x) = \tan^{-1}(x)\) \(\frac{1}{x^2 + 1}\)
Similarly, we have a table for some basic integral formulas. As integration is the inverse operation to differentiation, this table will look like the reverse version of the previous table.
Table A.3.2.
Function \(f(x)\) Integral \(\int f(x)\ dx\)
\(x^n\) any \(n \neq -1\) \(\frac{1}{n+1}x^{n+1} + C\)
\(\frac{1}{x}\) \(\ln(|x|) + C\)
\(e^x\) \(e^x + C\)
\(e^{ax}\) \(\frac{1}{a}e^{ax} + C\)
\(\sin(x)\) \(-\cos(x) + C\)
\(\cos(x)\) \(\sin(x) + C\)
\(\frac{1}{x^2 + 1}\) \(\arctan(x) + C\) or \(\tan^{-1}(x) + C\)

Subsection Derivative Rules

The tables above only list a few simple functions for which we know how to compute the derivative and integral. However, there are some nice properties of derivatives and integrals that make this enough for our needs.

Subsubsection Linearity of the Derivative and Integral

The derivative and integral are both linear operators. This means that if we have two functions \(f(x)\) and \(g(x)\text{,}\) and two constants \(a\) and \(b\text{,}\) then
\begin{equation*} \frac{d}{dx}\left( af(x) + bg(x)\right) = a\frac{df}{dx} + b\frac{dg}{dx}. \end{equation*}
That is, we can move constants and addition and subtractions out of the differentiation, reducing a complicated function down to simpler functions that we know how to differentiate.
The same is true for integration or antidifferentiation; if we have functions \(f(x)\) and \(g(x)\) and constants \(a\) and \(b\text{,}\) then
\begin{equation*} \int af(x) + bg(x) \ dx = a\int f(x)\ dx + b\int g(x)\ dx. \end{equation*}
Example A.3.3. .
Compute the following derivatives and integrals using linearity and the table of known formulas.
  1. \(\displaystyle \frac{d}{dx}\left(x^3 + \frac{4}{x^2} + 3e^{x} \right)\)
  2. \(\displaystyle \frac{d}{dx}\left( \sin(x) - 2\cos(x) + 5\ln(x) \right)\)
  3. \(\displaystyle \int \frac{2x^3 + 4x}{x^2}\ dx\)
  4. \(\displaystyle \int 2\cos(x) - \frac{3}{x^2 + 1}\ dx\)
Solution.
  1. For this, we can use linearity and our formulas to write
    \begin{align*} \frac{d}{dx}\left(x^3 + \frac{4}{x^2} + 3e^{x} \right) \amp= \frac{d}{dx}\left( x^3 \right) + \frac{d}{dx}\left(\frac{4}{x^2} \right) + \frac{d}{dx}\left(3e^x \right) \\ \amp= \frac{d}{dx}\left( x^3\right) + 4\frac{d}{dx}\left( x^{-2}\right) + 3\frac{d}{dx}\left( e^x\right) \\ \amp= 3x^2 - 8x^{-3} + 3e^x\text{.} \end{align*}
  2. This one gives
    \begin{align*} \frac{d}{dx}\left( \sin(x) - 2\cos(x) + 5\ln(x) \right) \amp= \frac{d}{dx}\left( \sin(x)\right) - \frac{d}{dx}\left(2 \cos(x) \right) + \frac{d}{dx}\left( 5\ln(x)\right) \\ \amp= \frac{d}{dx}\left( \sin(x)\right) - 2\frac{d}{dx}\left(\cos(x) \right) + 5\frac{d}{dx}\left( \ln(x)\right) \\ \amp= \cos(x) + 2\sin(x) + \frac{5}{x}\text{.} \end{align*}
  3. For this problem, we first want to simplify the expression algebraically, then integrate each term using linearity.
    \begin{align*} \int \frac{2x^3 + 4x}{x^2}\ dx \amp= \int \frac{2x^3}{x^2} + \frac{4x}{x^2}\ dx \\ \amp= \int 2x + \frac{4}{x}\ dx \\ \amp= 2\int x\ dx + 4\int \frac{1}{x}\ dx \\ \amp= x^2 + 4\ln(|x|) + C\text{.} \end{align*}
  4. This problem uses standard linearity to get to the final answer.
    \begin{align*} \int 2\cos(x) - \frac{3}{x^2 + 1}\ dx \amp= 2 \int \cos(x)\ dx - 3 \int \frac{1}{x^2 + 1}\ dx \\ \amp= 2 \sin(x) - 3\arctan(x) + C\text{.} \end{align*}

Subsubsection Product and Quotient Rule

Linearity gives us a way to handle sums and differences of derivatives. What about products? It turns out that doesn’t work as simply, but there is still as nice formula to work it out. This gives us the Product Rule. If we have two functions \(f(x)\) and \(g(x)\text{,}\) then
\begin{equation*} \frac{d}{dx}\left( f(x)g(x) \right) = f(x)\frac{dg}{dx} + \frac{df}{dx}g(x). \end{equation*}
That is, the derivative has two terms, the first function times the derivative of the second, and the derivative of the first function times the second function. The product rule can also be used to compute the product of more than two functions; the general formula is that only one function is differentiated at a time and each function should be differentiated once. That is, for three functions, the formula is
\begin{equation*} \frac{d}{dx}\left( f(x)g(x)h(x)\right) = \frac{df}{dx}g(x)h(x) + f(x)\frac{dg}{dx}h(x) + f(x)g(x)\frac{dh}{dx}. \end{equation*}
The Quotient Rule gives us a way to do the same thing, but with quotients. The formula here is that
\begin{equation*} \frac{d}{dx}\left(\frac{f(x)}{g(x)}\right) = \frac{g(x) \frac{df}{dx} - f(x)\frac{dg}{dx}}{(g(x))^2}. \end{equation*}
This can also be derived using the product rule and the chain rule. It is important to get the order of the numerator correct, as there is a subtraction on top. For the product rule, the addition means that the order doesn’t matter, but if the order for the quotient rule is incorrect, there will be an additional minus sign in the answer.
Example A.3.4.
Compute the following derivatives.
  1. \(\displaystyle \frac{d}{dx}\left(e^x \cos(x) \right)\)
  2. \(\displaystyle \frac{d}{dx}\left(\frac{\sin(x)}{x^2}\right)\)
  3. \(\frac{d}{dx}\left(\frac{x^3e^x}{\tan(x)}\right)\text{.}\)
Solution.
  1. This is a direct application of the product rule.
    \begin{align*} \frac{d}{dx}\left( e^x \cos(x) \right) \amp= e^x \frac{d}{dx}\left(\cos(x)\right) + \frac{d}{dx}\left(e^x \right)\cos(x) \\ \amp= e^x (-\sin(x)) + (e^x) \cos(x) \\ \amp= e^x(\cos(x) - \sin(x))\text{.} \end{align*}
  2. This is a direct application of the quotient rule.
    \begin{align*} \frac{d}{dx}\left(\frac{\sin(x)}{x^2}\right) \amp= \frac{x^2 \frac{d}{dx}\left(\sin(x)\right) - \sin(x) \frac{d}{dx}\left(x^2\right)}{(x^2)^2} \\ \amp= \frac{x^2 \cos(x) - \sin(x)(2x)}{x^4} \\ \amp= \frac{x\cos(x) - 2\sin(x)}{x^3}\text{.} \end{align*}
  3. For this problem, we need to apply both the product rule and the quotient rule. Since the quotient rule is on the outside, we apply it first.
    \begin{align*} \frac{d}{dx}\left(\frac{x^3e^x}{\tan(x)}\right) \amp= \frac{\tan(x) \frac{d}{dx}\left(x^3e^x\right) - x^3e^x \frac{d}{dx}\left(\tan(x)\right)}{(\tan(x))^2} \\ \amp= \frac{\tan(x)\left(x^3 \frac{d}{dx}\left(e^x\right) + \frac{d}{dx}\left(x^3\right)e^x\right) - x^3e^x\sec^2(x)}{\tan^2(x)} \\ \amp= \frac{\tan(x) \left(x^3e^x + 3x^2e^x\right) - x^3e^x\sec^2(x)}{\tan^2(x)} \\ \amp= \frac{e^x(x^3 + 3x^2)}{\tan(x)} - \frac{x^3e^x}{\sin^2(x)}\text{.} \end{align*}

Subsubsection Chain Rule

The only type of function we haven’t discussed yet for differentiation is composite functions, and that is handled by the Chain Rule. For example, we don’t have a direct way (yet) to differentiate functions like \(\sin(3x)\) or \(\frac{1}{x^3 + 4x + 1}\text{,}\) and the Chain Rule lets us to do that. This rule tells us that, for functions \(f(x)\) and \(g(x)\text{,}\) we can compute the derivative of the composition \((f \circ g)(x)\) or \(f(g(x))\) is
\begin{equation*} \frac{d}{dx}(f(g(x)) = f'(g(x))g'(x). \end{equation*}
This means that we differentiate the β€œoutside” function \(f\text{,}\) plug in the inside function, and then multiply this by the derivative of the β€œinside” function \(g\text{.}\) It requires us to identify what the β€œinner” and β€œouter” functions are, and then the formula gives what the derivative should be. This can be done in a few different ways, either moving from outside in, or moving from inside out. These problems are conventionally written with \(u(x)\) as the inside function, but any letter can be used.
Example A.3.5.
Compute the derivative of each of the following functions.
  1. \(\displaystyle f_1(x) = (x^3 + 5x + 1)^5\)
  2. \(\displaystyle f_2(x) = \cos(3x^2 + 1)\)
  3. \(\displaystyle f_3(x) = (1 + \sin(3x))^4\)
Solution.
  1. For this problem, we take \(f(u) = u^5\) and \(u(x) = x^3 + 5x + 1\text{,}\) which gives that composing these functions gives the \(f_1\) that we started with. Therefore, since \(f'(u) = 5u^4\) and \(u'(x) = 3x^2 + 5\text{,}\) we have that
    \begin{equation*} f_1'(x) = f'(u)u'(x) = 5u^4(3x^2 + 5) = 5(x^3 + 5x + 1)^4(3x^2 + 5). \end{equation*}
  2. For this case, the outside function is \(\cos(u)\) and the inner function is \(u(x) = 3x^2 + 1\text{.}\) Using the same process, we get that
    \begin{equation*} f_2'(x) = -\sin(u)(6x) = -6x\sin(3x^2 + 1). \end{equation*}
  3. Starting from the outside, we see that we can take \(f(u) = u^4\text{.}\) This makes \(u(x) = 1 + \sin(3x)\text{,}\) but we can’t differentiate this directly; it requires another iteration of the Chain Rule. Taking \(u(x) = 1 + \sin(v)\) for \(v(x) = 3x\text{,}\) we can then compute the derivative of each of these functions, and our original function \(f_3(x) = f(u(v(x)))\text{.}\) We can extend the Chain Rule to apply to three functions by taking it one step at a time. The result of this process is that
    \begin{equation*} \frac{d}{dx}(f(u(v(x)))) = f'(u(v(x))\frac{d}{dx}(u(v(x))) = f'(u(v(x)))u'(v(x))v'(x), \end{equation*}
    so you need to pull off one derivative at time to get to the correct computation. Thus, for this problem, we get that
    \begin{equation*} f_3'(x) = 4u^3(\cos(v))(3) = 12u^3\cos(v) = 12(1 + \sin(3x))^3\cos(3x). \end{equation*}

Subsection Integration Techniques

Another main topic that will be needed throughout study of differential equations is various integration techniques. When trying to solve questions that involve derivatives, integration will be a very important step in that process.

Subsubsection Substitution

The substitution method for integration serves as the inverse operation to the Chain Rule for differentiation. Since
\begin{equation*} \frac{d}{dx}(f(u(x))) = f'(u(x))u'(x), \end{equation*}
the definition of the integral as an antiderivative gives that
\begin{equation*} \int f'(u(x))u'(x)\ dx = f(u(x)) + C. \end{equation*}
Integrals of this form can be computed using this formula, but it is often easier to think of this process in terms of β€œchanging variables.” This means the following: If we have an integral that looks like
\begin{equation*} \int f'(u(x))u'(x)\ dx \end{equation*}
then we can define the variable \(u\) to represent the entire function \(u(x)\text{.}\) Then the differential \(du\) is defined by
\begin{equation*} du = u'(x) dx. \end{equation*}
Then we can substitute both \(u\) and \(du\) into the original expression to get that
\begin{equation*} \int f'(u(x))u'(x)\ dx = \int f'(u)\ du = f(u) + C = f(u(x)) + C. \end{equation*}
The last component of this process is changing the limits of integration if a definite integral is being computed. The idea is that an integral in \(x\) (denoted by \(dx\)) has its limits also in terms of \(x\text{,}\) where as the \(du\) integral has endpoints given in terms of \(u\text{.}\) The main way this comes up in problems is that
\begin{equation*} \int_a^b f(u(x))u'(x)\ dx = \int_{u(a)}^{u(b)} f(u)\ du \end{equation*}
because we know that \(u\) is written in terms of \(x\) as \(u = u(x)\text{.}\) Thus if we plug the \(x\) endpoints into this function, we will be the new \(u\) endpoints.
Example A.3.6. .
Compute the following integrals using substitution.
  1. \(\displaystyle \displaystyle \int \cos(4x)\ dx\)
  2. \(\displaystyle \displaystyle \int x\sin(3x^2 + 1)\ dx\)
  3. \(\displaystyle \displaystyle \int_0^2 \frac{3x^2}{x^3 + 4}\ dx\)
Solution.
  1. For this situation we want to set \(u = 4x\text{,}\) because then the integrand, once we make the change of variables, will be \(\cos(u)\text{,}\) which we know how to integrate. With this, we have \(du = 4\ dx\text{,}\) which we can rewrite as \(dx = \frac{1}{4}\ du\text{.}\) Plugging all of this in gives that
    \begin{equation*} \int \cos(4x)\ dx = \int \cos(u) \frac{1}{4}\ du = \frac{1}{4} \int cos(u)\ du = \frac{1}{4}\sin(u) + C = \frac{1}{4}\sin(4x) + C. \end{equation*}
  2. For the same reason, we want to set \(u = 3x^2 + 1\) to make the resulting integral \(\sin(u)\ du\text{.}\) In this case, we have \(du = 6x\ dx\) or \(x\ dx = \frac{1}{6}\ du\text{.}\) Plugging all of this in, we get
    \begin{equation*} \int x\sin(3x^2 + 1)\ dx = \int \sin(u) \frac{1}{6}\ du = \frac{1}{6}\int \sin(u)\ du = -\frac{1}{6}\cos(u) + C = -\frac{1}{6}\cos(3x^2 + 1) + C. \end{equation*}
  3. We can follow the same logic here as for the previous examples, but since we have a definite integral, we also need to switch the limits of integration. In this case, we want to pick \(u = x^3 + 4\text{,}\) which gives \(du = 3x^2\ dx\text{.}\) This gives the resulting integral as
    \begin{equation*} \int \frac{3x^2}{x^3 + 4}\ dx = \int \frac{1}{u}\ du. \end{equation*}
    For the limits of integration, we take the function \(u(x) = x^3 + 4\) and plug in the original values of \(0\) and \(2\text{.}\) This gives the value \(4\) and \(x=0\) and the value \(12\) at \(x=2\text{.}\) Therefore, the result of this computation is
    \begin{equation*} \int_0^2 \frac{3x^2}{x^3 + 4}\ dx = \int_4^{12} \frac{1}{u}\ du = \ln(|u|)\mid_4^{12} = \ln(12) - \ln(4) = \ln(3). \end{equation*}
There can be some cases where these techniques will not work, because the \(u'\) term that you are looking for doesn’t quite appear in the expression you are trying to integrate. In cases like this, you may need to use some more complicated methods (like trigonometric substitution) or connect to inverse trigonometric integrals or other known formulas.

Subsubsection Integration by Parts

Integration by parts is the method used to handle integrals of a product of functions. Like the substitution method is the inverse of the Chain Rule, integration by parts is the inverse of the product rule. There are two main formulas that are used for this process. For two differentiable functions \(f(x)\) and \(g(x)\text{,}\) we have
\begin{equation*} \int f(x) g'(x)\ dx = f(x)g(x) - \int g(x) f'(x) dx. \end{equation*}
The other form is
\begin{equation*} \int u\ dv = uv - \int v\ du, \end{equation*}
which matches the original form after setting \(u = f(x)\) and \(v = g(x)\text{.}\)
The most important part of this process is picking the appropriate functions for \(u\) and \(v\) in this formula. The general rule is given by the following list
and you want to make \(u\text{,}\) the function that you are differentiating, the one that is higher on the list. The main reason for this list is that integration is much harder than differentiation, and so we generally want to integrate the part of the product that we have a formula for. This is why logarithms and inverses are on the top; we know how to differentiate them, but integration is difficult or impossible. Polynomials are good for both differentiation and integrals, but the benefit of differentiating them is that they eventually disappear, leaving us with an integral that we know how to solve. For example, \(x^2\) becomes \(2x\text{,}\) and then differentiating a second time gives \(2\text{,}\) which is just a constant and can be removed from the integral. Trigonometric and Exponential functions are interchangeable, they are easy to differentiate and integrate, and they don’t go away if we keep applying either operation.
This method can also be performed mutliple times by redefining \(u\) and \(v\) and applying the same process to the integral that remains on the right-hand side. When doing this, it is important not to reverse the roles of \(u\) and \(v\text{,}\) because then the process will just undo what was done in the first step. There are also some cases where circular reasoning is used, integrating by parts twice to get to the same expression on both sides of the equal sign, which can then be solved for. One of those will be shown in the examples below.
Example A.3.7. .
Compute the following integrals.
  1. \(\displaystyle \int x\sin(2x)\ dx\)
  2. \(\displaystyle \int 3x^2e^{4x}\ dx\)
  3. \(\displaystyle \int e^{2x}\cos(3x)\ dx\)
Solution.
  1. Based on our list, we should choose \(u = x\text{,}\) as it is a polynomial function. This means that \(dv = \sin(2x)\ dx\text{.}\) From this, we get that \(du = dx\) and we compute \(v\) by integrating \(\sin(2x)\ dx\text{,}\) which requires a substitution. This results in \(v = -\frac{1}{2}\cos(2x)\text{.}\) Thus, the integration by parts formula gives
    \begin{equation*} \int x\sin(2x)\ dx = x \left(-\frac{1}{2}\cos(2x)\right) - \int \left(-\frac{1}{2}\cos(2x) \right) dx. \end{equation*}
    This last integral we can compute directly, again requiring a substitution. Thus, the final answer is
    \begin{equation*} \int x\sin(2x)\ dx = -\frac{x}{2}\cos(2x) + \frac{1}{4}\sin(2x) + C. \end{equation*}
  2. By the same argument as the first example, we want to pick \(u = 3x^2\) so then \(dv = e^{4x} dx\text{.}\) We can then compute that \(du = 6x\ dx\) and \(v = \frac{1}{4}e^{4x}\text{.}\) Thus, integration by parts gives
    \begin{equation*} \int 3x^2e^{4x}\ dx = 3x^2\left(\frac{1}{4}e^{4x}\right) - \int \left(\frac{1}{4}e^{4x}\right) (6x \ dx) = \frac{3}{4}x^2e^{4x}- \int \frac{3}{2} xe^{4x}\ dx. \end{equation*}
    This last integral is not something that we know how to compute. However, it looks like a product, so we should be able to work it out using integration by parts. We can set \(u = \frac{3}{2}x\) and \(dv = e^{4x}\ dx\text{.}\) This is the same \(dv\) as before, which is good. If we had picked \(dv = \frac{3}{2}x\ dx\text{,}\) we would have just gotten back to where we started. From these choices, we get that \(du = \frac{3}{2}\ dx\) and \(v = \frac{1}{4} e^{4x}\text{.}\) Integration by parts then gives that
    \begin{equation*} \int \frac{3}{2} xe^{4x}\ dx = \frac{3}{8}xe^{4x} - \int \frac{3}{8}e^{4x}\ dx. \end{equation*}
    Now we can compute this last integral, which will give another factor of \(\frac{1}{4}\text{,}\) resulting in
    \begin{equation*} \int \frac{3}{2} xe^{4x}\ dx = \frac{3}{8}xe^{4x} - \frac{3}{32}e^{4x} + C. \end{equation*}
    Finally, we can combine this with our first integration by parts step to get that
    \begin{equation*} \int 3x^2e^{4x}\ dx = \frac{3}{4}x^2e^{4x}- \frac{3}{8}xe^{4x} + \frac{3}{32}e^{4x} + C. \end{equation*}
  3. For this example, we have both an exponential and a trigonometric function. We can pick either one to be \(u\) and \(dv\text{,}\) and as long as we are consistent with that choice, we will get to the correct answer. For this, we will choose \(u = e^{2x}\) and \(dv = \cos(3x)\ dx\text{.}\) From these, we can compute that \(du = 2e^{2x}\ dx\) and \(v = \frac{1}{3}\sin(3x)\text{.}\) Thus, integration by parts tells us that
    \begin{equation*} \int e^{2x}\cos(3x)\ dx = \frac{1}{3}e^{2x}\sin(3x) - \int \frac{2}{3}e^{2x}\sin(3x)\ dx. \end{equation*}
    This new integral is again a product, so we need to handle it using integration by parts. To do this, we are going to pick \(u = \frac{2}{3}e^{2x}\) and \(dv = \sin(3x)\ dx\text{.}\) Note: If you pick \(u = \sin(3x)\) and \(dv = \frac{2}{3}e^{2x}\ dx\text{,}\) the second integration by parts will just give that
    \begin{equation*} \int e^{2x}\cos(3x) \ dx = \int e^{2x}\cos(3x)\ dx \end{equation*}
    which does not help in solving the problem. With the correct choice of \(u\) and \(dv\text{,}\) \(u = \frac{2}{3}e^{2x}\) and \(dv = \sin(3x)\ dx\text{,}\) we have that \(du = \frac{4}{3}e^{2x}\ dx\) and \(v = -\frac{1}{3}\cos(3x)\text{,}\) so that integration by parts tells us that
    \begin{equation*} \int \frac{2}{3}e^{2x}\sin(3x)\ dx = -\frac{2}{9}e^{2x}\cos(3x) - \int - \frac{4}{9}e^{2x}\cos(3x)\ dx. \end{equation*}
    Combining this with our first integration by parts gives
    \begin{align*} \int e^{2x}\cos(3x)\ dx \amp= \frac{1}{3}e^{2x}\sin(3x) - \int \frac{2}{3}e^{2x}\sin(3x)\ dx \\ \amp= \frac{1}{3}e^{2x}\sin(3x) + \frac{2}{9}e^{2x}\cos(3x) - \int \frac{4}{9}e^{2x}\cos(3x)\ dx \\ \int e^{2x}\cos(3x)\ dx \amp= \frac{1}{3}e^{2x}\sin(3x) + \frac{2}{9}e^{2x}\cos(3x)- \frac{4}{9}\int e^{2x}\cos(3x)\ dx\text{.} \end{align*}
    In this case, we can see that the integral on the left matches the integral on the right. If we combine these on the left side, we get
    \begin{equation*} \frac{13}{9} \int e^{2x}\cos(3x)\ dx = \frac{1}{3}e^{2x}\sin(3x) + \frac{2}{9}e^{2x}\cos(3x) \end{equation*}
    which then allows us to solve for the answers as
    \begin{equation*} \int e^{2x}\cos(3x)\ dx = \frac{3}{13}e^{2x}\sin(3x) + \frac{2}{13}e^{2x}\cos(3x). \end{equation*}

Subsubsection Partial Fractions

Another integration technique that shows up frequently when dealing with rational functions is the method of partial fractions. This method works around decomposing a rational function into forms that we are able to integrate. For example, we do not have a formula or method to compute the integral
\begin{equation*} \int \frac{3}{x^2 - x - 2} \ dx. \end{equation*}
since there is no simple function whose derivative is \(\frac{3}{x^2 - x - 2}\text{.}\) What functions like this can we integrate?
Example A.3.8.
Compute the following antiderivatives
  1. \(\displaystyle \int \frac{1}{x-2} \ dx\)
  2. \(\displaystyle \int \frac{1}{x^2 + 4}\ dx\)
  3. \(\int \frac{x}{x^2 + 9}\ dx\text{.}\)
Solution.
  1. This integral can be computed by a substitution \(u = x-2\text{,}\)
    \begin{equation*} \int \frac{1}{x-2}\ dx = \int \frac{1}{u}\ du = \ln|x-2| + C. \end{equation*}
  2. This integral is another substitution, but the goal here is arctangent, not a logarithm. We let \(u = \nicefrac{x}{2}\text{,}\) so that \(du = \nicefrac{1}{2}\ dx\text{,}\) and then
    \begin{equation*} \int \frac{1}{x^2 + 4}\ dx = \int \frac{1}{4u^2 + 4} 2\ du = \frac{1}{2} \int \frac{1}{u^2 + 1}\ du = \frac{1}{2} \arctan\left( \frac{x}{2} \right) + C. \end{equation*}
  3. With an \(x\) on top of the expression, we can now use a substitution \(u = x^2 + 9\) to solve the integral.
    \begin{equation*} \int \frac{x}{x^2 + 9}\ dx = \frac{1}{2} \int \frac{1}{u}\ du = \frac{1}{2} \ln|x^2 + 9| + C. \end{equation*}
So, we can handle these types of integrals, but that doesn’t necessarily help us with the initial one. Let’s take a look at another example.
Example A.3.9.
Compute
\begin{equation*} \int \frac{1}{x-2} - \frac{1}{x+1}\ dx. \end{equation*}
Solution.
This integral can be computed by splitting it into the two terms present. Each of those we know how to evaluate using the previous example. Thus, we have that
\begin{equation*} \int \frac{1}{x-2} - \frac{1}{x+1}\ dx = \ln(|x-2|) - \ln(|x+1|) + C = \ln\left(\frac{|x-2|}{|x+1|}\right) + C. \end{equation*}
This is great! However, we can compute that, by adding fractions
\begin{equation*} \frac{1}{x-2} - \frac{1}{x+1} = \frac{(x+1)-(x-2)}{(x-2)(x+1)} = \frac{3}{x^2 - x - 2}. \end{equation*}
So this gives us a way to compute the original integral of this section, and we now know that
\begin{equation*} \int \frac{3}{x^2 - x - 2} \ dx = \ln\left(\frac{|x-2|}{|x+1|}\right) + C. \end{equation*}
This gives an idea for how we may be able to evaluate integrals of rational functions. In the case of the integral above, we would need to figure out a way to convert between
\begin{equation*} \frac{3}{x^2 - x - 2} \text{ and } \frac{1}{x-2} - \frac{1}{x+1}, \end{equation*}
that is, we need to split the complicated fraction into the smaller, simpler that we can integrate. Based on our work in ExampleΒ A.3.8, we know that we can integrate functions that have a linear term in the denominator and a quadratic term in the denominator, and the process of putting these fractions together into a single term involves multiplying the individual denominators together. This gives the motivation for the method of partial fractions for integrating rational functions:
  1. Factor the denominator of the function we need to integrate. Any polynomial can be factored into linear terms (terms like \(x-a\)) or irreducible quadratic terms (terms like \(x^2 + 4\) or \(x^2 + 2x + 5\)).
  2. Write an expression with unknown coefficients for each factor in the expression. If it is a linear term, it will need just a single constant, but if there is a quadratic term, it needs a numerator of the form \(Ax + B\text{.}\)
  3. Solve for the necessary constants (more on this later).
  4. Integrate each of the resulting expressions, which are all forms where we know the antiderivative.
  5. Combine the terms into a single expression.
The process is best shown through an example.
Example A.3.10. .
Compute
\begin{equation*} \int \frac{3x + 1}{x^3 - x^2 - 12x}\ dx. \end{equation*}
Solution.
We start by factoring the denominator. We can factor an \(x\) out of each term, and then the resulting quadratic can be factored. Since
\begin{equation*} x^3 - x^2 - 12x = x(x+3)(x-4) \end{equation*}
we want to figure out coefficients \(A\text{,}\) \(B\text{,}\) and \(C\) so that
\begin{equation*} \frac{3x + 1}{x^3 - x^2 - 12x} = \frac{A}{x} + \frac{B}{x+3} + \frac{C}{x-4} \end{equation*}
where we have one term per factor of the denominator. In order to find these constants, our first trick is to multiply both sides of this equation by the entire denominator on the left. This gives
\begin{equation} 3x+1 = A(x+3)(x-4) + B(x)(x-4) + C(x)(x+3)\tag{A.3.1} \end{equation}
where we have cancelled the appropriate terms from the top and bottom of each expression. One way to go from here to the constants is to expand out the right-hand side and recognize that for these two sides to be equal for all \(x\text{,}\) the coefficient of \(x^2\text{,}\) \(x\text{,}\) and the constant term must match. This will result in solve a system of 3 equations.
An easier approach to doing this is to plug values for \(x\) into each side, and to pick those values cleverly. One clever choice for (A.3.1) is to set \(x=0\text{.}\) If we do that, both the \(B\) and \(C\) terms will go away, because they are multiplied by zero. Thus, if we plug in zero, we get
\begin{equation*} 1 = -12A + 0 + 0 \end{equation*}
which implies that \(A = -\nicefrac{1}{12}\text{.}\) For the next term, we can plug in \(-3\) to make the \(x+3\) terms go away, resulting in
\begin{equation*} -8 = B(-3)(-7) \end{equation*}
so that \(B = -\nicefrac{8}{21}\text{.}\) Plugging in \(x=4\) gives
\begin{equation*} 13 = C(4)(7) \end{equation*}
so that \(C = \nicefrac{13}{28}\text{.}\) Therefore, we can write that
\begin{equation*} \frac{3x + 1}{x^3 - x^2 - 12x} = \frac{-\nicefrac{1}{12}}{x} + \frac{ -\nicefrac{8}{21}}{x+3} + \frac{\nicefrac{13}{28}}{x-4} \end{equation*}
Then, we can integrate both sides to get that
\begin{equation*} \int \frac{3x + 1}{x^3 - x^2 - 12x}\ dx = -\frac{1}{12}\ln(|x|) - \frac{8}{21}\ln(|x+3|) + \frac{13}{28} \ln(|x-4|) + C. \end{equation*}
The same type of approach applies if there are irreducible quadratics in the expression.
Example A.3.11.
Compute
\begin{equation*} \int \frac{2x^2 - 6}{x^3 - x^2 + 4x - 4}\ dx. \end{equation*}
Solution.
The denominator can be factored as \((x^2 + 4)(x-1)\text{,}\) which can be determined by grouping. This means that to do the partial fraction decomposition, we need to find coefficients \(A\text{,}\) \(B\text{,}\) and \(C\) so that
\begin{equation*} \frac{2x^2 - 6}{x^3 - x^2 + 4x - 4} = \frac{Ax + B}{x^2 + 4} + \frac{C}{x-1}. \end{equation*}
Note that the \(x^2 + 4\) term has \(Ax + B\) on top instead of just \(A\text{.}\) This is because the term on the bottom is a quadratic, and there will always be a number of coefficients on top that matches the degree of the term in the denominator. By multiplying both sides by the denominator will give the equation
\begin{equation*} 2x^2 - 6 = (Ax + B)(x-1) + C(x^2 + 4) \end{equation*}
where we need to find the appropriate constants. In this case, we can plug in \(x=1\) to determine that \(-4 = 5C\) or \(C = -\nicefrac{4}{5}\text{.}\) However, there is no value we can plug in to make \(x^2 + 4 = 0\text{.}\) We could use complex numbers here, but assuming we don’t want to do that, we can plug in any two numbers and go from there. Plugging in \(x=0\) is nice because it makes the \(A\) term go away, resulting in
\begin{equation*} -6 = B(-1) + C(4) = -B - \frac{16}{5} \end{equation*}
which we can solve to get \(B = \nicefrac{14}{5}\text{.}\) Finally, we can plug in any other number for \(x\) to get an equation to solve for \(A\text{.}\) Let’s use \(-1\) to give that
\begin{equation*} -4 = \left(-A + \frac{14}{5}\right)(-2) + \left(-\frac{4}{5}\right)(5) = 2A - \frac{28}{5} - 4 \end{equation*}
which gives that \(A = -\nicefrac{14}{5}\text{.}\) Therefore, we can write
\begin{equation*} \frac{2x^2 - 6}{x^3 - x^2 + 4x - 4} = \frac{-\nicefrac{14}{5}x + \nicefrac{14}{5}}{x^2 + 4} + \frac{-\nicefrac{4}{5}}{x-1}. \end{equation*}
Therefore, we can write the integral we want to compute as
\begin{align*} \int \frac{2x^2 - 6}{x^3 - x^2 + 4x - 4}\ dx \amp= \int \frac{-\nicefrac{14}{5}x + \nicefrac{14}{5}}{x^2 + 4} + \frac{-\nicefrac{4}{5}}{x-1}\ dx \\ \amp= -\frac{14}{5} \int \frac{x}{x^2 + 4}\ dx + \frac{14}{5} \int \frac{1}{x^2 + 4}\ dx - \frac{4}{5} \int \frac{1}{x-1}\ dx \\ \amp= -\frac{7}{5}\ln(|x^2 + 4|) + \frac{7}{5} \arctan\left(\frac{x}{2}\right) - \frac{4}{5}\ln(|x-1|) + C\text{.} \end{align*}
There are a few extra complications that can result from using this method.
  1. If there is an irreducible quadratic like \(x^2 + 2x + 5\) in the denominator, we will want to separate that out and complete the square before integrating. In this case, we have \(x^2 + 2x + 5 = (x+1)^2 + 4\text{,}\) so we will want to use \(A(x+1) + B\) when solving for coefficients (to make the u-substitution work better), and will get a slightly more complicated result.
  2. If there are repeated factors, like \((x-1)^2\) in the denominator, we need to include one term in the partial fraction expansion for every power of that factor. For instance, the expansion should look like
    \begin{equation*} \frac{1}{(x+1)(x-3)^3} = \frac{A}{x+1} + \frac{B}{x-3} + \frac{C}{(x-3)^2} + \frac{D}{(x-3)^3}. \end{equation*}
  3. If the rational function has an equal or higher degree in the numerator than in the denominator, we will need to do long division to remove a standard polynomial (which we know how to integrate) and a proper rational function that can be integrated using partial fractions.
Combining all of these techniques together will allow us to integrate pretty much any rational function that we need for a given application.