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.
In[1]: Solve[{(1 + k)^n == 0.6, (1 + k)^(n + 1) == 0.3}, {n, k}]

Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

Out[1]: {{n -> 0.736966, k -> -0.5}}

In[2]: Solve[{2*(1 + k)^n == 1.2, (1 + k)^(n + 1) == 0.3}, {n, k}]

Solve::inex: Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve require exact input, providing Solve with an exact version of the system may help. >>

Out[2]: Solve[{2 (1 + k)^n == 1.2, (1 + k)^(1 + n) == 0.3}, {n, k}]

Where is the problem with Mathematica, not able to divide by 2 in first equation?

share|improve this question
    
I don't know why the second system wasn't amenable to Solve (perhaps representation error in the decimal 1.2, which results in a rationalized form not equal to 12/10). But that second system is amenable to Reduce. –  murray Mar 19 at 15:49

2 Answers 2

You can tell Solve to use Reduce, Reference to Solve

Solve[{2*(1 + k)^n == 1.2, (1 + k)^(n + 1) == 0.3}, {n, k}, 
Method -> Reduce]
(*{{n -> ConditionalExpression[-1.4427 (-0.510826 + (0. + 6.28319 I) C[
     1]), C[1] \[Element] Integers], 
      k -> ConditionalExpression[-0.5, C[1] \[Element] Integers]}}*)
share|improve this answer
Solve[Rationalize@{2*(1 + k)^n == 1.2, (1 + k)^(n + 1) == 0.3}, {n,  k}, Reals]
(*
 {{n -> (-Log[3] + Log[5])/Log[2], k -> -(1/2)}}
*)

or:

Solve[{2*(1 + k)^n == 1.2, (1 + k)^(n + 1) == 0.3}, {n, k}, Reals]
(*
 {{n -> 0.736966, k -> -0.5}}
*)
share|improve this answer
    
The answers so far don't explain why merely doubling each side of the first of the two equations converts a system that Solve can handle to a system that it cannot. –  murray Mar 19 at 19:17
    
@murray I believe your comment on the question is right. Solve[] found both an exact (2) and an inexact (1.2) number on the same equation, and without specifying the domain (Reals) it doesn't know how to proceed –  belisarius Mar 19 at 19:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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