# Multiplying two integral on FE

**URL:** <https://community.freefem.org/t/multiplying-two-integral-on-fe/1420>\
**Category:** General Discussion\
**Created:** [January 8, 2022, 4:30pm UTC](https://community.freefem.org/t/multiplying-two-integral-on-fe/1420 "2022-01-08T16:30:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KastoueMee](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@KastoueMee](https://community.freefem.org/u/KastoueMee)\
**Post date:** [January 8, 2022, 4:30pm UTC](https://community.freefem.org/t/multiplying-two-integral-on-fe/1420/1 "2022-01-08T16:30:27Z")

</div>

Hi,

I brand new to Freefem and I don’t manage to code this variational problem :

 ![help](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/f9b7b90b5002182585bbabd5078b8cf18e4c998e.png)

Where Q=(0,1)^2 and (e\_1,e\_2) is the canonical basis of R^2. I have an error while integrating w\_i over Q. Here is my code :

> int k=8;  
> int s=2^(k);  
> mesh Th = square(s, s);  
> //The finite element space defined over Th is called here Vh  
> fespace Vh(Th, P1, periodic=[[2, y], [4, y], [1, x], [3, x]]);  
> Vh u, v;// Define u and v as piecewise-P1 continuous functions  
> // Define f  
> func f= 1 + 100_cos(x)^2_sin(y)^2;  
> // Define and solve the PDE  
> solve nohomo(u, v)  
> = int2d(Th)( f\*(dx(u)\*dx(v) + dy(u)\*dy(v)) )  
> + int2d(Th)(u) \* int2d(Th)(v)  
> + int2d(Th)(f \* dx(v)) ;  
> plot(u);

In the code reduced the formula (11) of the picture, you don’t need to worry about that, since my issue is that i can’t use “int2d(Th)(u)”.

And here is the error :

> 21 : + int2d(Th)(u) error operator \<20CDomainOfIntegration\>, \<10LinearCombI7MGauche4C\_F0E\>  
> List of choices  
> ( \<12FormBilinear\> : \<20CDomainOfIntegration\>, \<10LinearCombISt4pairI7MGauche6MDroitE4C\_F0E\> )  
> ( : \<20CDomainOfIntegration\>, )  
> ( : \<20CDomainOfIntegration\>, )  
> ( \<10FormLinear\> : \<20CDomainOfIntegration\>, \<10LinearCombI6MDroit4C\_F0E\> )  
> Error line number 21, in file C:\Users\theop\Desktop\test.edp, before token )

What is wrong ?

Thanks !

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [January 10, 2022, 5:35pm UTC](https://community.freefem.org/t/multiplying-two-integral-on-fe/1420/2 "2022-01-10T17:35:28Z")

</div>

Nothing is wrong to day you have tu write

term like **int2d(Th)(u) \* int2d(Th)(v)** in variational form because this corresponding a a full matrix.

Of course this this a low rank matrix so this possible to solve this problem with CG or GMRES algorithm  
feature in f  
Bee is not automatique to day, We are work to add this kind of feature during this year.

So now how to do , follow the script :

[freemat.edp](https://community.freefem.org/uploads/short-url/ysqG8o963X8BJdAKtBjTTyTiiLu.edp) (904 Bytes)

---

<div class="post-metadata">

**Author:** ![jna1g18](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Post date:** [January 28, 2026, 3:16pm UTC](https://community.freefem.org/t/multiplying-two-integral-on-fe/1420/4 "2026-01-28T15:16:57Z")

</div>

Hi Frederic, can I ask, what is the purpose of adding ‘0.01\*u\*v’ in the preconditioner part?
