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 ansatzf = 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)
The code:
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.
f''[k] + f'[k] + f[k] /. f -> Function[k, r[k] phi[k]]. – J. M.'s missing motivation Jul 23 '16 at 21:03Jset up so thatfhas to be a (pure-ish) function. – Michael E2 Jul 24 '16 at 00:02