How can I make the function to evaluate at x=1.5 in %o5 instead of giving me the definition of the function. In general pp may involve large sequence of functions (same for tLis).
Thank you for your help.
amli
(%i1)
tLis:[1.0,2.0,3.0];
pp:[x, x^2+1];
gg:lambda([i,x],if (x>=tLis[i] and x<tLis[i+1]) then pp[i] else 0);
g:lambda([x],gg(1,x) + gg(2,x));
g(1.5);
g(2.5);
(%o1) [1.0,2.0,3.0]
(%o2) [x,x^2+1]
(%o3) lambda([i,x],if x>=tLis[i] and x<tLis[i+1] then pp[i] else 0)
(%o4) lambda([x],gg(1,x)+gg(2,x))
(%o5) x
(%o6) x^2+1