  We study the energetics of wake excitation during the laser-plasma
interaction in application to laser wakefield accelerators. We find that both
the wake amplitude and the accelerating efficiency (transformer ratio) can be
maximized by properly shaping the longitudinal profile of the driving laser
pulse. The corresponding family of laser pulse shapes is derived in the
nonlinear regime of laser-plasma interaction. Such shapes provide theoretical
upper limit on the magnitude of the wakefield and efficiency by allowing for
uniform photon deceleration inside the laser pulse. We also construct realistic
optimal pulse shapes that can be produced in finite-bandwidth laser systems.
