In this work, we have performed a new approach based on a combination of coordinate transformation and the finite difference method in order to investigate the electronic, linear and nonlinear optical properties of GaN/AlxGa1−xN quantum wire. The real and the imaginary parts of first-order linear and third-order nonlinear susceptibilities are investigated as a function of the quantum wire height and Aluminum mole fraction. Our calculations revealed that as the height increases, the transition energy decreases monotonically. In addition, the peaks of susceptibility decreased and shifted to the red as the height augments. Our findings can serve the experimental studies linked to practical exploitation of the quantum confinement effect in optoelectronic devices based on quantum wire nanostructures.