Consider an airport e.g. Phoenix Sky Harbor International Airport (PHX), with Maximum runway length (ft) of 11500 and Elevation (ft) of 1135. For Boeing 737 whose Maximum takeoff weight is 174,200 lbs, How do you compute the maximum/optimum temperature for takeoff
You didn't say which 737 variant and which temperature (outside? assumed for the engines?).
But it doesn't matter, for the outside temperature, you actually begin by checking the outside temperature to find out the limiting weight for said runway (length, elevation, etc.).
See image above for the 737-800 for one of the flap settings (follow the arrows).
For the assumed temperature, it will be the same for the Airbus, there is no formula, you have to use approved software or runway specific charts, see here: Is there a specific formula or way to calculate flex temperature for an Airbus A320?
Well, there is some subjectivity here, but I consider the optimum temperature for takeoff to be 72-degrees Farenheit.
As far as the outside temperature is concerned, there is no specific optimum. In general, colder is better.