# Defining the derivative of a function in MAIN-App.

2 replies to this topic

### #1 c_moeller

c_moeller

Newbie

• Members
• 11 posts

• Calculators:

Posted 29 January 2004 - 05:05 PM

Hi again!

When you type the following:

define f(x)=(1/2)*x^2-4x+4
--> done.
define f1(x)=diff(f(x),x)
--> done.

What do you think is the output of f1(x)?
Yes, you're right, it is

f1(x)
--> x-4

But what do you think is the output of
f1(2)?

f1(2)
--> 0

Or f1(7)?

f1(7)
--> 0

I finally understand, why this is like it is,
but how can I get the derivative defined
by a sinlge line?

Thankx, Christian

### #2 c_moeller

c_moeller

Newbie

• Members
• 11 posts

• Calculators:

Posted 03 February 2004 - 06:17 PM

After having contacted the Casio-Servicecenter twice, I have to claim that there is no solution for defining the derivative of a function by a single line. You have to do it as follows:

define f(x)=x^2-4x+4
--> done
diff(f(x),x)
--> 2x-4
define f1(x)=2x-4
--> done

Now there is the projected answer for

f1(7)
--> 10

I want them to have this changed, I hope they'll do it in a future version...

CU, Christian

### #3 BiTwhise

BiTwhise

Casio Overgod

• [Legends]
• 627 posts
• Gender:Male
• Location:Guildford, Surry, UK
• Interests:Programming, games, consoles, martial arts

• Calculators:

Posted 03 February 2004 - 06:43 PM

The way it is laid out already is more correct..
All instances of the variable 'x' will be substituted with your parameter to the function.

If you want to work around this, you can do something like the following (taking your example):

define f(x)=x^2-4x+4

then,

define f1(a)=diff(f(x),x) | x=a

now, this should produce your decired result
x will not be replaced in the function, and the differentiation will be evaluated with respect to 'x' as normal,
then the result of the differentiation will have its 'x' component replaced with your input 'a', producing your final answer.

To avoid performing the same differentiation every time you call the function, you should do it the way suggested by casio

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users