1
$\begingroup$

I tend to store all of my equations as functions so that I can easily use or refer to them later if needed. However, it seems that Solve doesn't work on these.

[IN]   Solve[3 x + 5 == 11, x]

[OUT]  {{x -> 2}}

This is the expected behavior. But when I try to use a function,

[IN]   f[x_] = 3 x + 5
       f[2] (* Function is correctly definied *)
       Solve[f[x] == 11, x] (* Should result in {x -> 2} *)

[OUT]  5 + 3 x
       11
       {}

The solution set is empty. I know there is an RSolve but I don't think this is what I want, as I'm simply trying to substitute the equation for the function, not find a solution that is a function.

$\endgroup$
2
  • $\begingroup$ @Moo Could you post exactly what you entered? I'm running MMA 10 on Win7. I'm not sure what you mean by "Enter f[x] on its own line first". Even if I evaluate the line with the function definition before using it in Solve I get the same result. $\endgroup$
    – Brian H.
    Commented Sep 4, 2016 at 20:54
  • $\begingroup$ @Moo I think I found the problem. f[x] was evaluating to 0, even after I assigned it an expression. Entering Clear[f] seemed to correct it. I'm not sure what I had done to cause me to be unable to change the expression stored in f. Does the := do something different than =?. Thanks. $\endgroup$
    – Brian H.
    Commented Sep 4, 2016 at 21:01

0

Browse other questions tagged or ask your own question.