Introduction to Elasticity/Torsion of rectangular sections
Sample homework problem 
Torsion of a bar with a rectangular cross section 
A cylinder with a rectangular cross sections under torison.
Why a function of the form
cannot be used as a Prandtl stress function for this cross section.
For compatibility, we need
However, for the given ,
which is not constant. Hence, the given function cannot be used as a Prandtl stress function.