A new biography by AN Wilson shows how the playwright, poet, scientist and statesman poured himself into his greatest work.