The synthesis of a cardiac defibrillating pulse is cast as a standard optimal feedback control problem that minimizes a weighted measure of consumed energy and elapsed time to reach a nominal defibrillated state. The solution is developed for a general first-order system that includes the widely used parallel resistor/capacitor circuit and energy source as a special case. The novel optimal pulse comprises an exponentially ascending and a rectangular component; it is agile and energy conscious; and it therefore outperforms the waveforms developed thus far that minimize energy or time expenditures alone. Explicit time-domain expressions are derived which may be used for comparing against other commonly studied defibrillating functions. The analytic formulas and computer simulations may be useful to implement performance improvements in defibrillating devices.