Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have an expression that Mathematica decides to return in the general form:

y =  f ( a/f + b/Sqrt[f + 2] + c*f^2/Sqrt[f + 2])

(actually my expression is much longer and the coefficients a, b, c are more complicated). Ultimately I want to set f to zero, however if I do it using y /. f -> 0 Mathematica returns Indeterminate. Obviously from the form of the equation this is incorrect, since y is well defined in this case. Use of functions such as Limit, Expand etc are basically out the questions since I'd like to keep the coefficients a, b, c as they are (and they are too complicated to think of inputing them into a Hold function. Is there a way that I can force Mathematica to simply multiply through by f, so that I can use Replace?

Thanks a lot in advance for your help.

share|improve this question

closed as off-topic by Artes, m_goldberg, Yves Klett, Michael E2, rm -rf Mar 11 '14 at 1:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Artes, m_goldberg, Yves Klett, Michael E2, rm -rf
If this question can be reworded to fit the rules in the help center, please edit the question.

See Simplify[f (a/f + b/Sqrt[f + 2] + c*f^2/Sqrt[f + 2]), f > 0]. –  Artes Mar 10 '14 at 17:32
I'm not sure why you have all voted to put this question on hold. The example given above is a greatly simplified version of my actual solution. There is no typographical/syntax error here. If the answer were easily found in the documentation I would have found it. –  Matthew Mar 11 '14 at 8:01
So I found the following related article <mathematica.stackexchange.com/questions/18559/…;. It goes some way to explaining my problem. Just so anyone finding this article realises that this can be an issue. –  Matthew Mar 11 '14 at 13:19

1 Answer 1

Along the lines of Artes comment

Simplify[f (a/f + b/Sqrt[f + 2] + c*f^2/Sqrt[f + 2]), f != 0]

a+(f (b + c f^2))/Sqrt[2 + f]

share|improve this answer
Just using Simplify here would also achieve the same result. This however affects the coefficients a, b and c, which I don't want Mathematica to do. I can force Mathematica to cancel the factor using Expand but this gives an wholey unmanageable result, which Mathematica then fails to simplify again i.e. Simplify[Expand[y]] does not give a+(f (b + c f^2))/Sqrt[2 + f] for my case. –  Matthew Mar 11 '14 at 8:02

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