#given equations are y1 = x, y2 = x^2, y3 = x^3 on interval -1<=x<=2
#consider the equation, k1x + k2x^2 + k3x^3 = 0 , takin x = -1,1,2 (values in the interval)

var('k1,k2,k3,x')
expand(k1*x + k2*x^2 + k3*x^3 == 0)
#if x = -1,then

x = -1
k1*x + k2*x^2 + k3*x^3 # eq(1)
#if x = 1,then

x = 1
k1*x + k2*x^2 + k3*x^3 # eq(2)
#if x = 2,then

x = 2
k1*x + k2*x^2 + k3*x^3 # eq(3)
#solving eq(1),eq(2),eq(3) we get k1,k2,k3

print solve([k1+k2+k3 == 0,-k1 + k2 - k3 == 0, 2*k1 + 4*k2 + 8*k3 ==0],k1,k2,k3)

#as k1 = k2 = k3 = 0, they are linearly independent

Kreyszig-2.13-2 (last edited 2010-12-17 11:36:10 by 172)