Problem 11.100

According to the discussion at the bottom of page 713, Castigliano's theorem can be used to find a deflection at a point if there is a load there. If there is no load at the point, a fictitious load can be placed there and then let the load be zero in the result. Likewise, to find the slope of a beam at a point where there is no couple, simply apply a fictitious couple and substitute zero for it in the result.
In this case, the slope is to be found at point A. Because there's no couple there, and I'll need to take partial derivatives with respect to a couple at A, a fictitious couple MA has to be placed there:

I have drawn the moment clockwise so that its effect is to bend the beam in same direction that the (real) force P causes. In terms of MA, and taking ccw as positive, the reactions are:

I'm also going to need the internal moment as a function of x:

Because I'll want to take the partial derivative with respect to MA, not x, it's convenient to rearrange this:

For the other section of the beam...

The energy is

Since the integral is on x, MA can be set equal to zero: