Calculus · real student question

Find the antiderivative of f(x) = cos^2 x, and also its derivative.

Question

For f(x)=cos2xf(x)=\cos^2 x, find f(x)dx\int f(x)\,dx and f(x)f'(x).

Step-by-step solution

  1. Replace the square with the power-reduction identity. Squares of sine and cosine cannot be integrated directly with the power rule, but they linearise:

    cos2x=1+cos2x2\cos^2 x=\frac{1+\cos 2x}{2}

    This comes from cos2x=2cos2x1\cos 2x=2\cos^2x-1 rearranged, and it is the standard first move for cos2\int\cos^2 or sin2\int\sin^2.

  2. Split the resulting integral.

    cos2xdx=121dx+12cos2xdx\int\cos^2 x\,dx=\frac{1}{2}\int 1\,dx+\frac{1}{2}\int\cos 2x\,dx

  3. Integrate each piece. The second needs the 1k\tfrac1k factor for the inner 2x2x:

    121dx=x2,12cos2xdx=12sin2x2=sin2x4\frac{1}{2}\int 1\,dx=\frac{x}{2},\qquad\frac{1}{2}\int\cos 2x\,dx=\frac{1}{2}\cdot\frac{\sin 2x}{2}=\frac{\sin 2x}{4}

    cos2xdx=x2+sin2x4+C\int\cos^2 x\,dx=\frac{x}{2}+\frac{\sin 2x}{4}+C

  4. Differentiate ff as well, using the chain rule. Writing f(x)=(cosx)2f(x)=(\cos x)^2:

    f(x)=2cosx(sinx)=2sinxcosx=sin2xf'(x)=2\cos x\cdot(-\sin x)=-2\sin x\cos x=-\sin 2x

    where the last step uses the double-angle identity sin2x=2sinxcosx\sin 2x=2\sin x\cos x.

  5. Check the antiderivative by differentiating it back.

    ddx(x2+sin2x4)=12+2cos2x4=1+cos2x2=cos2x\frac{d}{dx}\left(\frac{x}{2}+\frac{\sin 2x}{4}\right)=\frac{1}{2}+\frac{2\cos 2x}{4}=\frac{1+\cos 2x}{2}=\cos^2 x\qquad\checkmark

    Numerically at x=0.9x=0.9: the derivative of the antiderivative is 0.3863990.386399 and cos2(0.9)=0.386399\cos^2(0.9)=0.386399 \checkmark. The average value x2\tfrac{x}{2} also matches the known mean of cos2\cos^2 over a period, namely 12\tfrac12.

Answer

cos2xdx=x2+sin2x4+C,f(x)=2sinxcosx=sin2x\int\cos^2 x\,dx=\frac{x}{2}+\frac{\sin 2x}{4}+C,\qquad f'(x)=-2\sin x\cos x=-\sin 2x

Need to solve a different problem like this? Open the solver →