On this page
You integrate sin x cos x and get ½sin²x. Your friend gets −½cos²x. The answer key says −¼cos 2x. Nobody made a mistake. Here are the three substitutions, why the answers look different, and a quick check for any exam.
What are the three ways to integrate sin x cos x?
Paul's Online Notes from Lamar University uses this integral as a second example of answers that differ only by a constant, and notes there are three different methods for doing it. Here they are, side by side.
Double-angle identity. Since sin 2x = 2 sin x cos x, the integral becomes ½ ∫ sin 2x dx = −¼cos 2x + C₁.
Substitute u = cos x. Then du = −sin x dx, so the integral becomes −∫ u du = −½u² + C₂ = −½cos²x + C₂.
Substitute u = sin x. Then du = cos x dx, so the integral becomes ∫ u du = ½u² + C₃ = ½sin²x + C₃.
Which answer is correct?
All three. An indefinite integral is not one function but a whole family of them.
OpenStax Calculus Volume 1 defines the indefinite integral of f as the most general antiderivative of f, written F(x) + C, where C is the constant of integration.
The same OpenStax section states, as Theorem 4.14, that if F and G are both antiderivatives of f on an interval, then G(x) = F(x) + C for some constant C.
So two correct answers can never differ by anything except a constant. Check it for our three answers using sin²x + cos²x = 1 and cos 2x = cos²x − sin²x:
½sin²x − (−½cos²x) = ½(sin²x + cos²x) = ½
½sin²x − (−¼cos 2x) = ½sin²x + ¼(1 − 2sin²x) = ¼
−½cos²x − (−¼cos 2x) = −½cos²x + ¼(2cos²x − 1) = −¼
The Lamar notes reach the same conclusion and write the link between the constants as C₂ = C₁ + ¼ and C₃ = C₁ − ¼. The hero diagram above shows it: three identical waves, stacked a quarter apart.
If this still feels slippery, our post on why two correct integrals can look different works through more examples of the same idea.
How do you check an integral by differentiation?
Differentiate your answer. If you get back the integrand, the answer is right, whatever it looks like.
d/dx (½sin²x) = ½ · 2 sin x · cos x = sin x cos x
d/dx (−½cos²x) = −½ · 2 cos x · (−sin x) = sin x cos x
d/dx (−¼cos 2x) = −¼ · (−sin 2x) · 2 = ½ sin 2x = sin x cos x
The chain rule does all the work. The constant C vanishes when you differentiate, which is exactly why it can hide a difference of ½ or ¼.
A two-minute check for exams
Use this when your answer does not match the options, the answer key or a friend's working.
Differentiate your answer. If it gives back the integrand, stop worrying. You are right.
Find the gap. Subtract the two answers and put in two easy values, such as x = 0 and x = π/2. For ½sin²x and −½cos²x you get ½ − 0 = ½ at π/2 and 0 − (−½) = ½ at 0. The same gap at both points suggests the gap is a constant; step 1 is what proves it.
If the gap changes, look for a real error. A missing minus sign from du = −sin x dx is the usual one in method 2.
Rewrite to match the options. In a multiple-choice question, turn your answer into the option's form with sin²x + cos²x = 1 or cos 2x = 1 − 2sin²x, rather than starting again.
For definite integrals, relax. The constant cancels. From 0 to π/2, all three answers give ½.
If you want to see how a known derivative plus one point pins down the constant, read finding an antiderivative from its derivative and a point. For the difference between a family of curves and a single number, see definite vs indefinite integrals.
What if you still cannot match the book?
If you keep getting a different form and cannot see why, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can spot exactly where your route split from the book's. For the idea underneath, the constant of integration, the Fermi Concept Library gives each concept in mathematics its own lesson.
Try it now: integrate 2 sin x cos x three ways, then differentiate each answer to prove they agree.



