# Question:Problem with nested for loop

## Question:Problem with nested for loop

Maple

I defined five functions f[i] and three functions u[j].

Afterwards I integrated f[1]*u[1] for x=-infinity..infinity and defined it as E[11].

Then I defined an equation eqn[11] := E[11] = u[1]

Last but not least I solved eqn[11] to x. So far my doing was none of a problem and produced the expected result.

Then I wanted to let maple do this procedure with all combinations of f[i] and u[j].

So I wrote the following nested for loops:

for i from 1to 5 do

for j from 1 to 3 do

E[ij] := int(f[i](x)*u[j](x), x = -infinity .. infinity);

eqn[ij] := u[j](x) = E[ij];

k[ij] := solve(eqn[ij], x);

print(k[ij]);

end do:

end do:

Unfortunately now maple returns an error: "Error, (in solve) cannot solve expressions with int(-(1/2)*2^(1/2)*exp(-(-x+mu)*2^(1/2)/sigma)*exp(-alpha*x)/sigma, x = -infinity .. infinity) for x"

I have no idea, what went wrong, or what can be done to fix that problem.

What is even more curious is, that when I fixe i to 1 and did only a single for loop for j from 1 to 3, maple had no problem with doing the expected things?!?! Therefore I assume, that this may be a problem with using nested for loops.

May anyone help me?

Thanks.

﻿