When I compute the following (with Mathematica 11.2):
Solve[(1 + r)^81 == 1.45, r]
I get a long list of solutions, all negative reals and complex numbers, apart from the one positive real answer I was expecting.
The solution list begins…
{{r -> -4.46763}, {r -> -4.45283}, {r -> -4.30803}, {r -> -4.11268}, {r -> -3.94294}....etc.
These values of r do not even remotely solve the equation, as far as I can see. Apart from anything else, they make the LHS negative, so it cannot be equal to the RHS, which is positive.
What is the meaning of these solutions? Is this just a bug in Mathematica? Or is there some sense in which they are solutions?
Yes, this is strange! To eliminate complex solutions, you coud compute:
Res = Solve[(1 + r)^81 == 1.45, r, Reals]
Map[1.45 - (1 + r)^81 /. # &, Res] // Chop
which gives r=-1 as a multiple solution and, finally, the correct one : 0.00459774. To avoid problems of precision, I tried:
Res = Solve[(1 + r)^81 == Rationalize[1.45], r, Reals]
then Mathematica give an unique solution (a pure fonction). But I don’t have any explanation!
sghuisman
(Sander Huisman)
February 5, 2018, 3:33pm
3
One needs much more precision for these high powers. For all the complex solutions use:
Solve[(1 + r)^81 == 1.45`40, r]
Or for the real solution:
Solve[(1 + r)^81 == 1.45`40, r, Reals]
where 40 is the number of digits which should be high here for these high powers (81!).
Thank you very much. That provides a little more insight.
Some further observations
Solve[(1 + r)^n == C, r]
gives n solutions. E.g. there are 81 solutions in the example above.
Solve[(1 + r)^4 == 1, r]
gives
{{r -> -2}, {r -> -1 - i}, {r -> -1 + i}, {r -> 0}}
which are in fact all valid solutions, in this case.
Ah, I see. So those negative reals are artefacts of the lack of precision, and should be complex. Thank you.
hdolhaine
(Hans Dolhaine)
February 6, 2018, 11:10am
7
What about 1 + r = x; x^81 == 1.45 , so
In[16]:= x = N[Power[1.45`30, (81)^-1], 30]
Out[16]= 1.00459774172863829263717967674
and then r = x - 1