Ok, I think I get it.
Say we have f:Rn->Rm and g:Rs->Rt
fog is defined only if n=t. Right?
If that's correct, then given i(x,y)=(x-2y,x+y), ioi is defined and is equal to ((x-2y)-2(x+y),(x-2y)+(x+y)) right?
The way I learned it, you almost have it: Let f be a function f(R
j1,R
j2,R
j3,...,R
jn), then where g goes must be specified, i.e. a
j
k, k=1, 2, 3, ...,n
must be specified and t must be equal to that specified j
k.
As an example for ioi: for the initial i; both R
j1 and R
j2 are (assumed to be) scalars, i.e. belong to R
1, k equals either 1 or 2 and both j
1 and j
2 are 1. However the output of the second i is R
2 so you can replace neither of the R
j1 argument (x) nor the R
j2 argument (y) by i(x,y). So, either ioi is not defined or you will have to make a special definition just for that composition.
As an example for iog: for the initial i; both R
j1 and R
j2 are (assumed to be) scalars, i.e. belong to R
1, k equals either 1 or 2 and both j
1 and j
2 are 1. The output of g is R
1, a scalar, and you can replace either the R
j1 argument (x) or the R
j2 argument (y) by g(x,y). Now, you have to choose which (x or y) you want to replace to get
iog = i(g(x,y),y) = (g(x,y) - 2 y, g(x,y) + y)
or
iog = i(x, g(x,y)) = (x - 2 g(x,y), x + g(x,y))