Algebras that are free modules over a subalgebra
Solution 1:
I guess the following works: (I have the roles of $A$ and of $B$ reversed...)
If $A$ is either local notherian or non-negatively graded and connected, and if the map $A\to B$ is injective (it has to be, I think...) then $B/A$ is free as an $A$-module. It follows that the s.e.s. $0\to A\to B\to B/A\to0$ splits and that $A$ is a summand in $B$: that means you can suppose $x_1=1_B$.
To prove that $B/A$ is free, it is enough to see that $\mathrm{Tor}_1^A(K,B/A)=0$ for $K$ the residue field in the first hypothesis, and the base field in the second one. Looking at the long exact sequence for $\mathrm{Tor}_1^A(K,\mathord-)$ strongly enough does it.
Solution 2:
See this and this for counterexamples -- I guess the simplest is to take a ring $A$ and a finitely generated projective $A$-module $M$ such that (i) $M$ is not free and (ii) $A \oplus M$ is free, and set $B := A[M]$ (the trivial extension of $A$ by $M$, whose underlying $A$-module is $A \oplus M$).