# Sum Of Integrals on NGSolve

Hello,

What I want to do is to create an integral and then set the whole integral to a certain power (I don’t want the interior of the integral to the power but the integral itself)
Here is what I want to do:
T = (gfRho**exp * test() ** exp * dx) ** (1/exp)

Also, I want to do the same for a LinearFunction, for exemple :
L= LinearForm(gfRho ** exp * test(u_trial) ** exp *dx) ** (1/exp)

But as soon as I do that, the error is either :

TypeError: unsupported operand type(s) for ** or pow(): ‘ngsolve.comp.SumOfIntegrals’ and ‘int’

or

TypeError: unsupported operand type(s) for ** or pow(): ‘ngsolve.comp.LinearForm’ and ‘int’

Do you have any clue on how to achieve this ?

Thank you for your help short answer: what you have is not a ‘linear’ form anymore

You can evaluate an integral for a given GridFunction, and take this number to a certain power:

``````Integrate (gfu*dx, mesh)**2.7
``````

If you want to have the power in your variational formulation, you can spend an additional number variable:

``````fes = H1(mesh) * NumberSpace(mesh)
(u, p), (v,q) = fes.TnT()
a = BilinearForm( (p - test(u))*q*dx  + p**2.7 * ... *dx)
``````

Joachim