I am trying to make a repeated differentiation of the differential equation and replacing the result with the previous answer. But I do not know how to substitute answer into another. I tried Merge, Join, Union, Replace and it does not work. Below is the example code,
ClearAll; x[0]=1; x'[0]=2; equation = x''[t]==x'[t]-x[t]; answer = D[equation,t] newanswer = Join[answer, equation] The answer is $x'''[t]==x''[t]-x'[t]$. I want to substitute equation in the answer or replace $x''[t]$ in the answer with $x'[t]-x[t] $ as defined in the equation so that I should get a newanswer $ x'''[t]==x'[t]-x[t]-x'[t]$. Furthermore, I should later on substitute with $ x[0]=1$ and $x'[0]=2$. What are the functions that will allow me to do operations like that? Am I defining equation and differentiating it incorrectly?