How do you integrate #int e^-xcosx# by parts from #[0,2]#?

1 Answer
Mar 25, 2018

#int_0^2e^-xcosxdx=1/2(e^-xsinx-e^-xcosx)|_0^2=1/2(e^-2sin2-e^-2cos2+1)#

Explanation:

Let's pick #u, dv# and solve for #v, du:#

#u=e^-x#

#du=-e^-xdx#

#dv=cosxdx#

#v=sinx#

Thus, we apply #intudv=uv-intvdu#:

#inte^-xcosxdx=e^-xsinx+inte^-xsinxdx#

This didn't yield anything solvable, let's integrate by parts once more, for #inte^-xsinxdx#:

#u=e^-x#

#du=-e^-xdx#

#dv=sinxdx#

#v=-cosx#

Applying the integration by parts formula, we get

#inte^-xsinxdx=-e^-xcosx-inte^-xcosxdx#

There's nothing here we can solve, but note how our original integral showed up again.

Now, we said

#inte^-xcosxdx=e^-xsinx+inte^-xsinxdx#

So, let's plug in what we got for #inte^-xsinxdx# in:

#inte^-xcosxdx=e^-xsinx-e^-xcosx-inte^-xcosxdx#

Solve for #inte^-xcosxdx:#

#2inte^-xcosxdx=e^-xsinx-e^-xcosx#

#inte^-xcosxdx=1/2(e^-xsinx-e^-xcosx)#

Note I have not put in a constant of integration because we're going to be taking a definite integral:

#int_0^2e^-xcosxdx=1/2(e^-xsinx-e^-xcosx)|_0^2=1/2(e^-2sin2-e^-2cos2+1)#