The study of sound propagation inside the ducts finds extensive application in aerospace, automobiles, speech, and biomedical sectors. This paper presents a neural network-based formulation to estimate the acoustic field inside a uniform duct with temperature gradient along the axial direction. The governing differential equation is derived from the momentum, energy, and state equations. The acoustic field is approximated with a feedforward neural network, and the problem is converted to an unconstrained optimization problem using the trial solution method. The training process is performed using the L-BFGS optimizer and the sine activation function. The acoustic field inside the duct is predicted up to 2000 Hz for linear and exponential temperature profiles. The predicted results are in good agreement with those obtained from the traditional Range-Kutta solver with a maximum relative error of 0.1%. Furthermore, the classical Helmholtz equation without the temperature gradient is solved using the developed neural network formulation. Using these results, a comparative study is conducted to understand the effect of the temperature gradient on the acoustic field inside the duct.