i have a code which gives an output of this kind:


Now i define a simple function:

  1. How should i do if i want the variable f to be replaced by the function f[x_] ?
  2. If i want to do the inverse process: from the function f[x_] to f ?

1 Answer 1

rrr2 = rrr /. f -> f[x]

1 + 2 (2 + 3 x)

rrr2 /. f[x] -> f

1 + 2 f

  • $\begingroup$ ah yes using conditions, i did not try in this way. Thanks $\endgroup$
    – siderius
    Oct 24, 2018 at 22:34
  • 1
    $\begingroup$ @siderius -- these are not "conditions" --- the command /. is a short form of ReplaceAll, which is exactly what you are asking for, to replace f with f[x] or vice versa. $\endgroup$
    – bill s
    Oct 25, 2018 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.