You don't seem to have had any response so far, so here are my thoughts -
In equilibrium, forces balance in each direction and moments about any point balance. The forces acting are:
Where the ladder meets the wall:
There is a reaction force (S) out of the wall.
There is a frictional force upwards (U1 x S).
At the centre of the ladder (a length D from each end):
The weight (Mg) acting downwards.
At the base of the ladder:
There is a reaction force (R) up from the ground.
There is a frictional force towards the wall (U x R).
The horizontal forces have to balance, so S = U x R
The vertical forces have to balance, so U1 x S + R = Mg
The moments about the base of the ladder have to balance, so
2D (S x sin theta + U1 x S x cos theta) =
D (Mg x cos theta)
If you manipulate these three equations, you'll get tan theta = (1-UU1)/2U
Hope this helps.