# Integration by parts: $\int e^{-\theta}\cos7\theta \;d\theta$

$$\int e^{-\theta}\cos7\theta \;d\theta$$ I started off by using $u=\cos 7\theta$ and$\;dv=e^{-\theta}d\theta$, however, this just led me in a circle.

I am now at: $$u=e^{-\theta},\;dv=\cos 7\theta \,d\theta$$ $$du=-e^{-\theta} d\theta, v=\frac17\sin 7\theta$$ $$uv-\int v\,du \Rightarrow \bigg(e^{-\theta}\bigg)\bigg(\frac17\sin 7\theta\bigg) - \int\bigg(\frac17\sin\;7\theta\bigg)\bigg(-e^{-\theta}\bigg)d\theta$$ $$\bigg(e^{-\theta}\bigg)\bigg(\frac17\sin 7\theta\bigg) - \frac17\int\bigg(\sin\;7\theta\bigg)\bigg(-e^{-\theta}\bigg)d\theta$$

and then I did:

$$u=-e^{-\theta},\;dv=\sin 7\theta\;d\theta$$ $$du=e^{-\theta},\;v=-\frac17\cos 7\theta$$

to get: $$(-e^{-\theta})(-\frac17\cos 7\theta)-\int (-\frac17\cos 7\theta)(e^{-\theta})d\theta$$

I would assume (if I'm doing this right) that the next step would be to substitute as so: $$\bigg(e^{-\theta}\bigg)\bigg(\frac17\sin 7\theta\bigg) - \bigg[(-e^{-\theta})(-\frac17\cos 7\theta)-\int (-\frac17\cos 7\theta)(e^{-\theta})d\theta\bigg]$$

which would be:

$$\frac17e^{-\theta}\bigg[ \bigg(\sin 7\theta\bigg) -\bigg(\cos 7\theta\bigg) -\bigg(\frac17\sin7\theta + C\bigg)\bigg]+C$$

I'm (almost) certain that this is incorrect, so could someone point me in the right direction and maybe explain some of my errors?

• Using the fact that $\cos x = \mathrm{Re} \, (e^{ix})$ would be more efficient than integration by parts. Commented Sep 22, 2014 at 2:07
• I have never heard of such method. I am learning integration by parts, thus, the work for this type of integration will be required of me. Commented Sep 22, 2014 at 2:10
• @Jessica : It appears that you manually inserted spacing between "$\cos$" and "$7\theta$" in every instance. If you write \cos rather than cos, then not only is it not italicized, but proper spacing in expressions like $5\cos7\theta$ is automatic. That is standard usage. Commented Sep 22, 2014 at 2:17
• Doing integration by parts and then returning to the starting point is the standard thing in this problem and some others. You have $\displaystyle\int \text{blah} = \text{whatever}-6\int\text{blah}$. Then you add $\displaystyle 6\int \text{blah}$ to both sides and get $\displaystyle7\int\text{blah}= \text{whatever}+C$. Then divide both sides by (in this example) $7$. ${}\qquad{}$ Commented Sep 22, 2014 at 2:20
• @MichaelHardy: The \trigfuction advice is great. I will use that from now on, thanks! Commented Sep 22, 2014 at 4:01

## 3 Answers

Hint: You are supposed to go in a circle!

Integrating by parts once gives:

\begin{align} \int e^{-\theta}\cos{7\theta}\,\mathrm{d}\theta &=e^{-\theta}\cos{7\theta}-\int e^{-\theta}\left(-7\sin{7\theta}\right)\,\mathrm{d}\theta\\ &=e^{-\theta}\cos{7\theta}+7\int e^{-\theta}\sin{7\theta}\,\mathrm{d}\theta\\ \end{align}

Integrating by parts again:

\begin{align} \int e^{-\theta}\sin{7\theta}\,\mathrm{d}\theta &=e^{-\theta}\sin{7\theta}-7\int e^{-\theta}\cos{7\theta}\,\mathrm{d}t \end{align}

Thus,

\begin{align} \color{blue}{\int e^{-\theta}\cos{7\theta}\,\mathrm{d}\theta} &=e^{-\theta}\cos{7\theta}+7\int e^{-\theta}\sin{7\theta}\,\mathrm{d}\theta\\ &=e^{-\theta}\cos{7\theta}+7\left[e^{-\theta}\sin{7\theta}-7\int e^{-\theta}\cos{7\theta}\,\mathrm{d}t\right]\\ &=e^{-\theta}\cos{7\theta}+7e^{-\theta}\sin{7\theta}-\color{red}{49\int e^{-\theta}\cos{7\theta}\,\mathrm{d}t}\\ \end{align}

$$\implies \color{blue}{\int e^{-\theta}\cos{7\theta}\,\mathrm{d}\theta}+\color{red}{49\int e^{-\theta}\cos{7\theta}\,\mathrm{d}t}=e^{-\theta}\cos{7\theta}+7e^{-\theta}\sin{7\theta}.$$

Can you take it from there?

• I don't think your first iteration of IBP is correct. Shouldn't there be a negative sign out front of the term $e^{-\theta}cos(7\theta)$? I'm assuming you have used $dv = e^{-\theta}$ in which case $v = -e^{-\theta}$ Commented Sep 22, 2014 at 2:16
• @graydad Doh! So it is. Looks like a good opportunity for the OP to test her understanding of the method I described by re-deriving the answer without the error. :) Commented Sep 22, 2014 at 2:24

For the integrand $e^{-x}\cos\left(7x\right)$, integrate by parts, $\int fdg=fg-\int gdf$, where $f=\cos\left(7x\right)$, $dg=e^{-x}dx$, $df=-7\sin\left(7x\right)dx$, $g=-e^{-x}$: $$\int e^{-x}\cos\left(7x\right)dx=-e^{-x}\cos\left(7x\right)-7\int e^{-x}\sin\left(7x\right)dx$$

Integrate by parts again, where $f=\sin\left(7x\right)$, $dg=e^{-x}dx$, $df=7\cos\left(7x\right)dx$, $g=-e^{-x}$: $$\int e^{-x}\cos\left(7x\right)dx=7e^{-x}\sin\left(7x\right)-e^{-x}\cos\left(7x\right)-49\int e^{-x}\cos\left(7x\right)dx$$

Add $49\int e^{-x}\cos\left(7x\right)dx$ to both sides: $$50\int e^{-x}\cos\left(7x\right)dx=7e^{-x}\sin\left(7x\right)-e^{-x}\cos\left(7x\right)$$

Divide both sides by 50: $$\int e^{-x}\cos\left(7x\right)dx=\dfrac{1}{50}\left(7e^{-x}\sin\left(7x\right)-e^{-x}\cos\left(7x\right)\right)+C$$

$$\boxed{-\dfrac{1}{50}e^{-x}\left(\cos\left(7x\right)-7\sin\left(7x\right)\right)+C}$$

You do want to start at $u = \cos(7 \theta), \space dv = e^{-\theta}$. There is a nice trick you can use on these types of "circular" IBP problems. Using the substitution you initially tried, we have $$\int e^{-\theta}\cos(7 \theta)d\theta = -\cos(7 \theta)e^{-\theta}-\int-7\sin(7\theta)(-e^{-\theta}) d\theta \\ = -\cos(7 \theta)e^{-\theta}-7\int \sin(7\theta)e^{-\theta} d\theta$$ Now let's do another substitution for the integral on the far right, with $a = \sin(7\theta), \space db = e^{-\theta}$. We will get $$\int \sin(7\theta)e^{-\theta} d\theta = -\sin(7\theta)e^{-\theta}-\int 7\cos(7\theta)(-e^{-\theta}) \\ = -\sin(7\theta)e^{-\theta}+7\int \cos(7\theta)e^{-\theta}d\theta$$ But now the integral on the far right is exactly the same as the one we started with, as you noticed. Let's plug in the result we just got into the first integral equation we have. $$\int e^{-\theta}\cos(7 \theta)d\theta= -\cos(7 \theta)e^{-\theta}-7\int \sin(7\theta)e^{-\theta} d\theta \\ = -\cos(7 \theta)e^{-\theta}-7\left(-\sin(7\theta)e^{-\theta}+7\int \cos(7\theta)e^{-\theta}d\theta \right) \\ = -\cos(7 \theta)e^{-\theta}+7\sin(7\theta)e^{-\theta}-49\int \cos(7\theta)e^{-\theta}d\theta$$ Now we can add the quantity, "$\space 49\int \cos(7\theta)e^{-\theta}d\theta$" to both sides of the equation. $$\implies \space 50\int \cos(7\theta)e^{-\theta}d\theta = -\cos(7 \theta)e^{-\theta}+7\sin(7\theta)e^{-\theta} \\ \implies \int \cos(7\theta)e^{-\theta}d\theta = \frac{1}{50}\left[ -\cos(7 \theta)e^{-\theta}+7\sin(7\theta)e^{-\theta} \right]+C$$

• Glad to help :) Commented Sep 22, 2014 at 5:04