We address the problem of two-dimensional heat conduction in a solid slab em-bedded with an isothermal, symmetric pipe of general cross section. Similar formula-tions have applications in continuum mechanics and electricity. The main objective of this work is to develop a Shape Optimization algorithm that will reveal the optimal shapes of the pipe such that the conduction rate is maximized or minimized. This is achieved by optimizing the Shape Factor. To obtain the Shape Factor we transform the pipe into a strip using the generalized Schwarz-Christoffel transformation, and de-velop an integral equation of the first kind for the temperature gradient using Fourier transform techniques. The integral equation is solved both numerically and anal...