Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Derivative of a real function gives Complex res...' topicStudent Support Forum > General > "Derivative of a real function gives Complex res..."

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Nasser M. Abbasi
11/24/12 00:50am

f1[x_] := Sin[2*Pi*x/10] + I*Cos[2*Pi*x/20]
f2[x_] := Abs[f1[x]]
f3[x_] := f2'[x]
f3[1]
--------------------------

Assuming the above is _supposed_ to work. Then the question is how can you be asking Mathematica to take derivative of a function with respect to a number?

But to solve this, change f2'[x] to D[f2[x],x]

And now you'll get the expected result that you can't do what you are trying to do:

----------------------
In[8]:= f3[1]

During evaluation of In[8]:= General::ivar:1 is not a valid variable. >>

Out[8]= D[Sqrt[5]/2, 1]

-------------------------

--Nasser

URL: ,

Subject (listing for 'Derivative of a real function gives Complex res...')
Author Date Posted
Derivative of a real function gives Complex res... Dimanche 11/22/12 8:24pm
Re: Derivative of a real function gives Complex... Nasser M. Ab... 11/24/12 00:50am
Re: Derivative of a real function gives Complex... Sumit 11/24/12 02:03am
Re: Re: Derivative of a real function gives Com... Dimanche 11/24/12 12:03pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic