# linearComb -- generic linear combination of elements

## Synopsis

• Usage:
linearComb(L,varName)
• Inputs:
• Outputs:
• an instance of the type DiffAlgElement, generic linear combination of the list L

## Description

This routine produce a generic linear combination of the elements in L. It can be used together with genKer or genIm to solve a system of homogeneous linear equations.

In this example we compute a generic and a particular linear combination of two particular differential 2-forms.

 i1 : w = random newForm(2,1,2,"a") 2 2 2 2 o1 = (2x - 2x x + 6x - 3x x + 6x x )dx + (- 7x + 5x x - x - 2x x - 0 0 1 1 0 2 1 2 0 0 0 1 1 0 2 ------------------------------------------------------------------------ 2 2 2 2 x x + x )dx + (- 3x - 4x x + 7x + 2x x - 7x x - 3x )dx 1 2 2 1 0 0 1 1 0 2 1 2 2 2 o1 : DiffAlgForm i2 : h = random newForm(2,1,2,"a") 2 2 2 2 2 o2 = (x + 7x x + 3x + 2x x + x x + 8x )dx + (- x - 4x - 7x x - x x 0 0 1 1 0 2 1 2 2 0 0 1 0 2 1 2 ------------------------------------------------------------------------ 2 2 2 2 - x )dx + (3x - 4x x + 7x - 5x x + x )dx 2 1 0 0 1 1 0 2 2 2 o2 : DiffAlgForm i3 : linearComb({w,h},"a") 2 2 o3 = ((2a + a )x + (- 2a + 7a )x x + (6a + 3a )x + (- 3a + 2a )x x + 0 1 0 0 1 0 1 0 1 1 0 1 0 2 ------------------------------------------------------------------------ 2 2 2 (6a + a )x x + 8a x )dx + ((- 7a - a )x + 5a x x + (- a - 4a )x 0 1 1 2 1 2 0 0 1 0 0 0 1 0 1 1 ------------------------------------------------------------------------ 2 + (- 2a - 7a )x x + (- a - a )x x + (a - a )x )dx + ((- 3a + 0 1 0 2 0 1 1 2 0 1 2 1 0 ------------------------------------------------------------------------ 2 2 3a )x + (- 4a - 4a )x x + (7a + 7a )x + (2a - 5a )x x - 7a x x + 1 0 0 1 0 1 0 1 1 0 1 0 2 0 1 2 ------------------------------------------------------------------------ 2 (- 3a + a )x )dx 0 1 2 2 o3 : DiffAlgForm i4 : random oo 2 2 2 2 o4 = (6x + 10x x + 18x - 2x x + 14x x + 16x )dx + (- 16x + 10x x - 0 0 1 1 0 2 1 2 2 0 0 0 1 ------------------------------------------------------------------------ 2 2 2 10x - 18x x - 4x x )dx + (- 16x x + 28x - 6x x - 14x x - 4x )dx 1 0 2 1 2 1 0 1 1 0 2 1 2 2 2 o4 : DiffAlgForm

In this example we compute a generic differential 1-form that descends to the projective plane. Then, we impose another linear condition.

 i5 : w = newForm(2,1,2,"a"); i6 : h = random newForm(2,2,1,"a"); i7 : L = genKer( (radial 2) _ w,w) 2 2 2 o7 = {x x dx - x dx , x x dx - x dx , x x dx - x x dx , x dx - x x dx , 0 1 0 0 1 0 2 0 0 2 0 2 1 0 1 2 1 0 0 1 1 ------------------------------------------------------------------------ 2 2 2 x x dx - x x dx , x x dx - x dx , x dx - x x dx , x dx - x x dx } 1 2 0 0 1 2 1 2 1 1 2 2 0 0 2 2 2 1 1 2 2 o7 : List i8 : wr = linearComb(L,"a") 2 2 2 o8 = (a x x + a x + a x x + a x x + a x )dx + (- a x - a x x + a x x 0 0 1 3 1 1 0 2 4 1 2 6 2 0 0 0 3 0 1 2 0 2 ------------------------------------------------------------------------ 2 2 2 + a x x + a x )dx + (- a x + (- a - a )x x - a x - a x x - 5 1 2 7 2 1 1 0 2 4 0 1 5 1 6 0 2 ------------------------------------------------------------------------ a x x )dx 7 1 2 2 o8 : DiffAlgForm i9 : genKer(h ^ wr, wr) 5 2 5 3 3 2 5 3 2 2 o9 = {(-x + -x x + -x x + -x )dx + (- -x x + -x x + -x x + x )dx + (- 7 1 7 0 2 7 1 2 7 2 0 7 0 1 7 0 2 7 1 2 2 1 ----------------------------------------------------------------------- 5 2 6 2 2 3 -x - -x x - -x - -x x - x x )dx 7 0 7 0 1 7 1 7 0 2 1 2 2 ------------------------------------------------------------------------ } - o9 : List

• newField -- constructor of a vector field
• newForm -- constructor of a differential form
• random -- get a random element
• genKer -- basis of the kernel of a linear expression
• genIm -- a basis of the image of a linear expression

## Ways to use linearComb :

• "linearComb(List,String)"

## For the programmer

The object linearComb is .