# [Maxima] Substituting a value for a differential function

Jaime Villate villate at fe.up.pt
Tue Mar 27 10:46:09 CDT 2012

```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

```