The optimal axial distribution of gadolinium burnable poison in a pressurized water reactor is determined to yield an improved power distribution. The optimization scheme is based on Pontrya-gin’s maximum principle, with the objective function accounting for a target power distribution. The conjugate gradients optimization method is used to solve the resulting Euler-Lagrange equations iteratively, efficiently handling the high degree of nonlinearity of the problem. For the one-group, onedimensional axial core model considered, the optimal distribution of the number of burnable poison pins and gadolinium concentration yields an improved power distribution. For ten axial zones of gadolinium, the maximum power peaking factor for the cycle is reduced from 1.41 for uniform gadolinium to 1.23 for the optimal gadolinium loading, a decrease of 12.8%. The axial offset band is reduced from -12.0 to 6.5% for uniform gadolinium to -4.4 to 1.0% for the optimal gadolinium loading.