Differentials and Independent Variables (Thermodynamics) My textbook derives the Helmholtz free energy's total differential as follows (in these steps) $$A=E-TS$$
$$(1):dA=dE-d(TS)$$
$$(2):dA=dE-TdS-SdT$$
$$(3):dA=(TdS-PdV+\mu dN)-TdS-SdT=-PdV-SdT+\mu dN$$
Two things I am not convinced about in this derivation. The Helmholtz free energy is a function of $T, V, N $ (i.e $A(T, V, N)$). In step 2 it shows $d(TS)=TdS+SdT$ shouldn't be $d(TS)=TdS$ since the temperature is an independent variable of $A$ (i.e $A(T,V,N)=E(T,V,N)-TS(T,V,N)$)?
The 3rd step invokes the result for $dE$ when the independent variables are $S,V, N$ even though for Helmholtz free energy, $T,V,$and $N$ are the independent variable, so will $dE$ be different if the independent variables are different?In other words, will $dE$ be different for $E(S,V,N)$ vs $E(T,V,N)$?
 A: If we have a function of three real variables $f(x,y,z)$ we define its differential at a point $(x_0,y_0,z_0)$ as the following linear function of $(x,y,z)$
$$
df = \left. \frac{\partial f}{\partial x}\right|_0 (x-x_0) + \left. \frac{\partial f}{\partial y}\right|_0(y-y_0) + \left. \frac{\partial f}{\partial z}\right|_0(z-z_0).
$$
where the label $0$ means that the partial derivatives have been evaluated at  $(x_0,y_0,z_0)$. From this definition, it is immediate to see that $(x-x_0)=dx$, and similarly for $dy$ and $dz$.
From the definition and recalling Leibnitz's rule for the derivative of a product, it follows that
$$
d(f\cdot g)=f\cdot dg+g \cdot df
$$
for every pair of functions $f$ and $g$. In particular, if $f$ is the function assigning $x$ to a point $(x,y,z)$, it is clear that
$$
d(x\cdot f)= f\cdot dx + x \cdot df
$$
i.e., the differential of the independent variable $x$ does appear (and does not vanishes).
Regarding the change of variables, as physicists, we tend to be sloppy with mathematical notation.
Strictly speaking, a change of variables, like the case of passing from $E(S,V,N)$ to $E(T,V,N)$, introduces a new function, and it is quite misleading to use the same symbol for both. Just as an illustration, let's consider the case of
$$
E(S) = S^4
$$
We introduce $T=\frac{dE}{dS}=4S^3$, that can be inverted to give $S=\left(T/4\right)^{\frac13}$. Expressing $E$ as a function of $T$ gives
$$
E(S(T))=\left( \frac{T}{4} \right)^{\frac43}.
$$
Even in this trivial example, it is clear that $E(S)$ is not the same function of S as $E(S(T))$ is a function of $T$. Therefore, one should use a different symbol. Actually, $E(S(T))$ is different from $E(T)$, and its differential as a function of $S$ is different from the differential of the compound function $E(S(T))$. Still, the shortest notation $E(T)$ is often used in physics textbooks.
To summarize, the usual manipulations of thermodynamics differentials are safe, notwithstanding some abuse of notation. In the case of doubts, it is better to write explicitly how a function depends on its variables. For instance, by writing
$$
A(T,V,N)=E(S(T,V,N),V,N)-T S(T,V,T)
$$
A: Last things first: Yes, $\text{d}E$ will be different depending on the choice of independent variables. (I'll omit $V$ and $N$ for brevity)
$$
\text{d}E = \frac{\partial E}{\partial T} \text{d}T
$$
when your choice of independent variable is the temperature, and alternatively, when $E$ is a function of $S$:
$$
\text{d}E = \frac{\partial E}{\partial S} \text{d}S,
$$
wherein $\frac{\partial E}{\partial S} = T$. In the first formula $\frac{\partial E}{\partial T}$ is the heat capacity of the system.
$$
\text{d}(TS) = T \text{d}S + S \text{d}T
$$
is a generally valid product rule for the total differential. If you later make a choice of process where either of the differentials d$T$ or d$S$ vanish, fine, the corresponding term will vanish, but at the point we are using it we haven't made such a choice.
When we choose $T$ as an independent variable, this does not mean that d$T$ vanishes.
