DSolve Second order ODE's

Is there a way to use DSolve or some other mathematica function to show the first integration before getting to the final output. For example;

DSolve[f''[x] == 0, f[x],x]


Has an output of f[x]-> C[1] + x C[2]

But what if I want to get the first order as well f'[x], mathematica skips past this and shows the final answer. Is there anyway to get both f'[x] and f[x]

• What would you want Mathematica to show for a different equation, like f''[x] == - f[x]? If all you're interested in is the final value of f'[x], then @ChipHurst's answer is what you need. But if you want a "intermediate step" that would be part of a solution, that's going to be a lot harder; there are many different techniques used to solve ODEs by hand, and not all of them even yield a value for f'[x] as an intermediate step. – Michael Seifert Sep 23 '16 at 15:34
• @MichaelSeifert and Wolfram|Alpha can show the steps to solving an ODE. – Chip Hurst Sep 23 '16 at 15:42
• I would be interested in f'[x] for problems where I have certain boundary conditions. for example f'[0] = 0 and f'[t1]=f[t2]. I would need f'[x] to find out what the constant C[1} equals at f'[x]. – IAQ Sep 23 '16 at 16:43
• In case you're not aware, Mathematica can handle boundary conditions. For example, your problem with the given boundary conditions would be solved by the command DSolve[{f''[x] == 0, f'[0] == 0, f'[t1] == f[t2]}, f[x], x]. (The only answer is f[x] -> 0 in that particular case, but a more general value for f'[0] gives more interesting results.) – Michael Seifert Sep 23 '16 at 17:18

You can find f'[x] after the fact:
{f'[x], f[x]} /. DSolve[f''[x] == 0, f, x]

{{C[2], C[1] + x C[2]}}

DSolve[{f''[x] == 0, f'[x] == g[x]}, {f[x], g[x]}, x]