def function1(x) : return (P[0,0]*phi1(0,1.,x)+P[0,1]*phi2(0,1.,x));
def function2(x) : return (P[1,0]*phi1(0,1.,x)+P[1,1]*phi2(0,1.,x));
def function1sq(x) : return (function1(x))^2;
def function2sq(x) : return (function2(x))^2;
g = Graphics()
g += plot(function1, (x,-5,5),color="blue",linestyle="dashed")
g += plot(function2, (x,-5, 5),color="red",linestyle="dashed")
g += plot(function1sq, (x,-5,5),color="blue")
g += plot(function2sq, (x,-5, 5),color="red")
g.show()