ETP = (D x GSret)/(GSret + GSFWD)
D = total distance for flight
GSret = ground speed from the ETP back to the orgin
GSfwd = ground speed from the ETP to the destination
ETP = distance from the departure airport to the ETP
Don't forget your wind shift and wet footprint.
Thank goodness todays computer generated flight plans(CFP) caculate all this for you. They also calculate for the senario of an engine loss, which would produce a driftdown to a lower altitude, with different fuel burns at same and lower speeds.