WolframAlpha computes $\frac{d}{dx}\left(x^2-2(\sin y)\right)$ to be
$$ \frac{d}{dx}\left(x^2-2 (\sin y)\right) =2 \left(x-(\cos y)y'(x)\right) $$
entered "differentiate (x^2 - 2*sin(y)) with respect to x" and "d/dx (x^2 - 2*sin(y))", with the same result included above. Shouldn't the result be just $2x$? $\sin(y)$ should be only a constant when considering it against d/dx, correct?
what's the original equation, as given?
if it's something like $f(x,y) = x^{2} - 2sin(y)$ then $f_x$ would be $2x$, as you said, because the change of $f$ with respect to $x$ doesn't depend on y.
but if it's $0 = x^2 - 2sin(y)$, then $y$ is implicitly a function of $x$ (because as $x$ changes, $-2sin(y)$ has to change as well so their sum remains 0), so that would need to be accounted for