Original: He died heirless in 1638, and the territories of Saxe-Gotha and Saxe-Eisenach were split between Saxe-Weimar and Saxe-Altenburg (which had itself been separated from Saxe-Weimar in 1603).
Simplified: In 1633, the Wettin line died out, and Johann Ernst inherited it, but he died heirless in 1638, and the territories of Saxe-Gotha and Saxe-Eisenach were split between Saxe-Weimar and Saxe-Altenburg.