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?
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?
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.
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
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…
thanks for the solution i did not realise that restricting the domain to real was the trick
thanks for the solution i did not realise that restricting the domain to real was the trick
thanks for the solution
Try:
FindInstance[3^(2 x - 1) == 27, x, Integers]
(*{{x -> 2}}*)
thanks for the hint. it seems to work with solve, reduce and findinstance as long as the expression is followed by “integers” or “reals” which i neglected to add to the problem.
Solve[3^(2 x - 1) == 27, x, Integers]
{{x → 2}}