Message Boards Message Boards

0
|
5286 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:
GROUPS:

Fixed Point of E^x=Cos(x)

Posted 11 years ago

I do not understand how to find the fixed point of a problem in mathematica. I need to find the fixed point of e^x=cosx and I am stuck. If anyone understands fixed points that would be very helpful. thanks

POSTED BY: erinleigh098
5 Replies

Are you looking for solutions to that equation?

Solve[Exp[x] == Cos[x] && -10 <= x <= 10, x, Reals]

(* Out[90]= {{x -> 0}, {x -> 
   Root[{-E^#1 + Cos[#1] &, -7.8535932799712482001}]}, {x -> 
   Root[{-E^#1 + Cos[#1] &, -4.7212927588476862166}]}, {x -> 
   Root[{-E^#1 + Cos[#1] &, -1.29269571937339838117}]}} *)

Or an iterative process that finds a solution from a starting point. For that one can use e.g. Newton iterations.

FixedPointList[{#[[1]] - f[#[[1]]]/f'[#[[1]]], 
   f[#[[1]]]} &, {-.7, f[-.2]}]

(* Out[112]= {{-0.7, -0.1613358247632598}, {-2.51705989723243, \
-0.268256883493079}, {-0.7474281702634069, 
  0.8919329283107287}, {-2.007816769456799, -0.2598565433504163}, \
{-1.285388510652165, 
  0.5575233413007432}, {-1.292717416706861, -0.005005670608255908}, \
{-1.2926957195615, 0.00001490725795189052}, {-1.292695719373398, 
  1.292351226034327*10^-10}, {-1.292695719373398, \
-5.551115123125783*10^-17}, {-1.292695719373398, \
-5.551115123125783*10^-17}} *)
POSTED BY: Daniel Lichtblau

Funny thing: by accident I typed in the following

Plot[Exp[-x] == Cos[x], {x, -1, 10}, PlotLabel -> "Plot[Exp[-x]==Cos[x]]"]

enter image description here

Which is different from

Plot[{Exp[-x], Cos[x]}, {x, -1, 10},  PlotLabel -> "Plot[{Exp[-x],Cos[x]}]"]

enter image description here

Normally I would expect a == b to be a logical expression which is either True or False.

Any explanation for the strange behaviour discovered by accident?

Regards, Wolfgang

I get an empty plot in Mathemaca 10 running under Linux.

POSTED BY: Daniel Lichtblau

Must be a peculiarity of

$Version

(* Out[40]= "8.0 for Microsoft Windows (64-bit) (October 7, 2011)" *)

In 5.2 for Microsoft Windows x86 (64 bit) (June 20, 2005), which I still keep on my PC (you will remember; it is much faster doing Integrate than Version 8) I get the error message "Plot::plnr : Exp[-x] == Cos[x] is not a machine size real number at x = -1 ..." and an empty Plot which is correct.

Thanks, Daniel, for pointing out this site to me.

It seems, however, that in contrast to StackExchangeMMA Latex is not supported here. Example:

$\sqrt{1+x^2}$

Or am I doing something wrong?

I have gradually become acustomed to using it for better readability in texts.

Regards, Wolfgang

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