A trial wave function is an assumed mathematical representation of a quantum state used in variational methods to approximate the true wave function of a system. It serves as a starting point to evaluate the energy of a quantum system and helps in finding the ground state energy by minimizing the expectation value of the Hamiltonian with respect to this function. This approach is key in perturbation theory and the variational principle, as it allows for approximations when dealing with complex systems.