Answer
a) $S = 4lb + 2b^2$
b) length, $l = \frac{S - 2 b^2}{4b}$
Work Step by Step
a) The rectangular prism has $4$ rectangular faces (of length l and width b) and $2$ square faces of side $b$.
The surface area $S$, of the prism is $$S = 4 \times \text{area of rectangle} + 2 \times \text{area of square}.\tag{1}$$ Using the formulas for the area of a rectangle and the area of a square in $(1)$ we get $$S = 4lb + 2b^2.\tag{2}$$b) We solve equation $(2)$ for $l$:
Subtract $2b^2$ from both sides $$S - 2b^2 =4lb.$$ Divide both sides by $4b$ $$\frac{S - 2 b^2}{4b} = l.$$ Therefore the length $l$ can be written $$l = \frac{S - 2b^2}{4b}.$$We chose to solve equation $(2)$ for $l$ because it led to a linear equation. If we were to solve it for $b$, we would have got a quadratic equation, which would have been more difficult to solve.