I tried to solve $\int t \sin (t^2) dt$ using partial integration. The result is $\frac{-t \cos{(t^2)}}{2} + \frac{\sin{(t^2)}}{4} + C$.
Then I tried to differente that result. Instead of getting $t \sin (t^2)$, I got $t^2 \sin{(t^2)}-\frac{\cos{(t^2)}}{2}+\frac{t\cos{(t^2)}}{2}$.
What's wrong? (I know I can use substitution, just curious to use partial integration.)
Edit: Here is how I get the result:
Using the formula $\int uv' dt = uv-\int u'vdt$.
$ u = t \rightarrow u \frac{d}{dt} = t \frac{d}{dt} \rightarrow u \frac{d}{dt} = 1$, and $v \frac{d}{dt} = \sin{(t^2)} \rightarrow \int {v \frac{d}{dt}} dt = \int{\sin{(t^2)}} dt \rightarrow v = \frac{-\cos {(t^2)}}{2}+C_1$, so
$\begin{align} uv-\int{u'v}dt = \frac{-t \cos{(t^2)}}{2} + tC_1 - \int{\frac{-\cos{(t^2)}}{2}}dt - \int{C_1}dt = \frac{-t \cos{(t^2)} }{2} + tC_1 + \frac{ \sin{(t^2)}}{4} - tC_1 + C_2 = \frac{-t \cos{(t^2)} }{2} + \frac{ \sin{(t^2)}}{4} + C_2. \end{align}$
I’m guessing that you integrated $\sin t^2$ to $-\frac12\cos t^2$ and $\cos t^2$ to $\frac12\sin t^2$, as that would yield the result you give. That’s wrong, as you can see if you differentiate the results.