# When can you multiply two fespaces?

I’m new to FreeFEM and have the following error for the following code snippet:

``````fespace Uh(Th,P1);
Uh Ex, Ext;
Uh Exold;
Uh Extold;
Uh Ey,Eytold, Eyt;
Uh fx, fy;

problem Maxwell([Ex,Ey],[fx,fy]) = int2d(Th)(
(dx(Ex)+dy(Ey))*(dx(fx)+dy(fy))
) - int2d(Th)(
(dx(Ey) - dy(Ex))*(dx(fy) - dx(fy))
) - int2d(Th)(
// mu0*epsilon0*(10*exp(-30*y))*(Ex*fx + Ey * fy)
// mu0*epsilon0*(Ex*fx + Ey * fy)
mu0*epsilon0*(10*exp(-30*y))*(
(Ex*fx + Ey*fy)-(Extold*fx - Eytold*fy)

)) + on(source,Ex = sin(8*x),Ey = 0);

``````

I get an error when I multiply two FE spaces:

``````error operator *  <10LinearCombI7MGauche4C_F0E>, <10LinearCombI7MGauche4C_F0E>
``````

Despite it working in examples : Evolution problems

So when is it okay to multiply these together?

Better start by going through the basic documentation first Finite element. There are lots of examples and guidelines in the online documentation.

1. From the code posted above, you only have one finite element space, namely, `fespace Uh(Th,P1)`. Mixing `fespace`s becomes important when you deal with mixed finite element method, so it is important to be consistent with terminology.
1. Your error most likely comes because you have part of the left hand side and the right hand side under the same integral (the last integral in your `problem Maxwell([...],[...])`). These two have to be separated (see warning here Finite element).

if

Thank you! I have since gone through all the examples and a lot of documentation and think I know what I need to do now, would you say the following form would work?

A[Ex,Ey] = B[Exold,Eyold] + C[Exoldold,Eyoldold] +bc
Where A,B,C, and bc are matrices of varf’s, which I can then solve for A repeatedly in a for loop to loop through time?

The aim of this is to be in much the same spirit of this:
https://doc.freefem.org/tutorials/timeDependentStokes.html