in (sin(x) cos(x)) dx
let u=cos(x)
du=-sin(x) dx
answer is -1/2cos^2(x) (a)
if let u=sin(x)
du=cos(x) dx
then answer is 1/2*sin^2(x) (b)
if we put it into an right angle triangle length 3,4,5
then (a) get -0.18
but (b) get 0.32
You have forgotten about the arbitrary constant that is added to each integral. Both answers are correct up to a different constant, since $\displaystyle \displaystyle \begin{align*} -\frac{1}{2}\cos^2{x} = -\frac{1}{2}\left(1 - \sin^2{x}\right) = -\frac{1}{2} + \frac{1}{2}\sin^2{x} \end{align*}$.