Suppose we had a function $f(x,y(x))$ and we wanted to find $\frac{d}{dx}f(x,y(x))$. I know how to apply the multivariable chain rule with unspecified functions. But suppose we had: $f(x,y)=x^2y+ \sin(y)$ with $y=2x$. For the sake of understanding the theory behind this all I'm not going to substitute the $y=2x$.
How do I find $\frac{\partial f}{\partial x}$ and $\frac{\partial f}{\partial y}$. My general understanding was that we would look at all the other variables as constants but in this case $y$ is a function of $x$ so do we still consider $y$ a constant when evaluating $\frac{\partial f}{\partial x}$?
In that case: $\frac{\partial f}{\partial x} = 2xy$. But is this correct? Do we still consider $y$ a constant when calculating the partial derivative to $x$ even though we know that $y$ depends on $x$?
There are two approaches to finding $\frac{df(x,y(x))}{dx}$ in your example:
1) do the substitution first to get $$f(x,2x)= 2x^3+\sin(2x)$$ $$\frac{df(x,2x)}{dx} = 6x^2 +2\cos(2x)$$
2) use partial derivatives first
$$\frac{df(x,y(x))}{dx} = \frac{\partial f}{\partial x} + \frac{d y}{d x} \frac{\partial f}{\partial y} = 2xy +\frac{d y}{d x} \left(x^2 + \cos(y) \right) $$ $$\frac{df(x,2x)}{dx} = 4x^2 +2\left(x^2 + \cos(2x) \right) = 6x^2+2\cos(2x) $$
and as you might hope they give the same answer.
You asked "do we still consider $y$ a constant when evaluating $\frac{\partial f}{\partial x}$?" Yes, as in $2xy$ term in the start of (2) above. The impact of varying $y$ is found in the $\frac{d y}{d x}$ and $\frac{\partial f}{\partial y}$ terms and that enables the full derivative $\frac{df}{dx}$ to be found