Which way of solving this differential equation is right? For my homework assignment I need to solve the following differential equation:
$\dfrac{dT}{dt} = -p(T - T_k)$,
where $T$ stands for the temperature of the pizza, $t$ stands for time and $T_k$ stands for the temperature of the kitchen. They gave me the following information:


*

*The initial temperature of the pizza coming out of the freezer at 8pm is $-18^\circ$C. 

*The temperature of the kitchen is $20^\circ$C. 

*$p>0$
First I tried solving the differential equation by substituting $y$ for $T-T_k$ and this gave me the following answer:
$T = T_k + (T(0) - T_k)e^{-pt}$, where I can of course plug in the values of $T(0)$ and $T_k$.
But then I tried solving the differential equation by applying integration from the start, and this gave me the following answer:
$T = ce^{-pt} + T_k$, where I solved $c$ by plugging in $T(0) = -18$ and this gave me a value of $-38$ for $c$. 
After this I had to calculate the value of $p$, and I found $p=\log(38) - \log(29)$. For this question it doesn't matter what method I use because they will both give me the same answer $T = T_k - 38 e^{-pt}$, but in the following question they asked me to calculate the temperature of the kitchen in order to defrost the pizza by 9pm. This is where I get confused. When I use my first answer to the differential equation ($T = T_k + (T(0) - T_k)e^{-pt})$ I find a $T_k$ value of $58^\circ$C and when I use my second answer to the differential equation ($T = T_k -38e^{-pt}$) I find a $T_k$ value of $29^\circ$C. Which one (or maybe neither of them) is right and why? What am I doing wrong by solving the differential equation? 
 A: Notice that "$-38$" contains/hides an instance of $T_k$.  If you hide that instance, you can't actually solve for $T_k$.  To solve for $T_k$, you need to start with the form that shows all the $T_k$s that are present.
Another way of saying this:
"$T = T_k + (T(0) - T_k)\mathrm{e}^{-pt}$" is the generic equation.  It applies for any choice of $T(0)$ and $T_k$.  When you solved for $c$, you actually solved for "$c$, dependent on $T(0)$ and $T_k$".  If you change either $T(0)$ or $T_k$, you get a different $c$.  That is, particular constants in solutions depend on the parameters present in the equation, so changing the parameters changes the constants (in general -- a careful choice of parameter change would leave $c$ unchanged).
So either use the generic equation, or remember to update your $c$ when you change the parameters.
A: Both solutions to the differential equations are correct and should provide the same results. It is obvious that the kitchen temperature of $29 c$ is not realistic so redo the problem with your second formula and get the same result as you have from the first method 
