functions with diff and intergrate



Try putting ''() around the diff or integrate when defining functions.  Then it will work because the function get assigned the 
result of the diff or integrate instead of doing it, the calculation, later.


if(x):=''(integrate(something,x))
df(x):=''(diff(something,x))


(%i5) display2d:false;

(out5) false
(%i6) f(x):=(1-%e^(2*x))/(1+%e^(2*x));

(out6) f(x):=(1-%e^(2*x))/(1+%e^(2*x))
(%i7) df(x):=''(diff(f(x),x));

(out7) df(x):=-2*%e^(2*x)/(%e^(2*x)+1)-2*(1-%e^(2*x))*%e^(2*x)/(%e^(2*x)+1)^2
(%i8) integrate(df(x),x);

(out8) -log(%e^(2*x)+1)-2*(-log(%e^(2*x)+1)/2-1/(%e^(2*x)+1))
(%i9) f(1);

(out9) (1-%e^2)/(%e^2+1)
(%i10) df(1);

(out10) -2*%e^2/(%e^2+1)-2*(1-%e^2)*%e^2/(%e^2+1)^2
(%i11)


----- Original Message ----- 
From: "Hans W. Hofmann" <hawe at chefmail.de>
To: <maxima at math.utexas.edu>
Sent: Monday, September 14, 2009 4:52 AM
Subject: functions with diff and intergrate


f(x):=(1-%e^(2*x))/(1+%e^(2*x));
df(x):=diff(f(x),x)$
df(1);
(%o11) Non-variable 2nd argument to diff:1
#0: df(x=1) -- an error.  To debug this try debugmode(true);

I'm not able to calculate diff'd and intergrate'd functions
how to do?

Gru? HW

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima