Let $f(x,y) = x\ln(x) + y\ln(y)$ be defined on space
$S = \{(x,y) \in \mathbb{R}^2| x> 0, y > 0, x + y = 1\}$.
My question is, how do I take the partial derivative for this function, given that the parameters are coupled through $x+y = 1$.
A first idea would be to do it ignoring the coupling constraint. For this, we will get,
$\dfrac{\partial f(x,y)}{\partial x} = \dfrac{\partial x\ln(x) + y\ln(y)}{\partial x} = \ln(x) + x/x = \ln(x) + 1$
If we do not ignore the coupling constraint, and instead substitute $y = 1-x$, we will get,
$\dfrac{\partial f(x,y)}{\partial x} = \dfrac{\partial x\ln(x) + (1-x)\ln(1-x)}{\partial x} = \ln(x) + 1 + \dfrac{1}{1-x} - \ln(1-x) - \dfrac{x}{1-x}$
Am I doing this correctly?
Why do I get two different expressions of the gradient?
You can't use $y=1−x$, these variables are independent. Although we choose our points from $$S = \{(x,y) \in \mathbb{R}^2| x> 0, y > 0, x + y = 1\}$$ but it doesn't mean these variables are dependent. Then the substitute $y = 1-x$ makes no sense in this two variables function.