state space representation of system with a disturbance
It is basic block diagram algebra.

First, you write out the algebraic equations and solve for the unknowns \$x1\$ and \$x2\$.

$$\text{x1}=\frac{0.05 (\text{Ua}-0.1 \text{x2})}{0.01 s+1}$$
$$\text{x2}=\frac{-\text{Mx}+\text{x1}-2 Y}{0.5 s+1}$$

Next you write the output equation as \$Y= \frac{1}{s} x2\$ and solve for \$Y\$ in terms of the two inputs \$Ua\$ and \$Mx\$. This will give you the transfer function model from the two inputs to the output \$Y\$.

Then obtain a state-space realization.

Since \$Mx\$ is a disturbance, you want to remove the column of the input matrix that corresponds to that before computing the controllability matrix.