So we get that one-half m vA squared equals one-half m vB squared minus one-half k x of B squared-- that is the potential energy at this location-- and that equals one-half k x of C, which we have called x max, squared, and you are in business. 