Step 1: Formula for power loss in an AC circuit.
Average power dissipated is
\[P=E_{rms}\,I_{rms}\cos\phi\]where \(\cos\phi\) is the power factor. Only the resistor consumes power, so equivalently \(P=I_{rms}^2 R\). (Pure L and C dissipate no power.)
Step 2: Combine the voltages (they are not in phase).
In a series R-L-C circuit \(V_R\) is in phase with the current, \(V_L\) leads by \(90^\circ\) and \(V_C\) lags by \(90^\circ\). Hence the source e.m.f. is the phasor sum:
\[E=\sqrt{V_R^2+(V_L-V_C)^2}\]Step 3: Substitute the given values.
\(V_R=40\) V, \(V_L=50\) V, \(V_C=20\) V.
\[E=\sqrt{40^2+(50-20)^2}=\sqrt{1600+900}=\sqrt{2500}=50\ \text{V}\]Step 4: Phase difference.
\[\tan\phi=\frac{V_L-V_C}{V_R}=\frac{50-20}{40}=\frac{30}{40}=0.75\]\[\phi=\tan^{-1}(0.75)=36.87^\circ\approx 37^\circ\]Since \(V_L>V_C\), the circuit is inductive, so the applied voltage leads the current by about \(37^\circ\).
\[\boxed{E=50\ \text{V},\ \phi\approx 37^\circ\ (\text{voltage leads current})}\]