You could multiply it all out, and then derivate the resulting product, but I suspect that this exercise is intended to demonstrate your knowledge of the Chain Rule.
In other words, if you apply the Chain Rule, there is no need to first expand the square.
f(x) = (e^x + 1)^2 is a composite function (i.e., a function "inside" another function).
The outer function is the squaring function:
f(x) = (stuff)^2
The inner function is the exponential expression e^x + 1.
The Chain Rule tells us that when we determine the derivative of a composite function, it's the derivative of the outer function multiplied by the derivative of the inner function.
What is the derivative of (stuff)^2 ?
Note that this derivative does not depend on the actual expression inside the parentheses. You deal with "stuff" in the next step. Just use the Power Rule, here.
What is the derivative of e^x + 1 ?
Multiply these two derivatives together, and you've got it. What say you now?