TITLE: Can a formula that has free variables be logically equivalent with a sentence?
QUESTION [5 upvotes]: Let $\phi$ be a formula in F.O.L. that has free variables.
I wondered at first hand:
Can we always find a structure $\mathfrak C$ together with assignments $\alpha,\beta$ such that: $\mathfrak C\vDash\phi[\alpha]$ and $\mathfrak C\nvDash\phi[\beta]$?
I found counterexamples for that in formulas like $x=x$ and $\neg x=x$.
But the fact that in those cases we are dealing with a tautology and a contradiction respectively made me wonder: what if counterexamples of that sort are not allowed?
So I pose the question again, but under the extra condition that structures $\mathfrak A, \mathfrak B$ exists together with assignments $\alpha$ and $\beta$ satisfying $\mathfrak A\vDash\phi[\alpha]$ and $\mathfrak B\nvDash\phi[\beta]$.
If the answer is in that case a "no" then I can draw the conclusion that formulas that are not sentences but are logically equivalent with sentences must be tautologies or contradictions.
I do not know whether that is true (actually I hope so) or not (I do have my doubts), and am quite curious.
Thank you in advance.

Edit:
Let me for compleness make clear what definition  I practicize for logical equivalence of formulas.
Two formulas $\phi$ and $\psi$ are logically equivalent if for every structure $\mathfrak A$ and every $\mathfrak A$-assignment $\alpha$:
$$\mathfrak A\vDash\phi\leftrightarrow\psi[\alpha]$$
or equivalently:$$\mathfrak A\vDash\phi[\alpha]\iff\mathfrak A\vDash\psi[\alpha]$$

REPLY [2 votes]: Let's fix some theory $T$ in some language $\mathcal{L}$. If you wish to just consider structures you can take $T$ to be the empty theory (i.e. no axioms). We define two formulas $\phi(x)$ and $\psi(x)$ to be logically equivalent (modulo $T$) if
$$
T \models \forall x(\phi(x) \leftrightarrow \psi(x)).
$$
This is indeed equivalent to the definition you mention for the empty theory, and for non-empty theories it just restricts us to the models of $T$. Note that in the above definition $\phi$ and $\psi$ do not need to actually mention the variables $x$.
Your main question then was the following:

Can a formula that has free variables be logically equivalent with a sentence that is not a tautology or a contradiction?

The answer is yes. Take any sentence $\psi$ that is not a tautology or contradiction. Then $\psi \wedge x = x$ is logically equivalent and has free variable $x$.
One example would be to take $\psi$ to be the sentence "there are at least 10 elements" and $T$ to be the empty theory. Then there will be structures (models of $T$) where $\psi$ is true and there will also be structures where $\psi$ is false, so $\psi$ is neither a tautology nor contradiction.
If every sentence is a tautology or contradiction (modulo $T$), so if $T$ is complete, then this can obviously not happen. Simply because there are no sentences that are not a tautology or contradiction.
Your original motivation was the following question:

Given $\phi(x)$, can we find a structure $C$ and $a,b \in C$ such that $C \models \phi(a)$ and $C \not \models \phi(b)$?

You mentioned that if $\phi(x)$ is a tautology or contradiction then this cannot happen. Something more general is actually true: if $\phi(x)$ is logically equivalent to a sentence then this cannot happen. Because in such a case we have $C \models \phi(a)$ if and only if $C \models \psi$ if and only if $C \models \phi(b)$, making use of the fact that $C \models \psi$ does not depend on $a$ or $b$. This does not depend on the fact whether or not $\psi$ is a tautology or contradiction.
Finding structures $A$ and $B$ with elements $a \in A$ and $b \in B$ such that $A \models \phi(a)$ and $B \not \models \phi(b)$ heavily depends on the theory $T$ and $\phi(x)$ (also when $A = B$).