I try to do the Example 5.2.3. provided here as follows:
In[252]:= (*
Example 5.2.3.
*)
Clear[p, x];
B = {1 - x, x + 3 x^2, 2 - x^2}
P = B // CoefficientArrays[#, x] & // Normal // Flatten //
ArrayReshape[#, {Length[B], Length[B]}] &
T1[p_] := (p /. p -> 0 ) (1 + x^2) + (p /. p -> 1) x
Tpx = T1 /@ B // Simplify
Out[253]= {1 - x, x + 3 x^2, 2 - x^2}
Out[254]= {{1, 0, 2}, {-1, 1, 0}, {0, 3, -1}}
Out[256]= {x, x, x}
The expected output of the last command should be as follows, but I didn't get it:
Any tips for solving this problem?
Regards,
Zhao