0
|
14129 Views
|
8 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# [?] Use Solve to get an integer solution?

Posted 7 years ago
 How do I get Mathematica to solve 3^(2x-1)=27 . if i type Solve[3^(2x-1)==27,x]  I get a complex response which is obviously wrong since the answer is 3?
8 Replies
Sort By:
Posted 7 years ago
 Try:  FindInstance[3^(2 x - 1) == 27, x, Integers] (*{{x -> 2}}*) 
Posted 7 years ago
Posted 7 years ago
 thanks for the solution i did not realise that restricting the domain to real was the trick
Posted 7 years ago
 There are actually an infinite number of answers, but only one that is real (as said above). ConditionalExpression[1/2 (1 + (2 I \[Pi] C[1])/Log[3] + Log[27]/Log[3]), C[1] \[Element] Integers] This basically means that x can be the above expression for every choice of C[1] as an integer. C[1] = 0 corresponds to x = 2. The only Real solution...
Posted 7 years ago
 thanks for the solution
Posted 7 years ago
 You may use also the function Reduce[]: In[1]:= Reduce[3^(2 x - 1) == 27, x, Integers] Reduce[3^(2 x - 1) == 27, x, Reals] Out[1]= x == 2 Out[2]= x == 2 
Posted 7 years ago
 Try Solve[3^(2x-1)==27,x,Integers] or Solve[3^(2x-1)==27,x,Reals], it gives you 2, which should be the answer.
Posted 7 years ago
 thanks for the solution i did not realise that restricting the domain to real was the trick