AP Calculus AB and BC

Integral of sin x e^cos x: The Minus Sign

Set u equal to cos x and the problem collapses in a single line, because du equals negative sin x dx and that sin x is already sitting in the integrand. The answer is negative e to the cos x, plus C, and the minus sign is the whole difficulty.

sinxecosxdx=ecosx+C\int \sin x\,e^{\cos x}\,dx = -e^{\cos x} + C

The substitution is already written for you

The exponent is cosx\cos x, so set u=cosxu = \cos x. Then du=sinxdxdu = -\sin x\,dx, and the integrand contains sinxdx\sin x\,dx exactly. Solving for it gives sinxdx=du\sin x\,dx = -du.

sinxecosxdx=eudu=eu+C\int \sin x\,e^{\cos x}\,dx = -\int e^{u}\,du = -e^{u} + C
sinxecosxdx=ecosx+C\int \sin x\,e^{\cos x}\,dx = -e^{\cos x} + C

What to look for

An exponential with a function in the exponent, multiplied by something close to that function's derivative, is the standard u-substitution shape. Here the match is off only by a factor of negative one, which the constant handles.

Confirm it by differentiating

The chain rule sends the minus sign back where it came from, which is the fastest way to be sure the sign is right.

ddx(ecosx)=ecosx(sinx)=sinxecosx\frac{d}{dx}\left(-e^{\cos x}\right) = -e^{\cos x}\cdot\left(-\sin x\right) = \sin x\,e^{\cos x}

Two minus signs meet and cancel. If your answer differentiates to sinxecosx-\sin x\,e^{\cos x} instead, you dropped one of them.

The mistakes students make

The technique is rarely the problem on this one. The bookkeeping is.

  • Answering ecosx+Ce^{\cos x} + C. Its derivative is sinxecosx-\sin x\,e^{\cos x}, the exact negative of the function you started with.
  • Dividing by the derivative of the exponent and writing ecosxsinx\frac{e^{\cos x}}{-\sin x}. You may divide by a constant, never by a function of xx.
  • Setting u=sinxu = \sin x, which leaves ecosxe^{\cos x} with no way to convert it and no dxdx eliminated.

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 sin x e^cos x?

Substitution gives ecosx+C-e^{\cos x} + C.

Why is there a minus sign in front?

Because u=cosxu = \cos x gives du=sinxdxdu = -\sin x\,dx, so sinxdx=du\sin x\,dx = -du. The negative rides along through the whole integral.

Do I need integration by parts here?

No. Parts on sinxecosx\sin x\,e^{\cos x} produces an integral no simpler than the original. Substitution finishes it in one line.