On 9/17/2011 7:02 PM, Part Marty wrote:
>
>
> Dear RJF
> Thank you a reply !
> Furthermore, I want this to transform as follows.
> diff(f(g(x)),x,2)-->
> ('diff(g(x),x,2))*('diff(f(g(x)),g(x)))+('diff(g(x),x,1))^2*('diff(f(g(x)),g(x),2));
> gradef(f(x),diff(f(x),x));
> diff(f(g(x)),x,1);
> diff(f(g(x)),x,2);
> (%o1) f(x)
> (%o2) ('diff(g(x),x,1))*('diff(f(g(x))))
> (%o3)
> ('diff(g(x),x,2))*('diff(f(g(x))))+('diff(g(x),x,1))*('diff(f(g(x)),x,1))
> ------------------------------------------------------------------------
>
At first glance, your use of gradef looks like nonsense.
Also, try cutting and pasting results into mail. You have mistyped
lines %o2 and %o3.
Let's do this. call the derivative of f(x) with respect to its first
argument x, fp(x).
Like fp = f'
and also the derivative of fp wrt x as fpp. Like fpp=f''.
and just to make things compact, call derivative of g(x) wrt x, gp(x).
and deriv(gp(x),x) = gpp(x).
gradef(f(y),fp(y));
gradef(fp(y),fpp(y));
gradef(g(y),gp(y));
gradef(gp(y),gpp(y));
now diff(f(g(x)),x,2) comes out
gp(x)^2*fpp(g(x))+gpp(x)*fp(g(x))
This is what you seem to want.