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.

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. $$
