This simple minded approach seems to work for me:

sage: a(x)=2*x
sage: b(x)=a(x)^2
sage: g(x)=diff(b(x),x)
sage: g(2)
  16

-Alasdair


On Jan 21, 2:14 am, Stochastix <laurent.decreusef...@gmail.com> wrote:
> I have the following problem : I have two nested functions
>
> a=lambda x: 2*x
> b=lambda x: a(x)^2
>
> Everything goes well as long as I want to compute the derivative of b
> but how can I evaluate this derivative at x=2.
> I tried
>
> g=lambda x: diff(b(x),x)
> g(x) returns 8*x as expected
>
> but g(2)=0.
>
> In other words, how can we substitute x=2 to the expression 8*x ?
>  I guess this is somewhere in the docs but I didn't find where.
-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to