Yeah that does push it a bit, but the joke is that she didn't understand what he was talking about with the 'onethirdxcubed', mis-parsing it without context. But when asked the integral, she knew the answer; not because she'd been told.
Or in the beginning she’s playing dumb in condescension to the man. The man is trying to prove a point he doesn’t believe. He’s treating her as if she is dumb and doesn’t know the answer, but she does know, and in the end proves she knows it by providing a more complete answer than even the man himself. (You have to assume she knows about the question as the man is telling her the answer.)
The version of the joke I'd heard doesn't include the waitress' attempt to meaninglessly memorize the answer. She simply nods when initially tutored, then later surprises both mathematicians that "an average person" knows how to properly solve an integration problem without any help.
The waitress is a high functioning autistic. She knows calculus, but cannot work out a mishearing of natural language in a noisy environment, and just memorizes the raw phonemes with meaningless word divisons.