Analytical solutions for the transient and steady-state responses of linear time-invariant networks