I am only beginning to learn to use Mathematica, and got stuck while trying to implement what is apparently a simple substitution rule.
So I have a second order ODE in f, and I want to put in the ansatz
f = r*phi, a multiplicative ansatz. I thought
ReplaceAll followed by
Simplify would do the job, but apparently this doesn't expand and simplify the derivatives. I want the replaced ODE to be in terms of r and phi only, no f, so that I can then manipulate them further. How to accomplish this?
Also, a side question, does someone know of a way to get to display the ODE in the proper form, all y'', y' and y terms grouped together? (for aesthetic purposes only)
J[k_,f_] := f''[k] +f'[k] +f[k] J[k,f] //ReplaceAll[f[k] -> r[k] phi[k]] //Simplify
The output is :
r[k] phi[k] + f'[k] + f''[k]
I want the derivatives to be expanded/evaluated too.