Re: A question on Newton's Method



James Van Buskirk wrote:
> "Jon Harrop" <usenet@xxxxxxxxxxxxxx> wrote in message
> news:42500867$0$63445$ed2e19e4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> What is Lisp-like about Mathematica and OCaml?
>
> They are equally incomprehensible.

Really? Have you considered the Fortran equivalent of my numerical analysis
example? How about some other examples? Can you design a single example of
numerical analysis which is more comprehensible in Fortran?

>> Yes it does:
>
>> In[1]:= f[x_] = x^3 - x - 1
>
>> Out[1]= -1 - x + x^3
>
>> In[2]:= D[f[x], x]
>
>> Out[2]= -1 + 3 x^2
>
> No, the right context is:
>
> f[x_] := x^3-x-1
> fp[x_] := D[f[x],x]
> Plot[fp,{x,-1,2}]
>
> Which, unless they changed Mathematica recently, doesn't
> do anything useful.

Of course not, it's wrong.

Firstly, there's no point in defining fp[x] when you can just use f'[x].
Secondly, you need to give the plot function an expression to plot, not a
function. So you want:

Plot[f'[x], {x, -1, 2}]

which works perfectly.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages

  • Re: A question on Newtons Method
    ... Have you considered the Fortran equivalent of my numerical ... > Secondly, you need to give the plot function an expression to plot, not a ... referring to the original function So ... have an excellent example of the true horror of Mathematica! ...
    (sci.math.num-analysis)
  • Re: A question on Newtons Method
    ... >> numerical analysis. ... What is Lisp-like about Mathematica and OCaml? ... language for a beginner to learn than Fortran because it lets you ... in Mathematica you can find the root of fsymbolically: ...
    (sci.math.num-analysis)