1

How is it that we can get two different answers for an integral depending on whether we apply an identity or not?

Typically, $$\int \sin x \cos x \ dx = \frac {\sin^2x}{2}+C~.$$

However if we apply the trigonometric identity $$\sin A \cos B = \frac12[\sin(A-B) + \sin(A+B)]~,$$ then the integral becomes $$\frac12 \int (\sin(0) + \sin(2x)) dx =\frac12 \int \sin(2x) dx = -\frac14 \cos(2x) $$

So we end up with a different answer. Have I made a mistake here, or is this just a property of integration/trigonometry?

Andrew Chin
  • 7,389
James Ronald
  • 2,331

4 Answers4

5

You're fine, because $\frac12\sin^2x+\frac14\cos 2x=\frac14$ is absorbed into the integration constant.

J.G.
  • 115,835
1

The same in-definite integral,$I(x)$ done by different methods could yield different expressions $I_1(x), I_2(x), I_3(x)...$ which would differ with each other only by a constant. For example $$I(x)=\int \sin x \cos x dx= \int \frac{\sin 2x}{2} dx=-\frac{\cos 2x}{4}+C_1 =I_1(x).$$ The same integral if done bt parts gives $$I(x)=\sin x \sin x-\int \cos x \sin x dx \Rightarrow I(x)=\frac{ \sin^2 x}{2}+C_2= I_2(x). $$ The same integral if done by substitution $\cos x=t$, we get $$I(x)=\int \sin x \cos x dx=\int -d (\cos x) \cos x dx= -\frac{\cos^2 x}{2}+C_3=I_3(x)$$ It can be seen that $I_1(x), I_2(x)$ and $I_3(x)$ differe mutually by just some constant (independent of $x$).

Z Ahmed
  • 43,235
1

Your confusion lies in the definition of antiderivative: It's not a function, but a set of functions: $$\int f := \{g| g'=f\}$$ And you can easily check that the derivative of both of yout functions is the same, so they are both an antiderivative of your initial function.

But why do we write expressions like $$\int x \mathrm{d}x=\frac{x^2}{2}+C?$$ Because we are lazy, and it's easier to just write out one element of the set plus a constant. And why can we do it? Because it can be proven that if $f'=g'$ then $\exists c$ so that $f=g+c$ (with the MVT, applied to $h=f-g$), so one element of the set is enough to characterise the whole set.

Botond
  • 11,938
  • Cases such as $\int\frac1x dx$ remind us that $c$ is in general a locally constant function, its number of degrees of freedom dependent on the choice of integrand. – J.G. Sep 21 '19 at 19:01
  • @J.G. What's the point of using a locally constant function instead of a constant? For example, I don't see why would I want to have $\int \frac{1}{x}\mathrm{d}x=\log|x|+2-(-\infty,0)(x)$, for example. Maybe it's useful in the case of differential equations? – Botond Sep 21 '19 at 19:24
  • It's not about what you would want; the most general antiderivative of $\frac1x$ is allowed to differ from $\ln|x|$ by different values either side of $x=0$. – J.G. Sep 21 '19 at 19:46
1

You forgot the arbitrary constant in your second method.

The non-constant part of the first result may be transformed as follows: $$\frac{\sin^2x}{2}=\frac{1-\cos 2x}{4}=-\frac14\cos 2x+C,$$ since $C$ is arbitrary.

Allawonder
  • 13,327