Brain Dump

Integration

Tags
math

Is the reverse of differentiation. For a function \( f(x) \) we call its derivative \( \int f(x) \,dx \).

Consider a simple function \( y = ax^2 + bx +c \). If we differentiate \( y \) with respect to \( x \) using the rule \( \times \) by power, decrement power, we get \( \frac{\,dy}{\,dx} = 2ax + b \). If we now try to repeat this process in reverse we increment the power, then divide by this \( \text{power} + 1 \), to get \( \int \frac{\,dy}{\,dx} \,dx = \frac{2ax^2}{n+1} + \frac{bx}{1} + k \) with \( k \) being the constant \( c \) that we lost when we differentiated \( y \). Given more information about the curve, such as a point on its curve, we can discover the value of \( k \) by substituting \( x \) and \( y \) values and then solving for \( k \).

Laws of Integration

Table 1: Listing of common functions and their integrals. tbl:common-integration-functions
\( f(x) \)\( \int f(x) \,dx \)
\( \sec^2(kx) \)\( \frac{1}{k} \tan kx \)
\( \tan x \)\( \ln \abs{\sec x} \)
\( \cot x \)\( \ln \abs{\sin x} \)
\( \cosec x \)\( - \ln \abs{\cosec x + \cot x} \), \( \ln \abs{\tan(\frac{1}{2}x)} \)
\( \sec x \)\( \ln \abs{\sec x + \tan x} \), \( \ln \abs{\tan(\frac{1}{2} x + \frac{1}{4} \pi)} \)
\( \int u \frac{\,dv}{\,dx} \,dx \)\( uv - \int v \frac{\,du}{\,dx} \,dx \)

Integration Rules

Linear Reverse Chain Rule

Is an approach for the integration of more complex equations through the equivalence of the integration of the chain rule.

Note: This approach only works when the sub function is linear (example: \( 2x \) not \( x^2 \)).

\begin{align*} \frac{\,d}{\,dx} f(g(x)) &= f'(g(x)) g'(x) \
\int f'(g(x)) g'(x) \,dx &= f(g(x)) + c \
\end{align*}

This approach works by pattern matching, mentally associating the inner and outer sub-functions of the chain-rule and using that to reverse the differentiation. In lieu of a concrete approach the rest of this section simply provides several examples of the linear reverse chain rule in action.

The final formula used to apply the linear reverse chain rule (used below) is: \[ \frac{1}{g'(x)} (\int f'(x) \,dx \circ g(x) ) + c \]

Note: all of these can also be worked out through integration by substitution.

\begin{align*} \int \sin 2x \,dx &= - \frac{1}{2} \cos 2x + c \end{align*}

Here \( g(x) = 2x \), \( f'(x) = \sin x \), and \( g'(x) = 2 \).

\begin{align*} \int 3e^{2x + 4} \,dx &= \frac{3}{2} e^{2x+3} + c \end{align*}

Here \( g(x) = 2x+3 \), \( f'(x) = 3e^x \) and \( g'(x) = 2 \).

\begin{align*} \int (1-x)^{\frac{1}{2}} \,dx &= \frac{1}{-1} (\frac{3}{2})^{-1} (1 - x)^{\frac{3}{2}} + c \\

                         &= - \frac{2}{3} (1-x)^{\frac{3}{2}} + c

\end{align*}

Here \( g(x) = 1-x \), \( f'(x) = x^{\frac{1}{2}} \) and \( g'(x) = -1 \).

This final example simply reminds us that linear reverse chain rule only works with linear equations.

\begin{align*} \int e{x2} \,dx \neq \frac{e{x2}}{2x} \end{align*}

Integration by Substitution

This approach has us redefine a problem of integration with respect to \( x \) to integration with respect to \( u \) where \( u \) can be substituted back into \( y \) to make integration with respect to \( x \) simpler.

For example \[ \int x \sin x^2 \]

If we let \( u \) be the inside of the \( \sin \) term, \( u = x^2 \), and differentiate this to get \( \frac{\,du}{\,dx} = 2x \), we can rearrange to get a formula for \( \,dx \) in terms of \( \,du \) and \( x \) \[ \,dx = \frac{\,du}{2x} \] This result can be substituted back into our original equation and then resolved to solve the integration.

\begin{align*} \int x \sin x^2 \,dx &= \int x \sin x^2 \frac{\,du}{\,2x} \\

                &= \int \frac{1}{2} \sin x^2 \\,du \\\\
                &= \frac{1}{2} \int \sin u \\,du \\\\
                &= - \frac{1}{2} \cos u + c \\\\
                &= - \frac{1}{2} \cos x^2 + c

\end{align*}

At the end we re-substitute \( u \) to have a final form using the same variables as our original equation.

Integration by Parts

This final approach has us define our integral as the product of two parts that can be solved independently through theorem eq:int-by-parts.

\begin{align} \int u \frac{\,du}{\,dx} \,dx &= uv - \int v \frac{\,du}{\,dx} \,dx \label{eq:int-by-parts} \end{align}

For example try solving:

\begin{align*} \int x e^x \,dx \label{eq:int-by-parts-example} \end{align*}

First we must define \( u \) and \( \frac{\,dv}{\,dx} \) from eq:int-by-parts-example.

\begin{align*} u &= x, & \frac{\,dv}{\,dx} &= e^x \
\frac{\,du}{\,dx} &= 1, & v &= e^x \
\end{align*}

With this we can substitute back into eq:int-by-parts to get

\begin{align*} \int x e^x \,dx &= x e^x - 1 \times \int e^x \,dx \\

           &= e^x (x-1) + c

\end{align*}

In general the choice of which part should be \( u \) and which should be \( \frac{\,dv}{\,dx} \) depends on the situation. You should try to choose \( u \) so that it is easy to differentiate and choose \( \frac{\,dv}{\,dx} \) so that it's easier to integrate.

Area in a Range

If we integrate \( y \) between some limits (2 x-values) we can find the area between the curve \( y \) and the x-axis. The technical notation for this is \( \int^{x_\text{larger}}_{x_{smaller}} f(x) \,dx \).

\begin{figure}
  \centering
  % Adapted from [[https://tex.stackexchange.com/a/242326][here]].
  \begin{tikzpicture}
    \draw[very thin, gray!30, step=1 cm](-4.9,-0.9) grid (4.9,3.9);

    \fill [gray, domain=-2:2, variable=\x] (-2, 0) -- plot ({\x}, {\x*\x + 1}) -- (2, 0) -- cycle;

    \draw [thick] [->] (-5,0)--(5,0) node[right, below] {$x$};
     \foreach \x in {-4,...,4}
       \draw[xshift=\x cm, thick] (0pt,-1pt)--(0pt,1pt) node[below] {$\x$};

    \draw [thick] [->] (0,-1)--(0,4) node[above, left] {$y$};
     \foreach \y in {-1,...,3}
       \draw[yshift=\y cm, thick] (-1pt,0pt)--(1pt,0pt) node[left] {$\y$};

    \draw [domain=-2:2, variable=\x]
      plot ({\x}, {\x*\x+1}) node[right] at (1.5,2) {$f(x)=x^2+1$};

  \end{tikzpicture}
  \begin{tikzpicture}
    \draw[very thin, gray!30, step=1 cm](-4.9,-0.9) grid (4.9,3.9);

    \fill [gray, domain=-2:2, variable=\x] (-2, 0) -- plot ({\x}, {\x*\x - 1}) -- (2, 0) -- cycle;

    \draw [thick] [->] (-5,0)--(5,0) node[right, below] {$x$};
     \foreach \x in {-4,...,4}
       \draw[xshift=\x cm, thick] (0pt,-1pt)--(0pt,1pt) node[below] {$\x$};

    \draw [thick] [->] (0,-1)--(0,4) node[above, left] {$y$};
     \foreach \y in {-2,...,3}
       \draw[yshift=\y cm, thick] (-1pt,0pt)--(1pt,0pt) node[left] {$\y$};

    \draw [domain=-2:2, variable=\x]
      plot ({\x}, {\x*\x-1}) node[right] at (1.5,2) {$f(x)=x^2-1$};
  \end{tikzpicture}
  \caption{Visualisation of the area of a curve that would be calculated if you
    integrated \( x=-2 \) and \( x=2 \).}
  \label{fig:integration-area}
\end{figure}

For example find the area between the curve \( y = \frac{2}{x^3} + 3x \) and the x-axis between \( x = 2 \) and \( x = 1 \).

\begin{align} \int^2_1 (\frac{2}{x^3} + 3x) \,dx &= \int^2_1 (2x^{-3} + 3x) \,dx \\

                              &= [\frac{2x^{-2}}{-2} + \frac{3x^2}{2}]^2\_1
                                \label{eq:integrated-with-limits} \\\\
                              &= [\frac{-1}{x^2} + \frac{3}{2}x]^2\_1 \\\\
                              &= ( \frac{-1}{2^2} + \frac{3(2^2)}{2} ) - ( \frac{-1}{1^2} + \frac{3(1^2)}{2} )
                                \label{eq:integrated-without-limits}\\\\
                              &= ( \frac{-1}{4} + 6 ) - (\frac{1}{2}) \\\\
                              &= \frac{21}{4} \text{units}^2

\end{align}

In eq:integrated-with-limits we've integrated the graph function, but left the limits we intend to work on to the right. Also note at this stage that we don't consider the constant \( k \) that we would have in a regular derivation. When calculating the area this field isn't relevant. Once we've simplified the bracketed expression we can substitute these indices back into the brackets and find the difference between each expansion to get the total area (as shown in eq:integrated-without-limits).

Parametric Curves

Integration for parametric curves is slightly different from this. Given \( y = f(t), x = g(t) \) then the area of this curve between two points \( t_0 \) and \( t_1 \) is \( \int_{t_0}^{t_1} y \frac{\,dx}{\,dt} \,dt \).

Links to this note