In tube hydroforming (THF) of T joints, loading conditions (internal pressure and axial feeding) should be determined in such a way that the tube does not wrinkle or burst and is fully calibrated. In the current study THF of an aluminiurn T joint is simulated with the finite element method (FEM) using a commercial code. An explicit method is used to overcome convergence problems that are encountered in an implicit method. Internal pressure and axial feeding are two variables in the optimization problem and the loading path is optimized. The objective function is the clamping force, and the constraints of wrinkling, minimum thickness, and calibration should be achieved. The objective and constraint functions are obtained by training a neural network and the objective function is minimized using several optimization methods including hill-climbing search, simulated annealing, and complex method. The axial feeding and internal pressure obtained by optimization methods are used to conduct an experiment. Thickness distribution, calibration pressure, and axial feeding in experiment and FEM are compared and it is shown that there is a good agreement between them.