Why is the partial derivative of strain energy function with respect to strain equal to stress

In Elasticity, we have a strain energy function , $$W$$, that is a function of strain tensor, $$E$$.

Then the cauchy stress tensor, $$T$$ can be determined by: $$T_{ij}=\frac{\partial W}{\partial E_{ij}} \tag{\star}$$

First Question, does this equation hold for all elastic bodies? Or just linear elasticity?

Second, I am having trouble finding the intuition behind this relation. Could someone please help explain why the partial derivative of the strain energy with respect to strain components gives the stress components?

My attempt at deriving ($$\star$$)

The strain energy is the energy stored in a body due to deformation. And since we are considering elastic bodies, its equal to work done in order to deform it.

In 1D, for a beam of cross sectional area $$A$$ being stretched by a length of $$u_0$$ we can write an integral for work as :

$$Work = \int_{0}^{u_0}{\sigma(u)*A(u)*du}$$

where $$\sigma$$ is just the stress normal to the cross sectional area in this 1D case.

So, I can see how the stress tensor definitely plays a role in the strain energy, but I just can't figure out how to properly derive ($$\star$$). Can someone walk me through the derivation?

1. Yes, the relation $$\mathrm{stress}=d(\mathrm{strain\,energy\,density})/d(\mathrm{strain})$$ holds for all elastic bodies, not just linearly elastic bodies. This equation implies that all differential work goes into elastic strain energy, which holds even for nonlinearly elastic materials (e.g., hyperelastic materials). However, the equation wouldn't apply to plastic deformation, for example, in which substantial amounts of work are converted to heat and expended through the formation of crystal defects.
The simplest example of a generalized force and displacement is an actual force $$F$$ and displacement $$x$$ and the familiar equations $$w=\boldsymbol{F\cdot x}$$ and $$dw=F\,dx$$ for the work $$w$$. Another example is the pressure $$P$$ and volume $$V$$: $$dw=-P\,dV$$, with the minus sign appearing because pressure is compressive. Note how a gradient in pressure, the intensive variable, drives a shift in volume, the extensive variable. This effect is common for all of these pairs, whose units invariably multiply to give units of energy.
(This framework applies even to heating: the system energy $$U$$ increases with $$T\,dS$$, where gradients in temperature $$T$$ drive shifts in the entropy $$S$$. Here again, the units multiply to give units of energy.)
Yet another example of a conjugate pair is the stress and strain. Well actually, this isn't entirely true. If you look at the units, you'll see that the product of stress and strain has units of volumetric energy. So we can work with the elastic strain energy density or what you call above the strain energy function $$W$$, or we can work in terms of energy by multiplying by the volume, as in the fundamental relation for a first-order closed system under a general mechanical load: $$dU=T\,dS+\boldsymbol{\bar{\sigma}} V\,d\boldsymbol{\bar{\epsilon}}$$, where $$\boldsymbol{\bar{\sigma}}$$ and $$\boldsymbol{\bar{\epsilon}}$$ are the stress and strain tensors, respectively. (If the load is pressure, or equitriaxial compressive stress, then we recover the familiar $$dU=T\,dS-P\,dV$$.)
3. As for deriving your starred equation, I checked Nye's Physical Properties of Crystals and Ugural & Fenster's Advanced Strength and Applied Elasticity, and they proceed as you do: define the increase in strain energy from a uniaxial load applied to a differential element and then build up to the complete 3D case. For an isotropic material (which obeys generalized Hooke's Law), for example, Ugural & Fenster obtain a strain energy density of $$W=\frac{1}{2E}\left(\sigma_{x}^2+\sigma_{y}^2+\sigma_{z}^2\right)-\frac{\nu}{2E}\left(\sigma_{x}\sigma_y+\sigma_{y}\sigma_z+\sigma_{x}\sigma_z\right)+\frac{1}{2G}\left(\tau_{xy}^2+\tau_{yz}^2+\tau_{xz}^2\right).$$