# Calculus/Indefinite integral

 ← Fundamental Theorem of Calculus Calculus Improper Integrals → Indefinite integral

## Definition

Now recall that ${\displaystyle F}$  is said to be an antiderivative of f if ${\displaystyle F'(x)=f(x)}$  . However, ${\displaystyle F}$  is not the only antiderivative. We can add any constant to ${\displaystyle F}$  without changing the derivative. With this, we define the indefinite integral as follows:

${\displaystyle \int f(x)dx=F(x)+C}$  where ${\displaystyle F}$  satisfies ${\displaystyle F'(x)=f(x)}$  and ${\displaystyle C}$  is any constant.

The function ${\displaystyle f(x)}$  , the function being integrated, is known as the integrand. Note that the indefinite integral yields a family of functions.

Example

Since the derivative of ${\displaystyle x^{4}}$  is ${\displaystyle 4x^{3}}$ , the general antiderivative of ${\displaystyle 4x^{3}}$  is ${\displaystyle x^{4}}$  plus a constant. Thus,

${\displaystyle \int 4x^{3}dx=x^{4}+C}$

Example: Finding antiderivatives

Let's take a look at ${\displaystyle 6x^{2}}$  . How would we go about finding the integral of this function? Recall the rule from differentiation that

${\displaystyle {\frac {d}{dx}}x^{n}=nx^{n-1}}$

In our circumstance, we have:

${\displaystyle {\frac {d}{dx}}x^{3}=3x^{2}}$

This is a start! We now know that the function we seek will have a power of 3 in it. How would we get the constant of 6? Well,

${\displaystyle 2{\frac {d}{dx}}x^{3}=2\times 3x^{2}=6x^{2}}$

Thus, we say that ${\displaystyle 2x^{3}}$  is an antiderivative of ${\displaystyle 6x^{2}}$  .

### Exercises

1. Evaluate ${\displaystyle \int {\frac {3x}{2}}dx}$

${\displaystyle {\frac {3}{4}}x^{2}+C}$

2. Find the general antiderivative of the function ${\displaystyle f(x)=2x^{4}}$

${\displaystyle {\frac {2x^{5}}{5}}+C}$

## Indefinite integral identities

### Basic Properties of Indefinite Integrals

Constant Rule for indefinite integrals

If ${\displaystyle c}$  is a constant then ${\displaystyle \int c\cdot f(x)dx=c\int f(x)dx}$

Sum/Difference Rule for indefinite integrals

${\displaystyle \int {\Big (}f(x)+g(x){\Big )}dx=\int f(x)dx+\int g(x)dx}$
${\displaystyle \int {\Big (}f(x)-g(x){\Big )}dx=\int f(x)dx-\int g(x)dx}$

### Indefinite integrals of Polynomials

Say we are given a function of the form, ${\displaystyle f(x)=x^{n}}$  , and would like to determine the antiderivative of ${\displaystyle f}$  . Considering that

${\displaystyle {\frac {d}{dx}}{\frac {1}{n+1}}x^{n+1}=x^{n}}$

we have the following rule for indefinite integrals:

Power rule for indefinite integrals

${\displaystyle \int x^{n}dx={\frac {x^{n+1}}{n+1}}+C}$  for all ${\displaystyle n\neq -1}$

### Integral of the Inverse function

To integrate ${\displaystyle f(x)={\frac {1}{x}}}$  , we should first remember

${\displaystyle {\frac {d}{dx}}\ln(x)={\frac {1}{x}}}$

Therefore, since ${\displaystyle {\frac {1}{x}}}$  is the derivative of ${\displaystyle \ln(x)}$  we can conclude that

${\displaystyle \int {\frac {dx}{x}}=\ln |x|+C}$

Note that the polynomial integration rule does not apply when the exponent is ${\displaystyle -1}$  . This technique of integration must be used instead. Since the argument of the natural logarithm function must be positive (on the real line), the absolute value signs are added around its argument to ensure that the argument is positive.

### Integral of the Exponential function

Since

${\displaystyle {\frac {d}{dx}}e^{x}=e^{x}}$

we see that ${\displaystyle e^{x}}$  is its own antiderivative. This allows us to find the integral of an exponential function:

${\displaystyle \int e^{x}dx=e^{x}+C}$

### Integral of Sine and Cosine

Recall that

${\displaystyle {\frac {d}{dx}}\sin(x)=\cos(x)}$
${\displaystyle {\frac {d}{dx}}\cos(x)=-\sin(x)}$

So ${\displaystyle \sin(x)}$  is an antiderivative of ${\displaystyle \cos(x)}$  and ${\displaystyle -\cos(x)}$  is an antiderivative of ${\displaystyle \sin(x)}$  . Hence we get the following rules for integrating ${\displaystyle \sin(x)}$  and ${\displaystyle \cos(x)}$

${\displaystyle \int \cos(x)dx=\sin(x)+C}$
${\displaystyle \int \sin(x)dx=-\cos(x)+C}$

We will find how to integrate more complicated trigonometric functions in the chapter on integration techniques.

Example

Suppose we want to integrate the function ${\displaystyle f(x)=x^{4}+1+2\sin(x)}$  . An application of the sum rule from above allows us to use the power rule and our rule for integrating ${\displaystyle \sin(x)}$  as follows,

 ${\displaystyle \int f(x)dx}$ ${\displaystyle =\int {\Big (}x^{4}+1+2\sin(x){\Big )}dx}$ ${\displaystyle =\int x^{4}dx+\int 1\,dx+\int 2\sin(x)dx}$ ${\displaystyle ={\frac {x^{5}}{5}}+x-2\cos(x)+C}$  .

### Exercises

3. Evaluate ${\displaystyle \int (7x^{2}+3\cos(x)-e^{x})dx}$

${\displaystyle {\frac {7x^{3}}{3}}+3\sin(x)-e^{x}+C}$

4. Evaluate ${\displaystyle \int {\Big (}{\tfrac {2}{5x}}+\sin(x){\Big )}dx}$

${\displaystyle {\tfrac {2}{5}}\ln |x|-\cos(x)+C}$

## The Substitution Rule

The substitution rule is a valuable asset in the toolbox of any integration greasemonkey. It is essentially the chain rule (a differentiation technique you should be familiar with) in reverse. First, let's take a look at an example:

### Preliminary Example

Suppose we want to find ${\displaystyle \int x\cos(x^{2})dx}$  . That is, we want to find a function such that its derivative equals ${\displaystyle x\cos(x^{2})}$  . Stated yet another way, we want to find an antiderivative of ${\displaystyle f(x)=x\cos(x^{2})}$  . Since ${\displaystyle \sin(x)}$  differentiates to ${\displaystyle \cos(x)}$  , as a first guess we might try the function ${\displaystyle \sin(x^{2})}$  . But by the Chain Rule,

${\displaystyle {\frac {d}{dx}}\sin(x^{2})=\cos(x^{2})\cdot {\frac {d}{dx}}x^{2}=\cos(x^{2})\cdot 2x=2x\cos(x^{2})}$

Which is almost what we want apart from the fact that there is an extra factor of 2 in front. But this is easily dealt with because we can divide by a constant (in this case 2). So,

${\displaystyle {\frac {d}{dx}}{\frac {\sin(x^{2})}{2}}={\frac {1}{2}}\cdot {\frac {d}{dx}}\sin(x^{2})={\frac {1}{2}}\cdot 2\cos(x^{2})x=x\cos(x^{2})=f(x)}$

Thus, we have discovered a function, ${\displaystyle F(x)={\frac {\sin(x^{2})}{2}}}$ , whose derivative is ${\displaystyle x\cos(x^{2})}$  . That is, ${\displaystyle F}$  is an antiderivative of ${\displaystyle f(x)=x\cos(x^{2})}$  . This gives us

${\displaystyle \int x\cos(x^{2})dx={\frac {\sin(x^{2})}{2}}+C}$

### Generalization

In fact, this technique will work for more general integrands. Suppose ${\displaystyle u}$  is a differentiable function. Then to evaluate ${\displaystyle \int u'(x)\cos {\bigl (}u(x){\bigr )}dx}$  we just have to notice that by the Chain Rule

${\displaystyle {\frac {d}{dx}}\sin {\bigl (}u(x){\bigr )}=\cos {\bigl (}u(x){\bigr )}{\frac {du}{dx}}=u'(x)\cos {\bigl (}u(x){\bigr )}}$

As long as ${\displaystyle u'}$  is continuous we have that

${\displaystyle \int \cos {\bigl (}u(x){\bigr )}u'(x)dx=\sin {\bigl (}u(x){\bigr )}+C}$

Now the right hand side of this equation is just the integral of ${\displaystyle \cos(u)}$  but with respect to ${\displaystyle u}$  . If we write ${\displaystyle u}$  instead of ${\displaystyle u(x)}$  this becomes ${\displaystyle \int \cos(u(x))u'(x)dx=\sin(u)+C=\int \cos(u)du}$

So, for instance, if ${\displaystyle u(x)=x^{3}}$  we have worked out that

${\displaystyle \int {\bigl (}\cos(x^{3})\cdot 3x^{2}{\bigr )}dx=\sin(x^{3})+C}$

### General Substitution Rule

Now there was nothing special about using the cosine function in the discussion above, and it could be replaced by any other function. Doing this gives us the substitution rule for indefinite integrals:

Substitution rule for indefinite integrals
Assume ${\displaystyle u}$  is differentiable with continuous derivative and that ${\displaystyle f}$  is continuous on the range of ${\displaystyle u}$  . Then

${\displaystyle \int f{\bigl (}u(x){\bigr )}{\frac {du}{dx}}dx=\int f(u)du}$

Notice that it looks like you can "cancel" in the expression ${\displaystyle {\frac {du}{dx}}dx}$  to leave just a ${\displaystyle du}$  . This does not really make any sense because ${\displaystyle {\frac {du}{dx}}}$  is not a fraction. But it's a good way to remember the substitution rule.

### Examples

The following example shows how powerful a technique substitution can be. At first glance the following integral seems intractable, but after a little simplification, it's possible to tackle using substitution.

Example

We will show that

${\displaystyle \int {\frac {dx}{(x^{2}+a^{2}){\sqrt {x^{2}+a^{2}}}}}={\frac {x}{a^{2}{\sqrt {x^{2}+a^{2}}}}}+C}$

First, we re-write the integral:

 ${\displaystyle \int {\frac {dx}{(x^{2}+a^{2}){\sqrt {x^{2}+a^{2}}}}}}$ ${\displaystyle =\int (x^{2}+a^{2})^{-{\frac {3}{2}}}dx}$ ${\displaystyle =\int \left(x^{2}\left(1+{\tfrac {a^{2}}{x^{2}}}\right)\right)^{-{\frac {3}{2}}}dx}$ ${\displaystyle =\int x^{-3}\left(1+{\tfrac {a^{2}}{x^{2}}}\right)^{-{\frac {3}{2}}}dx}$ ${\displaystyle =\int \left(1+{\tfrac {a^{2}}{x^{2}}}\right)^{-{\frac {3}{2}}}\left(x^{-3}dx\right)}$

Now we perform the following substitution:

${\displaystyle u=1+{\frac {a^{2}}{x^{2}}}}$
${\displaystyle {\frac {du}{dx}}=-2a^{2}x^{-3}\ \implies \ x^{-3}dx=-{\frac {du}{2a^{2}}}}$

Which yields:

${\displaystyle \int \left(1+{\tfrac {a^{2}}{x^{2}}}\right)^{-{\frac {3}{2}}}\left(x^{-3}dx\right)=}$
${\displaystyle =\int u^{-{\frac {3}{2}}}\left(-{\frac {du}{2a^{2}}}\right)}$
${\displaystyle =-{\frac {1}{2a^{2}}}\int u^{-{\frac {3}{2}}}du}$
${\displaystyle =-{\frac {1}{2a^{2}}}\left(-{\frac {2}{\sqrt {u}}}\right)+C}$
${\displaystyle ={\frac {1}{a^{2}{\sqrt {1+{\frac {a^{2}}{x^{2}}}}}}}+C}$
${\displaystyle =\left({\frac {x}{x}}\right){\frac {1}{a^{2}{\sqrt {1+{\frac {a^{2}}{x^{2}}}}}}}+C}$
${\displaystyle ={\frac {x}{a^{2}{\sqrt {x^{2}+a^{2}}}}}+C}$

### Exercises

5. Evaluate ${\displaystyle \int x\sin(2x^{2})dx}$  by making the substitution ${\displaystyle u=2x^{2}}$

${\displaystyle -{\frac {\cos(2x^{2})}{4}}+C}$

6. Evaluate ${\displaystyle \int -3\cos(x)e^{\sin(x)}dx}$

${\displaystyle -3e^{\sin(x)}+C}$

## Integration by Parts

Integration by parts is another powerful tool for integration. It was mentioned above that one could consider integration by substitution as an application of the chain rule in reverse. In a similar manner, one may consider integration by parts as the product rule in reverse.

### General Integration by Parts

Integration by parts for indefinite integrals
Suppose ${\displaystyle f}$  and ${\displaystyle g}$  are differentiable and their derivatives are continuous. Then

${\displaystyle \int f(x)g(x)dx=f(x)\int g(x)dx-\int \left(f'(x)\int g(x)dx\right)dx}$

it is also very important to notice that
${\displaystyle \int f(x)g(x)dx=f(x)\int g(x)dx-\int \left(f'(x)\int g(x)dx\right)dx}$

is not equal to
${\displaystyle \int f(x)g(x)dx=g(x)\int f(x)dx-\int \left(g'(x)\int f(x)dx\right)dx}$

to set the ${\displaystyle f(x)}$  and ${\displaystyle g(x)}$  we need to follow the rule called I.L.A.T.E.

ILATE defines the order in which we must set the ${\displaystyle f(x)}$

• I for inverse trigonometric function
• L for log functions
• A for algebraic functions
• T for trigonometric functions
• E for exponential function

f(x) and g(x) must be in the order of ILATE or else your final answers will not match with the main key

### Examples

Example

Find ${\displaystyle \int x\cos(x)dx}$

Here we let:

${\displaystyle u=x}$  , so that ${\displaystyle du=dx}$  ,
${\displaystyle dv=\cos(x)dx}$  , so that ${\displaystyle v=\sin(x)}$  .

Then:

 ${\displaystyle \int x\cos(x)dx}$ ${\displaystyle =\int u\,dv}$ ${\displaystyle =uv-\int v\,du}$ ${\displaystyle =x\sin(x)-\int \sin(x)dx}$ ${\displaystyle =x\sin(x)+\cos(x)+C}$

Example

Find ${\displaystyle \int x^{2}e^{x}dx}$

In this example we will have to use integration by parts twice.

Here we let

${\displaystyle u=x^{2}}$  , so that ${\displaystyle du=2xdx}$  ,
${\displaystyle dv=e^{x}dx}$  , so that ${\displaystyle v=e^{x}}$  .

Then:

 ${\displaystyle \int x^{2}e^{x}dx}$ ${\displaystyle =\int u\,dv}$ ${\displaystyle =uv-\int v\,du}$ ${\displaystyle =x^{2}e^{x}-\int 2xe^{x}dx}$ ${\displaystyle =x^{2}e^{x}-2\int xe^{x}dx}$

Now to calculate the last integral we use integration by parts again. Let

${\displaystyle u=x}$  , so that ${\displaystyle du=dx}$  ,
${\displaystyle dv=e^{x}dx}$  , so that ${\displaystyle v=e^{x}}$

and integrating by parts gives

${\displaystyle \int xe^{x}dx=xe^{x}-\int e^{x}dx=e^{x}(x-1)}$

So, finally we obtain

${\displaystyle \int x^{2}e^{x}dx=x^{2}e^{x}-2e^{x}(x-1)+C=e^{x}(x^{2}-2x+2)+C}$

Example

Find ${\displaystyle \int \ln(x)dx}$

The trick here is to write this integral as

${\displaystyle \int \ln(x)\cdot 1\,dx}$

Now let

${\displaystyle u=\ln(x)}$  so ${\displaystyle du={\frac {dx}{x}}}$  ,
${\displaystyle v=x}$  so ${\displaystyle dv=1\,dx}$  .

Then using integration by parts,

 ${\displaystyle \int \ln(x)dx}$ ${\displaystyle =x\ln(x)-\int {\frac {x}{x}}dx}$ ${\displaystyle =x\ln(x)-\int 1\,dx}$ ${\displaystyle =x\ln(x)-x+C}$ ${\displaystyle =x{\bigl (}\ln(x)-1{\bigr )}+C}$

Example

Find ${\displaystyle \int \arctan(x)dx}$

Again the trick here is to write the integrand as ${\displaystyle \arctan(x)=\arctan(x)\cdot 1}$  . Then let

${\displaystyle u=\arctan(x)}$  so ${\displaystyle du={\frac {dx}{1+x^{2}}}}$
${\displaystyle v=x}$  so ${\displaystyle dv=1\,dx}$

so using integration by parts,

 ${\displaystyle \int \arctan(x)dx}$ ${\displaystyle =x\arctan(x)-\int {\frac {x}{1+x^{2}}}dx}$ ${\displaystyle =x\arctan(x)-{\tfrac {1}{2}}\ln(1+x^{2})+C}$

Example

Find ${\displaystyle \int e^{x}\cos(x)dx}$

This example uses integration by parts twice. First let,

${\displaystyle u=e^{x}}$  so ${\displaystyle du=e^{x}dx}$
${\displaystyle dv=\cos(x)dx}$  so ${\displaystyle v=\sin(x)}$

so

${\displaystyle \int e^{x}\cos(x)dx=e^{x}\sin(x)-\int e^{x}\sin(x)dx}$

Now, to evaluate the remaining integral, we use integration by parts again, with

${\displaystyle u=e^{x}}$  so ${\displaystyle du=e^{x}dx}$
${\displaystyle v=-\cos(x)}$  so ${\displaystyle dv=\sin(x)dx}$

Then

 ${\displaystyle \int e^{x}\sin(x)dx}$ ${\displaystyle =-e^{x}\cos(x)-\int -e^{x}\cos(x)dx}$ ${\displaystyle =-e^{x}\cos(x)+\int e^{x}\cos(x)dx}$

Putting these together, we have

${\displaystyle \int e^{x}\cos(x)dx=e^{x}\sin(x)+e^{x}\cos(x)-\int e^{x}\cos(x)dx}$

Notice that the same integral shows up on both sides of this equation, but with opposite signs. The integral does not cancel; it doubles when we add the integral to both sides to get

${\displaystyle 2\int e^{x}\cos(x)dx=e^{x}{\bigl (}\sin(x)+\cos(x){\bigr )}}$
${\displaystyle \int e^{x}\cos(x)dx={\frac {e^{x}{\bigl (}\sin(x)+\cos(x){\bigr )}}{2}}}$

### Exercises

7. Evaluate ${\displaystyle \int {\frac {2x-5}{x^{3}}}dx}$  using integration by parts with ${\displaystyle u=2x-5}$  and ${\displaystyle dv={\frac {dx}{x^{3}}}}$

${\displaystyle {\frac {5-4x}{2x^{2}}}+C}$

8. Evaluate ${\displaystyle \int (2x-1)e^{-3x+1}dx}$

${\displaystyle {\frac {(1-6x)e^{1-3x}}{9}}+C}$

 ← Fundamental Theorem of Calculus Calculus Improper Integrals → Indefinite integral