Help differentiating composite functions



osman, you seem to misunderstand the nature of the problem. I'm trying to
differentiate something like f(x[n]+c[3]*h,y[n]+a[3,1]*h*k[1]+a[3,2]*h*k[2])
where f is a generic function. Indeed, your first example seems to be the
complete opposite of what I want to do, where x(t) and y(t) are generic and
f is specific.

On Tue, Jun 29, 2010 at 07:11, osman <osman at fuse.net> wrote:

> On Mon, 2010-06-28 at 15:25 -0400, Jeffrey Hankins wrote:
> > Hey, there's something I can't do in Maxima. I cannot differentiate
> > things like f(g(t),h(t)) where f is a generic function and g and h are
> > specific functions. If the depends tag is used, it will differentiate
> > f with no arguments, but it will not differentiate something like
> > f(t^2+1,t^3) with respect to t. Is there anything I can do?
>
> (%i1) depends([x,y],t);
> (%o1)                            [x(t), y(t)]
> (%i2) diff(sqrt(x(t)^2+y(t)^2),t);
>                            d                    d
>                    2 y(t) (-- (y(t))) + 2 x(t) (-- (x(t)))
>                            dt                   dt
> (%o2)               ---------------------------------------
>                                     2       2
>                             2 sqrt(y (t) + x (t))
> (%i3) f(x,y):=sin(x+y);
> (%o3)                        f(x, y) := sin(x + y)
> (%i4) diff(f(x(t),y(t)),t);
>                    d           d
> (%o4)              (-- (y(t)) + -- (x(t))) cos(y(t) + x(t))
>                    dt          dt
> (%i5)
> Seems to work for these examples.
> -osman
>
>