#example1:

# given function y1 = x, y2 = 3x, y3 = x^2 #equation y2 can be represented using y1 and y3 as

var('y1,y2,y3,x')

y1 = x

y2 = 3*x

y3 = x^2

# these functions are linearly dependent on any interval as

# y2 = 3y1 + 0y3 => y2 - 3y1 - 0y3 = 0

result = y2 - 3*y1 - 0*y3

print result