Mathematica Solving equation with mathematica

  • Thread starter Thread starter yashar
  • Start date Start date
  • Tags Tags
    Maple Mathematica
Click For Summary
The equation a/x = Cosh[b/x] cannot be solved using NSolve in Mathematica, as it is not a polynomial equation. Instead, FindRoot is recommended, but it may yield incorrect results, indicating that the function f(x) = Cosh(5/x) - 1/x is asymptotic to the x-axis and likely has no real roots. Plotting the function suggests that there are no real solutions, contradicting results obtained from Maple. For complex roots, the new FindInstance function can be utilized, and FindRoot can also accept complex initial values to search for complex solutions. Ultimately, the discussion highlights the limitations of Mathematica for this specific equation and offers alternative methods for exploring solutions.
yashar
Messages
31
Reaction score
0
hi
i want to solve this equation
a/x=Cosh[b/x]

i set a=1 and b=5
and use NSolve code but mathematica say it can not solve it. but with maple i get real and imaginary parts.
1-is there another method to solve this equation numerically?
2-can this equation be solve for arbitrary a and b?

thanks
 
Last edited:
Physics news on Phys.org
NSolve is only for polynomial equations. Use FindRoot instead.
 
it gives me x=25.16 which is incorrect!
 
If you rewrite the expression so that COSH(5/x) - 1/x = 0 = f(x) and plot, you will see that f(x) is asymptotic with the x axis. Therefore, there is no x value for which f(x) = 0
 
Plotting it it seems that it does not have any real roots. So I think Maple is wrong, there are no real roots.

PS. SteamKing got it faster!
 
I just found a new function: FindInstance. You can use it to find complex roots. Also, apparently you can specify a complex number for your initial value in FindRoot and it will search for a complex root, which I didn't know before.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K