Using a split-valence Gaussian 4-31G basis function augmented with diffuse p and d function and multiconfiguration self-consistent-field optimized geometries, the frequency-dependent polarizability-alpha and second hyperpolarizability-gamma of ethylene, trans-butadiene, trans-hexatriene, and trans-octatetraene molecules have been calculated by the time-dependent coupled perturbed Hartree-Fock ab initio method. The calculated values of alpha and gamma are in good agreement with the corresponding gas-phase experimental values at the same fundamental wavelength. The various gamma-values corresponding to different third-order processes exhibit marked difference in their dependence on the conjugation length. For a specific fundamental frequency, the calculated gamma-value exhibits the following order: gamma(-3-omega;omega,omega,omega) > gamma(-2-omega;0,omega,omega) > gamma(-omega;omega,omega,-omega) > gamma(-omega;0,0,omega) almost-equal-to gamma(0;0,omega,-omega).