Message Boards Message Boards

0
|
9715 Views
|
10 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Solve mixed power and exponential algebraic equation?

Posted 6 years ago

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...

POSTED BY: max ron
10 Replies

Your equation is so convoluted that I'm not surprised, and you should be happy it found the 0.6 answer.

Posted 6 years 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 BY: Jim Baldwin

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 6 years 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 BY: Jim Baldwin
Posted 6 years ago

Yes indeed there would:

FindRoot[9^(3 x) - 12 x^x + 45 x^3 - 66,  {x, 727}  ]

{x -> 726.511}
POSTED BY: b3m2a1 ​ 

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]

enter image description here

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 BY: Marco Thiel

missed that. The curve is really steep.

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.

The last terms are of no consequence to the overall shape of the curve. What we have is the contention between the 9^(3x) term and the -12 x^x term for dominance. Below 727, the first term dominates, but then it is then overtaken by the second. I knew that the x^x term was going to win in the long term, but I didn't think it would take that long or be so 'sudden' in terms of the numbers.

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]

enter image description here

We are interested in the first solution - the one close(r) to 729.

enter image description here

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

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract