A method for solving the inverse problem of frequency tripling, i.e., how to calculate the shape of the fundamental field (1ω), and how to obtain the required 1ω pulse by pulses stacking method for a given shape of the third-harmonic field (3ω), was proposed. Based on some numerical techniques such as split-step Fourier transform and fourth-order Runge-Kutta, the quantitative relation between the input 1ω intensity and the output 3ω intensity was obtained by curve fitting method.Taking the shaping pulse with a certain shape as the required output 3ω pulse, the corresponding shape of the 1ω pulse can be determined by the inverse calculation. Furthermore, the parameters of the pulse stacker, such as attenuation and time delay, etc, were worked out. Consequently, the temporal pulse shaping for 1ω pulse can been realized, leading to the realization of the required output 3 pulse.The results indicate that the inverse problem can be solved quickly and precisely with the method proposed in this paper, and this method is useful for pulse shaping of frequency tripling.