Take rod of length hinged at , resting against wall, and let perpendicular from to wall meet wall at . Assume makes an angle with vertical through .
Apart from forces at the hinge, forces acting are the weight at midpoint of , the normal reaction at perpendicular to wall, and the friction at perpendicular to along the wall.
Choose axes so that is along , is horizontal and perpendicular to , and is vertically up. Then
, so that .
The relevant forces are the weight , friction , and normal reaction . The forces at are irrelevant as we are about to take moments about .
So, on we go: , which we can write as .
This gives .
Expanding the vector product on the left after cancelling , .
The first equation gives .
The third equation is , and since we see that . So the maximum value of which leads by symmetry to the given answer.
Eliminating we see that , and at the extreme positions . This gives your other answer, my friend.