The rapid spread of the use of high-density polyethylene (HDPE) pipes is due to the wide variety of methods for connecting them. This study keeps pace with the developments of butt fusion welding of HDPE pipes by exploring the relationship between the performance of the weld joints by studying ultimate tensile strength and exploring the joint welding profiles by studying the shape of the joint at the outer surface of the pipe (height and width of the joint cap) and the shape of the joint at the internal surface (height and width of the joint root). Welding pressure, heater temperature, stocking time, and cooling time were the parameters for the welding process. Regression was analyzed using ANOVA, and an ANN was used to analyze the experimental results and predict the outputs. Two optimization techniques (pattern search and genetic algorithm) were applied to obtain the ideal operating conditions and compare their performance. The results showed that pattern search and genetic algorithms can determine the optimal output results and corresponding welding parameters. In comparison between the two methods, pattern search has a limited relative advantage. The optimal values for the obtained outputs revolved around a tensile strength of 35 MPa (3.45 and 4.5 mm for the cap and root heights, and 8 and 6.98 mm for the cap and root widths, respectively). When comparing the effects of welding parameters on the results, welding pressure had the best effect on tensile strength, and plate surface temperature had the most significant effect on the welding profile geometries.