AP Calculus AB and BC

Integral of cos 4x: Answer, Proof, and Steps

The integral of cos(4x) is sin(4x)/4 + C. The 4 inside the cosine reappears as a factor when you differentiate sin(4x), so the antiderivative divides by 4 to cancel it. The substitution u = 4x makes the same point, since dx = du/4.

cos4xdx=sin4x4+C\int \cos 4x\,dx = \frac{\sin 4x}{4} + C

Undoing the chain rule on the inside

The antiderivative of cosx\cos x is sinx\sin x, so the shape of the answer is a sine. What changes is the 4 sitting in front of xx. Differentiating sin4x\sin 4x triggers the chain rule, and the inside derivative shows up as a stray factor.

ddx[sin4x]=cos4x4=4cos4x\frac{d}{dx}\left[\sin 4x\right] = \cos 4x \cdot 4 = 4\cos 4x

That first guess is four times too big, so scale it down by 4.

cos4xdx=sin4x4+C\int \cos 4x\,dx = \frac{\sin 4x}{4} + C

The substitution that makes it automatic

If guessing feels risky, run the substitution. Let u=4xu = 4x, so du=4dxdu = 4\,dx and dx=du4dx = \frac{du}{4}. The constant leaves the integral, and what remains is the basic cosine rule.

cos4xdx=cosudu4=14cosudu=sinu4+C\int \cos 4x\,dx = \int \cos u \cdot \frac{du}{4} = \frac{1}{4}\int \cos u\,du = \frac{\sin u}{4} + C

Putting u=4xu = 4x back gives sin4x4+C\frac{\sin 4x}{4} + C. Differentiating it returns 4cos4x4=cos4x\frac{4\cos 4x}{4} = \cos 4x, the function you started with.

The mistake students make

The frequent error is multiplying by 4 instead of dividing, writing 4sin4x+C4\sin 4x + C. Differentiating that gives 16cos4x16\cos 4x, off by a factor of 16. Derivatives of composite functions multiply by the inside derivative, so antiderivatives have to divide by it.

Only a linear inside gets this shortcut

Dividing by the inside coefficient works because the derivative of 4x4x is the constant 4, which can be pulled out front. For an inside like x2x^2 the derivative still contains xx, no constant cancels it, and cos(x2)dx\int \cos(x^2)\,dx has no elementary answer at all.

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

Why divide by 4 instead of multiplying by 4?

Because ddx[sin4x]=4cos4x\frac{d}{dx}[\sin 4x] = 4\cos 4x, so the raw guess already overshoots by a factor of 4. Dividing cancels it exactly. Multiplying would leave a derivative of 16cos4x16\cos 4x.

Does the same rule work for any coefficient?

Yes. For any nonzero constant kk, coskxdx=sinkxk+C\int \cos kx\,dx = \frac{\sin kx}{k} + C. It stops working the moment the inside is nonlinear, since then the inside derivative is not a constant.

What is the definite integral of cos 4x from 0 to pi/8?

Evaluate sin4x4\frac{\sin 4x}{4} at the endpoints: sinπ24sin04=14\frac{\sin\frac{\pi}{2}}{4} - \frac{\sin 0}{4} = \frac{1}{4}.