Through the application of a Dirichlet boundary condition and under an additional integral-type condition, the recovery of the time-dependent coefficient in a one -dimensional parabolic equation is investigated in this paper. When data is entered, the solution is affected to a precarious status during exposure to random errors and noise. The Crank-Nicolson finite difference approach is implemented for the direct solution of the problem, while nonlinear numerical optimization is employed for the inverse problem. lsqnonlin, the MATLAB routine optimization tool, is applied to compute the last problem. The Tikhonov regularization approach must be used to produce smooth, stable answers. The evaluation and comparison with their identical answers were performed by running the root mean square error formula. It conclude that, the numerical results are consistent and accurate.