AP Calculus BC

Integral of e^x sin x: Answer and Proof

The integral of e^x sin x with respect to x is e^x(sin x - cos x)/2 + C. Integration by parts applied twice brings back a copy of the original integral, and solving the resulting equation for it gives the answer. Differentiating e^x(sin x - cos x)/2 returns e^x sin x.

exsinxdx=ex(sinxcosx)2+C\int e^x\sin x\,dx = \frac{e^x(\sin x-\cos x)}{2} + C

How to integrate e^x sin x by parts twice

Both factors, exe^x and sinx\sin x, reproduce themselves under differentiation, so one pass of parts does not simplify the integrand. The method is to apply parts twice and watch the original integral reappear, then solve for it algebraically. Call the integral II.

I=exsinxdxI = \int e^x\sin x\,dx

First pass: take u=sinxu = \sin x and dv=exdxdv = e^x\,dx, so du=cosxdxdu = \cos x\,dx and v=exv = e^x.

I=exsinxexcosxdxI = e^x\sin x - \int e^x\cos x\,dx

Apply parts again to the new integral with u=cosxu = \cos x and dv=exdxdv = e^x\,dx, giving du=sinxdxdu = -\sin x\,dx and v=exv = e^x.

excosxdx=excosx+exsinxdx=excosx+I\int e^x\cos x\,dx = e^x\cos x + \int e^x\sin x\,dx = e^x\cos x + I

Substitute that back. The original integral II returns on the right, which is the whole point.

I=exsinx(excosx+I)=exsinxexcosxII = e^x\sin x - \left(e^x\cos x + I\right) = e^x\sin x - e^x\cos x - I

Add II to both sides and divide by 22.

2I=ex(sinxcosx)I=ex(sinxcosx)2+C2I = e^x\left(\sin x - \cos x\right) \quad\Longrightarrow\quad I = \frac{e^x\left(\sin x - \cos x\right)}{2} + C

Check it by differentiating

Differentiate ex(sinxcosx)2\frac{e^x(\sin x - \cos x)}{2} with the product rule: 12[ex(sinxcosx)+ex(cosx+sinx)]=12ex(2sinx)=exsinx\frac{1}{2}\left[e^x(\sin x - \cos x) + e^x(\cos x + \sin x)\right] = \frac{1}{2}e^x(2\sin x) = e^x\sin x. The cosine terms cancel.

Why one pass is not enough

In most parts problems one factor simplifies toward a constant after enough differentiations and the process ends. Here sinx\sin x never simplifies, it cycles through cosx\cos x and back, so a single pass leaves you with an integral just as hard as the one you started with, excosxdx\int e^x\cos x\,dx.

The second pass is what makes the method work, because it regenerates II with a sign that lets you solve for it. Keep the same choice of uu type on both passes; if you switch and take u=exu = e^x the second time, you undo the first pass and return to I=II = I, which tells you nothing.

The companion integral falls out of the same work, differing only by the sign inside the parentheses.

excosxdx=ex(sinx+cosx)2+C\int e^x\cos x\,dx = \frac{e^x\left(\sin x + \cos x\right)}{2} + C

Common mistakes with the integral of e^x sin x

  • Stopping after one pass. I=exsinxexcosxdxI = e^x\sin x - \int e^x\cos x\,dx is not an answer; the remaining integral is as hard as the original.
  • Switching the uu choice on the second pass. Taking u=exu = e^x the second time reverses the first pass and collapses to I=II = I.
  • Forgetting to divide by 22. After solving 2I=ex(sinxcosx)2I = e^x(\sin x - \cos x), the antiderivative is that over 22.
  • Sign errors in the second pass. With u=cosxu = \cos x, du=sinxdxdu = -\sin x\,dx, and the two minus signs make excosxdx=excosx+I\int e^x\cos x\,dx = e^x\cos x + I, a plus in front of II.
  • Dropping the +C+ C. It is an indefinite integral, so the constant belongs at the end.

Every answer on this page is machine checked

An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.

Frequently asked questions

What is the integral of e^x sin x?

It is ex(sinxcosx)2+C\frac{e^x(\sin x - \cos x)}{2} + C. Integration by parts twice regenerates the original integral II, and solving 2I=ex(sinxcosx)2I = e^x(\sin x - \cos x) gives the result.

Why do you integrate by parts twice?

Because neither exe^x nor sinx\sin x simplifies under differentiation, one pass just trades exsinxdx\int e^x\sin x\,dx for the equally hard excosxdx\int e^x\cos x\,dx. The second pass brings back the original integral, and you solve for it algebraically.

What is the integral of e^x cos x?

It is ex(sinx+cosx)2+C\frac{e^x(\sin x + \cos x)}{2} + C. It comes out of the same two-pass parts computation; only the sign inside the parentheses changes.