How do you integrate #int e^xcosx# by integration by parts method?
↳Redirected from
"What is the chemical formula of a carbohydrate?"
By integrating by parts twice:
#\frac{e^x(cos(x) + sin(x))}{2}#
We will use the fact that #e^x# remains unchanged when integrated, while the cosine function has the following derivation loop:
#cos(x)-> -\sin(x) -> -\cos(x) -> sin(x) -> cos(x) -> \ldots#
In particular, we're interested in the fact that deriving the cosine function twice means to invert its sign.
So, after a first integration by parts, we have
#int e^xcos(x) = e^x cos(x) - int e^x(-sin(x)) =#
#= e^x cos(x) + int e^xsin(x)#
Now integrate #e^xsin(x)# by parts again: we have
#int e^xsin(x) = e^xsin(x) - \int e^xcos(x)#
Putting all the pieces together, we have
#int e^xcos(x) = e^x cos(x) + e^x sin(x) - \int e^xcos(x)#
As you can see, the (same) integral appears on both sides, this means that we can add it to both sides to get
#2int e^xcos(x) = e^x cos(x) + e^x sin(x)#
and thus solve for it:
#int e^xcos(x) = \frac{e^x cos(x) + e^x sin(x)}{2} = \frac{e^x(cos(x) + sin(x))}{2}#
#int e^x cosx dx = (e^x(cosx+sinx))/2 +C#
As #d(e^x) = e^xdx#, we can integrate by parts int the following way:
#int e^x cosx dx = int cosx d(e^x) #
#int e^x cosx dx = e^xcosx- int e^x d(cosx)#
#int e^x cosx dx = e^xcosx+ int e^x sinx dx#
Integrate by parts again:
#int e^x cosx dx = e^xcosx+ int sinx d(e^x)#
#int e^x cosx dx = e^xcosx+e^xsinx- int e^x d(sinx)#
#int e^x cosx dx = e^xcosx+e^xsinx - int e^x cosx dx#
The integral now appears on both sides of the equation and we can solve for it:
#2int e^x cosx dx = e^xcosx+e^xsinx +C#
#int e^x cosx dx = (e^x(cosx+sinx))/2 +C#