To solve the heat equation subject to a periodic input, we apply the trick proposed by Helmholtz.
Here is the Maple worksheet: