So far, we’ve been interested in finding the derivative f=F′ of a function F. However, sometimes we’re interested in exactly the reverse: finding the function F for which f is its derivative. We refer to F as the antiderivative of f.
Definition 12.1 (Antiderivative) The antiverivative of a function f(x) is a differentiable function F whose derivative is f.
F′=f.
Another way to describe is through the inverse formula. Let DF be the derivative of F. And let DF(x) be the derivative of F evaluated at x. Then the antiderivative is denoted by D−1 (i.e., the inverse derivative). If DF=f, then F=D−1f.
This definition bolsters the main takeaway about integrals and derivatives: They are inverses of each other.
Exercise 12.1 (Antiderivative) Find the antiderivative of the following:
f(x)=x21
f(x)=3e3x
We know from derivatives how to manipulate F to get f. But how do you express the procedure to manipulate f to get F? For that, we need a new symbol, which we will call indefinite integration.
Definition 12.2 (Indefinite Integral) The indefinite integral of f(x) is written
∫f(x)dx
and is equal to the antiderivative of f.
Example 12.1 Draw the function f(x) and its indefinite integral, ∫f(x)dx
f(x)=(x2−4)
Solution. The Indefinite Integral of the function f(x)=(x2−4) can, for example, be F(x)=31x3−4x. But it can also be F(x)=31x3−4x+1, because the constant 1 disappears when taking the derivative.
Some of these functions are plotted in the bottom panel of Figure 12.1 as dotted lines.
Figure 12.1: The Many Indefinite Integrals of a Function
Notice from these examples that while there is only a single derivative for any function, there are multiple antiderivatives: one for any arbitrary constant c. c just shifts the curve up or down on the y-axis. If more information is present about the antiderivative — e.g., that it passes through a particular point — then we can solve for a specific value of c.
Properties of Integration
Some useful properties of integrals follow by virtue of being the inverse of a derivative.
12.1.1 Properties of Integration
Constants are allowed to slip out: ∫af(x)dx=a∫f(x)dx
Integration of the sum is sum of integrations: ∫[f(x)+g(x)]dx=∫f(x)dx+∫g(x)dx
Reverse Power-rule: ∫xndx=n+11xn+1+c
Exponents are still exponents: ∫exdx=ex+c
Recall the derivative of ln(x) is one over x, and so: ∫x1dx=lnx+c
Reverse chain-rule: ∫ef(x)f′(x)dx=ef(x)+c
More generally: ∫[f(x)]nf′(x)dx=n+11[f(x)]n+1+c
Remember the derivative of a log of a function: ∫f(x)f′(x)dx=lnf(x)+c
Example 12.2 (Common Integration) Simplify the following indefinite integrals:
∫3x2dx
∫(2x+1)dx
∫exeexdx
12.2 The Definite Integral
If there is a indefinite integral, there must be a definite integral. Indeed there is, but the notion of definite integrals comes from a different objective: finding the are a under a function. We will find, perhaps remarkably, that the formula we find to get the sum turns out to be expressible by the anti-derivative.
Suppose we want to determine the area A(R) of a region R defined by a curve f(x) and some interval a≤x≤b.
Figure 12.2: The Riemann Integral as a Sum of Evaluations
One way to calculate the area would be to divide the interval a≤x≤b into n subintervals of length Δx and then approximate the region with a series of rectangles, where the base of each rectangle is Δx and the height is f(x) at the midpoint of that interval. A(R) would then be approximated by the area of the union of the rectangles, which is given by S(f,Δx)=i=1∑nf(xi)Δx and is called a Riemann sum.
As we decrease the size of the subintervals Δx, making the rectangles “thinner,” we would expect our approximation of the area of the region to become closer to the true area. This allows us to express the area as a limit of a series:
A(R)=Δx→0limi=1∑nf(xi)Δx
Figure 12.2 shows that illustration. The curve depicted is f(x)=−15(x−5)+(x−5)3+50. We want approximate the area under the curve between the x values of 0 and 10. We can do this in blocks of arbitrary width, where the sum of rectangles (the area of which is width times f(x) evaluated at the midpoint of the bar) shows the Riemann Sum. As the width of the bars Δx becomes smaller, the better the estimate of A(R).
This is how we define the “Definite” Integral:
Definition 12.3 (The Definite Integral (Riemann)) If for a given function f the Riemann sum approaches a limit as Δx→0, then that limit is called the Riemann integral of f from a to b. We express this with the ∫, symbol, and write a∫bf(x)dx=Δx→0limi=1∑nf(xi)Δx
The most straightforward of a definite integral is the definite integral. That is, we read
a∫bf(x)dx as the definite integral of f from a to b and we defined as the area under the “curve” f(x) from point x=a to x=b.
The fundamental theorem of calculus shows us that this sum is, in fact, the antiderivative.
Theorem 12.1 (First Fundamental Theorem of Calculus) Let the function f be bounded on [a,b] and continuous on (a,b). Then, suggestively, use the symbol F(x) to denote the definite integral from a to x
F(x)=a∫xf(t)dt,a≤x≤b
Then F(x) has a derivative at each point in (a,b) and F′(x)=f(x),a<x<b That is, the definite integral function of fis the one of the antiderivatives of some f.
This is again a long way of saying that that differentiation is the inverse of integration. But now, we’ve covered definite integrals.
The second theorem gives us a simple way of computing a definite integral as a function of indefinite integrals.
12.2.1 Second Fundamental Theorem of Calculus
Let the function f be bounded on [a,b] and continuous on (a,b). Let F be any function that is continuous on [a,b] such that F′(x)=f(x) on (a,b). Then a∫bf(x)dx=F(b)−F(a)
So the procedure to calculate a simple definite integral a∫bf(x)dx is then
Find the indefinite integral F(x).
Evaluate F(b)−F(a).
Example 12.3 (Definite Integral of a monomial)
Solve 1∫33x2dx. Let f(x)=3x2.
Exercise 12.2
What is the value of −2∫2exeexdx?
Properties for Definite Integrals
The area-interpretation of the definite integral provides some useful properties for definite integrals
There is no area below a point: a∫af(x)dx=0
Reversing the limits changes the sign of the integral: a∫bf(x)dx=−b∫af(x)dx
Sums can be separated into their own integrals: a∫b[αf(x)+βg(x)]dx=αa∫bf(x)dx+βa∫bg(x)dx
Areas can be combined as long as limits are linked: a∫bf(x)dx+b∫cf(x)dx=a∫cf(x)dx
Exercise 12.3 Simplify the following definite intergrals.
1∫13x2dx=
0∫4(2x+1)dx=
−2∫0exeexdx+0∫2exeexdx=
12.3 Integration by Substitution
From the second fundamental theorem of calculus, we now that a quick way to get a definite integral is to first find the indefinite integral, and then just plug in the bounds.
Sometimes the integrand (the thing that we are trying to take an integral of) doesn’t appear integrable using common rules and antiderivatives. A method one might try is integration by substitution, which is related to the Chain Rule.
Suppose we want to find the indefinite integral ∫g(x)dx but g(x) is complex and none of the formulas we have seen so far seem to apply immediately. The trick is to come up with a new function u(x) such that g(x)=f[u(x)]u′(x).
Why does an introduction of yet another function end of simplifying things? Let’s refer to the antiderivative of f as F. Then the chain rule tells us that dxdF[u(x)]=f[u(x)]u′(x). So, F[u(x)] is the antiderivative of g. We can then write ∫g(x)dx=∫f[u(x)]u′(x)dx=∫dxdF[u(x)]dx=F[u(x)]+c
To summarize, the procedure to determine the indefinite integral ∫g(x)dx by the method of substitution:
Identify some part of g(x) that might be simplified by substituting in a single variable u (which will then be a function of x).
Determine if g(x)dx can be reformulated in terms of u and du.
Solve the indefinite integral.
Substitute back in for x
Substitution can also be used to calculate a definite integral. Using the same procedure as above, a∫bg(x)dx=c∫df(u)du=F(d)−F(c) where c=u(a) and d=u(b).
Example 12.4 (Integration by Substitution I)
Solve the indefinite integral ∫x2x+1dx.
For the above problem, we could have also used the substitution u=x+1. Then x=u2−1 and dx=2udu. Substituting these in, we get ∫x2x+1dx=∫(u2−1)2u2udu which when expanded is again a polynomial and gives the same result as above.
Another case in which integration by substitution is is useful is with a fraction.
Example 12.5 (Integration by Substitutiton II)
Simplify 0∫1(1+e2x)1/35e2xdx.
12.4 Integration by Parts
Another useful integration technique is integration by parts, which is related to the Product Rule of differentiation. The product rule states that dxd(uv)=udxdv+vdxdu Integrating this and rearranging, we get ∫udxdvdx=uv−∫vdxdudx or ∫u(x)v′(x)dx=u(x)v(x)−∫v(x)u′(x)dx
More easily remembered with the mnemonic “Ultraviolet Voodoo”: ∫udv=uv−∫vdu where du=u′(x)dx and dv=v′(x)dx.
For definite integrals, this is simply
a∫budxdvdx=uv∣ab−a∫bvdxdudx
Our goal here is to find expressions for u and dv that, when substituted into the above equation, yield an expression that’s more easily evaluated.
Example 12.6 (Integration by Parts I) Simplify the following integrals. These seemingly obscure forms of integrals come up often when integrating distributions.
∫xeaxdx
Solution. Let u=x and dxdv=eax. Then du=dx and v=(1/a)eax. Substituting this into the integration by parts formula, we obtain ∫xeaxdx=uv−∫vdu=x(a1eax)−∫a1eaxdx=a1xeax−a21eax+c
Solution. The problem here is the x+1 term. However, if the integrand had x times some polynomial, then we’d be in business. Let’s try u=x+1. Then x=u−1 and dx=du. Substituting these into the above equation, we get
We can easily integrate this, since it is just a polynomial. Doing so and substituting u=x+1 back in, we get ∫x2x+1dx=2(x+1)3/2[71(x+1)2−52(x+1)+31]+c
Solution. When an expression is raised to a power, it is often helpful to use this expression as the basis for a substitution. So, let u=1+e2x. Then du=2e2xdx and we can set 5e2xdx=5du/2. Additionally, u=2 when x=0 and u=1+e2 when x=1. Substituting all of this in, we get
Substituting these into the integration by parts formula gives ∫xneaxdx=uv−∫vdu=xn(a1eax)−∫a1eaxnxn−1dx=a1xneax−an∫xn−1eaxdx
Notice that we now have an integral similar to the previous one, but with xn−1 instead of xn.
For a given n, we would repeat the integration by parts procedure until the integrand was directly integratable — e.g., when the integral became ∫eaxdx.
∫x3e−x2dx
We could, as before, choose u=x3 and dv=e−x2dx. But we can’t then find v — i.e., integrating e−x2dx isn’t possible. Instead, notice that dxde−x2=−2xe−x2, which can be factored out of the original integrand ∫x3e−x2dx=∫x2(xe−x2)dx.
We can then let u=x2 and dv=xe−x2dx. Thedu=2xdx and v=−21e−x2. Substituting these in, we have ∫x3e−x2dx=uv−∫vdu=x2(−21e−x2)−∫(−21e−x2)2xdx=−21x2e−x2+∫xe−x2dx=−21x2e−x2−21e−x2+c
Source Code
# Integral Calculus {#integrals}```{r, include = FALSE}library(ggplot2)library(tibble)library(patchwork)library(tidyverse)```<iframewidth="560"height="315"src="https://www.youtube.com/embed/rfG8ce4nNh0"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreenstyle="border:1;display:block;margin:10px auto;"></iframe>## The Indefinite IntegralSo far, we've been interested in finding the derivative $f=F'$ of a function $F$. However, sometimes we're interested in exactly the reverse: finding the function $F$ for which $f$ is its derivative. We refer to $F$ as the antiderivative of $f$.:::{#def-}### AntiderivativeThe antiverivative of a function $f(x)$ is a differentiable function $F$ whose derivative is $f$. $$F^\prime = f.$$:::Another way to describe is through the inverse formula. Let $DF$ be the derivative of $F$. And let $DF(x)$ be the derivative of $F$ evaluated at $x$. Then the antiderivative is denoted by $D^{-1}$ (i.e., the inverse derivative). If $DF=f$, then $F=D^{-1}f$.This definition bolsters the main takeaway about integrals and derivatives: They are inverses of each other. :::{#exr-}### AntiderivativeFind the antiderivative of the following:1. $f(x) = \frac{1}{x^2}$2. $f(x) = 3e^{3x}$:::We know from derivatives how to manipulate $F$ to get $f$. But how do you express the procedure to manipulate $f$ to get $F$? For that, we need a new symbol, which we will call indefinite integration.:::{#def-}### Indefinite IntegralThe indefinite integral of $f(x)$ is written $$\int f(x) dx $$and is equal to the antiderivative of $f$. ::::::{#exm-}Draw the function $f(x)$ and its indefinite integral, $\int\limits f(x) dx$$$f(x) = (x^2-4)$$::::::{.solution}The Indefinite Integral of the function $f(x) = (x^2-4)$ can, for example, be $F(x) = \frac{1}{3}x^3 - 4x.$ But it can also be $F(x) = \frac{1}{3}x^3 - 4x + 1$, because the constant 1 disappears when taking the derivative. :::Some of these functions are plotted in the bottom panel of @fig-integralc as dotted lines.```{r, #fig-integralc, fig.cap="The Many Indefinite Integrals of a Function", echo = FALSE}range1 <-tibble(x =c(-4, 4))fx <-ggplot(range1, aes(x = x)) +stat_function(fun =function(x) x^2-4, size =0.5) +labs(y =expression(f(x)))Fx <-ggplot(range1, aes(x = x)) +stat_function(fun =function(x) (x^3)/3-4*x, size =0.5, linetype ="dashed") +stat_function(fun =function(x) (x^3)/3-4*x +1, size =0.5, linetype ="dotted") +stat_function(fun =function(x) (x^3)/3-4*x -1, size =0.5, linetype ="dotdash") +labs(y =expression(integral(f(x)*dx)))p = fx + Fx +plot_layout(ncol =1)p```Notice from these examples that while there is only a single derivative for any function, there are multiple antiderivatives: one for any arbitrary constant $c$. $c$ just shifts the curve up or down on the $y$-axis. If more information is present about the antiderivative --- e.g., that it passes through a particular point --- then we can solve for a specific value of $c$.### Properties of Integration {-}Some useful properties of integrals follow by virtue of being the inverse of a derivative. :::{#prop-}### Properties of Integration1. Constants are allowed to slip out: $\int a f(x)dx = a\int f(x)dx$1. Integration of the sum is sum of integrations: $\int [f(x)+g(x)]dx=\int f(x)dx + \int g(x)dx$1. Reverse Power-rule: $\int x^n dx = \frac{1}{n+1} x^{n+1} + c$1. Exponents are still exponents: $\int e^x dx = e^x +c$1. Recall the derivative of $\ln(x)$ is one over $x$, and so: $\int \frac{1}{x} dx = \ln x + c$1. Reverse chain-rule: $\int e^{f(x)}f^\prime(x)dx = e^{f(x)}+c$1. More generally: $\int [f(x)]^n f'(x)dx = \frac{1}{n+1}[f(x)]^{n+1}+c$1. Remember the derivative of a log of a function: $\int \frac{f^\prime(x)}{f(x)}dx=\ln f(x) + c$::::::{#exm-}### Common IntegrationSimplify the following indefinite integrals:* $\int 3x^2 dx$* $\int (2x+1)dx$* $\int e^x e^{e^x} dx$:::## The Definite IntegralIf there is a indefinite integral, there _must_ be a definite integral. Indeed there is, but the notion of definite integrals comes from a different objective: finding the are a under a function. We will find, perhaps remarkably, that the formula we find to get the sum turns out to be expressible by the anti-derivative. Suppose we want to determine the area $A(R)$ of a region $R$ defined by a curve $f(x)$ and some interval $a\le x \le b$. ```{r, #fig-defintfig, echo = FALSE, fig.cap="The Riemann Integral as a Sum of Evaluations"}f3 <-function(x) -15*(x -5) + (x -5)^3+50d1 <-tibble(x =seq(0, 10, 1)) %>%mutate(f =f3(x))d2 <-tibble(x =seq(0, 10, 0.1)) %>%mutate(f =f3(x))range <- tibble::tibble(x =c(0, 10))fx0 <-ggplot(range, aes(x = x)) +labs(x =expression(x), y =expression(f(x)))fx <- fx0 +expand_limits(y =0) +scale_y_continuous(expand =c(0, 0)) +scale_x_continuous(expand =c(0, 0))g1 <- fx +geom_col(data = d1, aes(x, f), width =1, fill ="gray", alpha =0.5, color ="black") +stat_function(fun = f3, size =1.5) +labs(title ="Evaluating f with width = 1 intervals")g2 <- fx +geom_col(data = d2, aes(x, f), width =0.1, fill ="gray", alpha =0.5, color ="black") +stat_function(fun = f3, size =1.5) +labs(title ="Evaluating f with width = 0.1 intervals")g1 + g2 +plot_layout(nrow =1)```One way to calculate the area would be to divide the interval $a\le x\le b$ into $n$ subintervals of length $\Delta x$ and then approximate the region with a series of rectangles, where the base of each rectangle is $\Delta x$ and the height is $f(x)$ at the midpoint of that interval. $A(R)$ would then be approximated by the area of the union of the rectangles, which is given by $$S(f,\Delta x)=\sum\limits_{i=1}^n f(x_i)\Delta x$$ and is called a __Riemann sum__.As we decrease the size of the subintervals $\Delta x$, making the rectangles "thinner," we would expect our approximation of the area of the region to become closer to the true area. This allows us to express the area as a limit of a series: $$A(R)=\lim\limits_{\Delta x\to 0}\sum\limits_{i=1}^n f(x_i)\Delta x$$@fig-defintfig shows that illustration. The curve depicted is $f(x) = -15(x - 5) + (x - 5)^3 + 50.$ We want approximate the area under the curve between the $x$ values of 0 and 10. We can do this in blocks of arbitrary width, where the sum of rectangles (the area of which is width times $f(x)$ evaluated at the midpoint of the bar) shows the Riemann Sum. As the width of the bars $\Delta x$ becomes smaller, the better the estimate of $A(R)$. This is how we define the "Definite" Integral::::{#def-}### The Definite Integral (Riemann)If for a given function $f$ the Riemann sum approaches a limit as $\Delta x \to 0$, then that limit is called the Riemann integral of $f$ from $a$ to $b$. We express this with the $\int$, symbol, and write $$\int\limits_a^b f(x) dx= \lim\limits_{\Delta x\to 0} \sum\limits_{i=1}^n f(x_i)\Delta x$$The most straightforward of a definite integral is the definite integral. That is, we read $$\int\limits_a^b f(x) dx$$ as the definite integral of $f$ from $a$ to $b$ and we defined as the area under the "curve" $f(x)$ from point $x=a$ to $x=b$.:::The fundamental theorem of calculus shows us that this sum is, in fact, the antiderivative.:::{#thm-}### First Fundamental Theorem of CalculusLet the function $f$ be bounded on $[a,b]$ and continuous on $(a,b)$. Then, suggestively, use the symbol $F(x)$ to denote the definite integral from $a$ to $x$$$F(x)=\int\limits_a^x f(t)dt, \quad a\le x\le b$$ Then $F(x)$ has a derivative at each point in $(a,b)$ and $$F^\prime(x)=f(x), \quad a<x<b$$That is, the definite integral function of $f$ _is_ the one of the antiderivatives of some $f$.:::This is again a long way of saying that that differentiation is the inverse of integration. But now, we've covered definite integrals.The second theorem gives us a simple way of computing a definite integral as a function of indefinite integrals. :::{#thm}### Second Fundamental Theorem of CalculusLet the function $f$ be bounded on $[a,b]$ and continuous on $(a,b)$. Let $F$ be any function that is continuous on $[a,b]$ such that $F^\prime(x)=f(x)$ on $(a,b)$. Then $$\int\limits_a^bf(x)dx = F(b)-F(a)$$:::So the procedure to calculate a simple definite integral $\int\limits_a^b f(x)dx$ is then1. Find the indefinite integral $F(x)$.2. Evaluate $F(b)-F(a)$.:::{#exm-defintmon}### Definite Integral of a monomialSolve $\int\limits_1^3 3x^2 dx.$Let $f(x) = 3x^2$. ::::::{#exr-}What is the value of $\int\limits_{-2}^2 e^x e^{e^x} dx$?:::### Properties for Definite Integrals {-}The area-interpretation of the definite integral provides some useful properties for definite integrals:::{#prop-}1. There is no area below a point: $$\int\limits_a^a f(x)dx=0$$2. Reversing the limits changes the sign of the integral: $$\int\limits_a^b f(x)dx=-\int\limits_b^a f(x)dx$$3. Sums can be separated into their own integrals: $$\int\limits_a^b [\alpha f(x)+\beta g(x)]dx = \alpha \int\limits_a^b f(x)dx + \beta \int\limits_a^b g(x)dx$$4. Areas can be combined as long as limits are linked: $$\int\limits_a^b f(x) dx +\int\limits_b^c f(x)dx = \int\limits_a^c f(x)dx$$::::::{#exr-}Simplify the following definite intergrals.1. $\int\limits_1^1 3x^2 dx =$ 2. $\int\limits_0^4 (2x+1)dx=$ 3. $\int\limits_{-2}^0 e^x e^{e^x} dx + \int\limits_0^2 e^x e^{e^x} dx =$:::## Integration by SubstitutionFrom the second fundamental theorem of calculus, we now that a quick way to get a definite integral is to first find the indefinite integral, and then just plug in the bounds. Sometimes the integrand (the thing that we are trying to take an integral of) doesn't appear integrable using common rules and antiderivatives. A method one might try is __integration by substitution__, which is related to the Chain Rule.Suppose we want to find the indefinite integral $$\int g(x)dx$$ but $g(x)$ is complex and none of the formulas we have seen so far seem to apply immediately. The trick is to come up with a _new_ function $u(x)$ such that $$g(x)=f[u(x)]u'(x).$$ Why does an introduction of yet another function end of simplifying things? Let's refer to the antiderivative of $f$ as $F$. Then the chain rule tells us that $$\frac{d}{dx} F[u(x)]=f[u(x)]u'(x)$$. So, $F[u(x)]$ is the antiderivative of $g$. We can then write $$\int g(x) dx= \int f[u(x)]u'(x)dx = \int \frac{d}{dx} F[u(x)]dx = F[u(x)]+c$$To summarize, the procedure to determine the indefinite integral $\int g(x)dx$ by the method of substitution:1. Identify some part of $g(x)$ that might be simplified by substituting in a single variable $u$ (which will then be a function of $x$).2. Determine if $g(x)dx$ can be reformulated in terms of $u$ and $du$.3. Solve the indefinite integral.4. Substitute back in for $x$Substitution can also be used to calculate a definite integral. Using the same procedure as above, $$\int\limits_a^b g(x)dx=\int\limits_c^d f(u)du = F(d)-F(c)$$where $c=u(a)$ and $d=u(b)$.:::{#exm-intsub1}### Integration by Substitution ISolve the indefinite integral $$\int x^2 \sqrt{x+1}dx.$$:::For the above problem, we could have also used the substitution $u=\sqrt{x+1}$. Then $x=u^2-1$ and $dx=2u du$. Substituting these in, we get $$\int x^2\sqrt{x+1}dx=\int (u^2-1)^2 u 2u du$$ which when expanded is again a polynomial and gives the same result as above.Another case in which integration by substitution is is useful is with a fraction.:::{#exm-intsub2}### Integration by Substitutiton IISimplify $$\int\limits_0^1 \frac{5e^{2x}}{(1+e^{2x})^{1/3}}dx.$$:::## Integration by PartsAnother useful integration technique is __integration by parts__, which is related to the Product Rule of differentiation. The product rule states that $$\frac{d}{dx}(uv)=u\frac{dv}{dx}+v\frac{du}{dx}$$ Integrating this and rearranging, we get $$\int u\frac{dv}{dx}dx= u v - \int v \frac{du}{dx}dx$$ or $$\int u(x) v'(x)dx=u(x)v(x) - \int v(x)u'(x)dx$$More easily remembered with the mnemonic "Ultraviolet Voodoo": $$\int u dv = u v - \int v du$$ where $du=u'(x)dx$ and $dv=v'(x)dx$.For definite integrals, this is simply$$\int\limits_a^b u\frac{dv}{dx}dx = \left. u v \right|_a^b - \int\limits_a^b v \frac{du}{dx}dx$$Our goal here is to find expressions for $u$ and $dv$ that, when substituted into the above equation, yield an expression that's more easily evaluated.:::{#exm-}### Integration by Parts ISimplify the following integrals. These seemingly obscure forms of integrals come up often when integrating distributions.$$\int x e^{ax} dx$$::::::{.solution}Let $u=x$ and $\frac{dv}{dx} = e^{ax}$. Then $du=dx$ and $v=(1/a)e^{ax}$. Substituting this into the integration by parts formula, we obtain \begin{align*}\int x e^{ax} dx &= u v - \int v du\nonumber\\ &=x\left( \frac{1}{a}e^{ax}\right) -\int\frac{1}{a}e^{ax}dx\nonumber\\ &=\frac{1}{a}xe^{ax}-\frac{1}{a^2}e^{ax}+c\nonumber\end{align*}::::::{#exr-intparts-adv}### Integration by Parts II1. Integrate$$\int x^n e^{ax} dx$$2. Integrate $$\int x^3 e^{-x^2} dx$$:::## Answers to Examples and Exercises {-}@exr-introderivatives*Solution.*1. $f^\prime(x)= 0$2. $f^\prime(x)= 1$3. $f^\prime(x)= 2x^3$4. $f\prime(x)= 3x^2$5. $f\prime(x)= -2x^{-3}$6. $f\prime(x)= 14x^6$7. $f\prime(x) = 4x^3 - 3x^2 + 2x -1$8. $f\prime(x) = 5x^4 + 3x^2 - 2x$9. $f\prime(x) = 6x + \frac{2}{3}x^{\frac{-2}{3}}$10. $f\prime(x)= \frac{-4x}{x^4 - 2x^2 + 1}$@exm-tothesix:::{.solution}For convenience, define $f(z) = z^6$ and $z = g(x) = 3x^2+5x-7$. Then, $y=f[g(x)]$ and\begin{align*}\frac{d}{dx}y&= f^\prime(z) g^\prime(x) \\&= 6(3x^2+5x-7)^5 (6x + 5)\end{align*}:::@exm-exmderivexp*Solution.*1. Let $u(x)=-3x$. Then $u^\prime(x)=-3$ and $f^\prime(x)=-3e^{-3x}$. 2. Let $u(x)=x^2$. Then $u^\prime(x)=2x$ and $f^\prime(x)=2xe^{x^2}$.@exm-exmderivlog*Solution.*1. Let $u(x)=x^2+9$. Then $u^\prime(x)=2x$ and $$\frac{dy}{dx}= \frac{u^\prime(x)}{u(x)} = \frac{2x}{(x^2+9)}$$2. Let $u(x)=\ln x$. Then $u^\prime(x)=1/x$ and $\frac{dy}{dx} = \frac{1}{(x\ln x)}$.3. Use the generalized power rule. $$\frac{dy}{dx} = \frac{(2 \ln x)}{x}$$4. We know that $\ln e^x=x$ and that $dx/dx=1$, but we can double check. Let $u(x)=e^x$. Then $u^\prime(x)=e^x$ and $\frac{dy}{dx} = \frac{u^\prime(x)}{u(x)} = \frac{e^x}{e^x} = 1.$@exm-defintmon:::{.solution}What is $F(x)$? From the power rule, recognize $\frac{d}{dx}x^3 = 3x^2$ so \begin{align*}F(x) &= x^3\\\int\limits_1^3 f(x) dx &= F(x = 3) - F(x - 1)\\&= 3^3 - 1^3\\&=26\end{align*}:::@exm-intsub1:::{.solution}The problem here is the $\sqrt{x+1}$ term. However, if the integrand had $\sqrt{x}$ times some polynomial, then we'd be in business. Let's try $u=x+1$. Then $x=u-1$ and $dx=du$. Substituting these into the above equation, we get \begin{align*} \int x^2\sqrt{x+1}dx&= \int (u-1)^2\sqrt{u}du\\ &= \int (u^2-2u+1)u^{1/2}du\\ &= \int (u^{5/2}-2u^{3/2}+u^{1/2})du\end{align*}We can easily integrate this, since it is just a polynomial. Doing so and substituting $u=x+1$ back in, we get $$\int x^2\sqrt{x+1}dx=2(x+1)^{3/2}\left[\frac{1}{7}(x+1)^2 -\frac{2}{5}(x+1)+\frac{1}{3}\right]+c$$:::@exm-intsub2:::{.solution}When an expression is raised to a power, it is often helpful to use this expression as the basis for a substitution. So, let $u=1+e^{2x}$. Then $du=2e^{2x}dx$ and we can set $5e^{2x}dx=5du/2$. Additionally, $u=2$ when $x=0$ and $u=1+e^2$ when $x=1$. Substituting all of this in, we get\begin{align*}\int\limits_0^1 \frac{5e^{2x}}{(1+e^{2x})^{1/3}}dx &= \frac{5}{2}\int\limits_2^{1+e^2}\frac{du}{u^{1/3}}\\ &= \frac{5}{2}\int\limits_2^{1+e^2} u^{-1/3}du\\ &= \left. \frac{15}{4} u^{2/3} \right|_2^{1+e^2}\\ &= 9.53\end{align*}:::@exr-intparts-adv*Solution.*1. $$\int x^n e^{ax} dx$$As in the first problem, let $$u=x^n, dv=e^{ax}dx$$Then $du=n x^{n-1}dx$ and $v=(1/a)e^{ax}$.Substituting these into the integration by parts formula gives\begin{align*} \int x^n e^{ax} dx &= u v - \int v du\nonumber\\ &=x^n\left( \frac{1}{a}e^{ax}\right) - \int\frac{1}{a}e^{ax} n x^{n-1} dx\nonumber\\ &=\frac{1}{a}x^n e^{ax} - \frac{n}{a}\int x^{n-1}e^{ax}dx\nonumber\end{align*} Notice that we now have an integral similar to the previous one, but with $x^{n-1}$ instead of $x^n$. For a given $n$, we would repeat the integration by parts procedure until the integrand was directly integratable --- e.g., when the integral became $\int e^{ax}dx$.2. $$\int x^3 e^{-x^2} dx$$We could, as before, choose $u=x^3$ and $dv=e^{-x^2}dx$. But we can't then find $v$ --- i.e., integrating $e^{-x^2}dx$ isn't possible. Instead, notice that $$\frac{d}{dx}e^{-x^2} = -2xe^{-x^2},$$ which can be factored out of the original integrand $$\int x^3 e^{-x^2} dx = \int x^2 (xe^{-x^2})dx.$$ We can then let $u=x^2$ and $dv=x e^{-x^2}dx$. The$du=2x dx$ and $v=-\frac{1}{2}e^{-x^2}$. Substituting these in, we have\begin{align*} \int x^3 e^{-x^2} dx &= u v - \int v du\nonumber\\ &= x^2 \left( -\frac{1}{2}e^{-x^2}\right) -\int \left(-\frac{1}{2}e^{-x^2}\right)2x dx\nonumber\\ &= -\frac{1}{2}x^2 e^{-x^2}+\int x e^{-x^2}dx\nonumber\\ &= -\frac{1}{2}x^2 e^{-x^2}-\frac{1}{2}e^{-x^2}+c\nonumber\end{align*}