The member shown in the figure is simply-supported.
Find the angular displacement at B, as a function of P, L, A, I, J, E, G.
For a rectangular cross-section:
$\theta = \frac{\partial U}{\partial C} = \int \left[ \frac{1}{EI} \left( M \frac{\partial M}{\partial C} \right) + \frac{1}{AE} \left( F \frac{\partial F}{\partial C} \right) + \frac{1}{GJ} \left( T \frac{\partial T}{\partial C} \right) + \frac{1.2}{AG} \left( V \frac{\partial V}{\partial C} \right) \right] dx$
Hint: You need a moment to find the angular displacement, just like a force to find the linear displacement.