# Solve mixed power and exponential algebraic equation?

Posted 9 months ago
1315 Views
|
10 Replies
|
3 Total Likes
|
 Hello, I wanted to solve the function: 9^(3 x) - 12 x^x + 45 x^3 - 66 = 0 wolfram alpha gave to answers: 726.5.11... and 0.6... only one of them is true, this can be checked by using Newton raphson method to find al the roots, according to newton's method, no matter what value I choose it convergences to 0.6, I believe that is the way and the only possible way wolfram can solve such equations, and one of the numerical methods for unknown reason convergence to 726...
10 Replies
Sort By:
Posted 9 months ago
 Your equation is so convoluted that I'm not surprised, and you should be happy it found the 0.6 answer.
Posted 9 months ago
 @max ron: Maybe you should consider the following: f[x_] := 9^(3 x) - 12 x^x + 45 x^3 - 66 Sign[f[Rationalize[726.5105]]] (* 1 *) Sign[f[Rationalize[726.5110]]] (* -1 *) Between a positive value and a negative value there's got to be a zero.
Posted 9 months ago
 Ok, Wolfram Alpha gave the correct root, 0.630231, but also gave the bogus root of about 726. Just plotting the equation shows that the second root is an error.However, I used Mathematica, and used FindRoot[] rather than Solve[] or NSolve[], due to the complexity of the expression. It came up with the single root, 0.630231 (approximately), and no other in the reals. The function is only defined for x>0.I clicked on the cloud icon in W|A and got the code that it tried for Solve, Reduce and NReduce, none of which gave the second result. (These functions also did not give the first, correct result.)Back in Mathematica, changing the method for FindRoot[] also failed to find a root.SO, I believe that there is no bug in Mathematica itself. I already sent feedback to Wolfram Alpha about this.The first course of action with problems with Wolfram|Alpha should be to provide feedback on the W|A page. They usually respond fairly quickly.Also, before the Moderation team responds, it is generally bad form on this forum to announce a bug the way you did, especially with no context.
Posted 9 months ago
 @George Woodrow III: 9^(3 x) - 12 x^x + 45 x^3 - 66 /. x->726 is positive and 9^(3 x) - 12 x^x + 45 x^3 - 66 /. x->727 is negative. Would there not need to be a value of zero somewhere between 726 and 727 ?Jim
Posted 9 months ago
 Yes indeed there would: FindRoot[9^(3 x) - 12 x^x + 45 x^3 - 66, {x, 727} ] {x -> 726.511} 
Posted 9 months ago
 missed that. The curve is really steep.
Posted 9 months ago
 I think that Jim's argument is quite correct. It looks as if we need a dramatically increased WorkingPrecision here: sol = FindRoot[9^(3 x) - 12 x^x + 45 x^3 - 66 == 0, {x, 726.509, 726.513}, MaxIterations -> 1000000, WorkingPrecision -> 10000] This is only the first part of the solution! With that we get: 9^(3 x) - 12 x^x + 45 x^3 - 66 /. sol (*0.*10^-7917*) which is a numerical zero. The function is just quite steep at that point. N[D[9^(3 x) - 12 x^x + 45 x^3 - 66, x] /. sol, 10] (*-6.325431641*10^2079*) Best wishes, Marco
Posted 9 months ago
 This is all very interesting. I never had to set Max iterations or working precision that high before.It would have been good for users if Wolfram Alpha had explained how it got the numbers. The code shown simply does not do the job -- it did not use FindRoot[] or discuss setting MaxIterations or Working Precision to very high values.The value of the slope explains why plotting the function near the second solution yielded nothing.
 I think that your argument is quite correct. For sufficiently large x the term $-12 x^x$ will dominate the expression. Limit[9^(3 x) - 12 x^x + 45 x^3 - 66, x -> Infinity] is negative infinity. In fact, as you say the only terms that are consequential for this zero are the first two. We can get a first estimation of the position of the zero if we observe that $9^{3x}=9^3^x=729^x$. So the question is when this term is more or less as large as the $-12 x^x$. if we forget the -12 for a second that would happen at $x \approx 729$. This is of course a wee bit imprecise because of the 12, but we are relatively close to 726. Let's make this a bit more precise. We only use the relevant terms and ask when does: $9^{3x}=12 x^x$as before $$729^x=12 x^x$$ $$729^x=12^{1/x}^x x^x$$ $$729^x=(12^{1/x} x)^x$$this is obviously true when $$729 = (12^{1/x} x)$$Which is an easy one for Mathematica: sols = Solve[(9^3) == 12^(1/x) x, x] We are interested in the first solution - the one close(r) to 729. N[x /. sols[[1]], 20] gives 726.51083890096132690, which is identical to the first digits of the "full" solution 726.51083890096132690 Mathematica obtains in one of my posts above. BTW, many more digits are correct. Certainly the first 2000. Cheers,Marco