Is the sentence $(x+1)^2=x^2+2x+1$ open or closed? Why?
My textbook says a sentence is open if its truth value depends on some of its variables. However, in this case, I see that it doesn't depend on the value of $x$ because the statement applies for all $x$ therefore it's a closed sentence.
By the way, the answer in my book says it's an open sentence.
Your textbook is informally mostly correct, but a bit sloppy and/or misleading, if you've quoted it exactly. A sentence is open iff it has at least one free variable. This is purely a syntactic property, not a semantic one; you have correctly observed that the semantic value of $(x+1)^2 = x^2 + 2x + 1$ is always "true" whenever $x$ is instantiated and the symbols endowed with their usual "ring" meanings, but that's not relevant to determining whether the sentence is open.