A thin rod having a length Lo at 0°C and coefficient of linear expansion  α has its two ends maintained at temperatures θ1 and θ2 respectively. Find its new length.

Hint: The length of the rod will increase due to the temperature difference at its two ends.
Consider the diagram,
                                 
Step 1: Find the median temperature of the rod.
Let the temperature varies linearly in the rod from one end to another end. Let θ be the
the temperature of the mid-point of the rod. At a steady-state,
Rate of flow of heat,
                   dQdt=KA(θ1-θ)(L0/2)=KA(θ-θ2)(L0/2)
where K is the coefficient of thermal conductivity of the rod.
or                      θ1-θ=θ-θ2
or                       θ=θ1+θ22
Step 2: Find the final length of the rod.
Using relation,                    L=L0(1+αθ)
or                                      L=L01+αθ1+θ22