Second-harmonic generation (SHG) of ultrashort pulse in both phase- and group-velocity mismatch structures is studied theoretically in temporal and frequency domains taking account of the effects of group-velocity dispersion (GVD) and high-order phase mismatch. Under the plane-wave and pump undepletion approximation, a set of simple analytical expressions is derived in frequency domain for Gaussian pulse. Furthermore, a formula describing the SH pulse is obtained under pump depletion condition. The obtained expressions are valid in large range of interaction length and have features such as explicit form, high accuracy, and less computing time. Meanwhile, the influences of intensity, pulse duration, chirp coefficient and shape of pump pulses, as well as the linear loss of material, on the pulsewidth preservation length are investigated by numerical method. In the case of both phase- and group-velocity mismatch structures, the conversion efficiency larger than 45% could be obtained without pulse distortion for weak input ultrashort pulse.