Subject: Substituting a value for a differential function
From: Jaime Villate
Date: Tue, 27 Mar 2012 16:46:09 +0100
On 03/27/2012 04:33 PM, Vishnu Rajasekharan wrote:
> I have a function below. I am trying to subsitute t=25 in the dC(t)
> and I am getting an error. Please let me know what I missing ot get
> the value of the differential function.
> C(t):=(Ax^2)+(Bx)+C
> dC(t):=(diff(C(t),t,1))$
Hi,
there are several things that you must have in mind here:
1) I think you meant A*x^2 and B*x instead of Ax^2 and Bx.
2) I think you meant t instead of x in the definition of C(t).
3) The operator := does not calculate the right side before defining the
function. That means
that when you try to replace t=15, that substitution will be made before
the function is differentiated.
Try it this way:
(%i2) define (C(t), A*t^2+ B*t+C);
(%o2) C(t):=C+t*B+t^2*A
(%i3) define (dC(t), diff(C(t),t));
(%o3) dC(t):=B+2*t*A
(%i4) dC(15);
(%o4) B+30*A
define(f(x), exp) is similar to :=, but the exp will be simplified
before f(x) is defined. In some cases
one needs := and in some other cases define().
Cheers,
Jaime