# Prove that $\cos(x)$ is identically zero using integration by parts

Consider $$\int\cos(t-x)\sin(x)dx,$$ where $t$ is a constant.

Evaluating the integral by parts, let \begin{align} u = \cos(t-x),\ dv = \sin(x), \\ du = \sin(t-x),\ v = -\cos(x), \end{align} so $$\int\cos(t-x)\sin(x)dx = -\cos(t-x)\cos(x) - \int\sin(t-x)\cdot-\cos(x)dx.$$ Evaluating the integral on the right by parts again (with a slight abuse of notation), \begin{align} u = \sin(t-x),&\quad dv = -\cos(x), \\ du = -\cos(t-x),&\quad v = -\sin(x), \end{align} we get \begin{align} \int\cos(t-x)\sin(x)dx &= -\cos(t-x)\cos(x) - \left( -\sin(t-x)\sin(x)-\int\cos(t-x)\sin(x)dx\right) \\ &= -\cos(t-x)\cos(x) + \sin(t-x)\sin(x) + \int\cos(t-x)\sin(x)dx, \end{align} and subtracting the integral from both sides, we obtain the dazzling new identity $$\sin(t-x)\sin(x)-\cos(t-x)\cos(x)=0$$ for all $t$ and $x$!

Pushing it further, the LHS expression is $-\cos(t)$, and as $t$ was just an arbitrary constant, this implies $\cos(x)$ is identically zero!

Now I obviously know something's wrong here. But what, and where? Where's the flaw in my reasoning?

P.S. I can evaluate the integral to get the proper answer lol. But this was rather interesting.

-
Argh I keep hitting enter too soon. Updating. –  Josh Chen Oct 1 '11 at 2:01
wolframalpha.com/input/… –  jericson Oct 1 '11 at 2:09
You've tried expanding out using the difference of two angles formula for the cosine? –  Ｊ. Ｍ. Oct 1 '11 at 2:12
Question's been updated thanks. –  Josh Chen Oct 1 '11 at 2:35
In your last step you say $=0$, but you should actually say "is constant". –  Michael Hardy Oct 1 '11 at 2:43

A standard trigonometric identity says that $$\sin(t-x)\sin(x)-\cos(t-x)\cos(x)$$ is equal to $$-\cos((t-x)+x)$$ and that is $-\cos t$. As a function of $x$, this is a constant, i.e. since there's no "$x$" in this expression, it doesn't change as $x$ changes. Since the "dazzling new identity", if stated correctly, would say, not that the expression equals $0$, but that the expression is constant, it seems your derivation is correct. Except that you wrote "$=0$" where you needed "$=\text{constant}$".
Ahaha oops. In the fun of the moment I completely forgot $+c$. So the great mystery was all because of that high-school mistake. :P –  Josh Chen Oct 1 '11 at 2:58
The issue is that you're working with indefinite integrals, so you have to be careful about arbitrary constants of integration. When using by-parts integration on indefinite integrals you're only guaranteed to get another antiderivative, not necessarily the same antiderivative as this example clearly demonstrates. Here it turns out that the LHS is the original antiderivative, and the RHS is the same antiderivative plus $-\cos t$ (which is a constant with respect to $x$).
If you worked the same example out with definite integration instead, you would wind up with $$0=-\cos( t)\big|_{x=a}^{x=b}=-\cos t-(-\cos t)=0.$$