I am just going to assume that the non-shaded box is a square, and tha its side lengths are equal to x.
A.

This is because the area of the shaded is the area of the bigger square minus the area of the smaller.
B.

This is found by just plugging in the value of x into the previous expression.