I'm trying to find $$\int \cos x dy.$$
I know that if I have to differentiate the same "thing" w.r.t $y$, then chain rule could be used to get $$- \sin x\frac{dx}{dy}.$$
But I'm unable to find the integral w.r.t $y$.
I entered it in some online calculators, and the answer I got was $$y \cos x + C.$$
Can somebody explain how to get this?
I know this is a very elementary problem, but still I'm struggling with the answer. It would be better if you find the answer using only elementary calculus.