Why does Mathematica not see the c11 and c12 variables in the function PxB1[a10_, b10_, qa0_, qb0_, c11_, c12_]? How to fix it?
ClearAll["Global`*"]
imax = 1; jmax = 2;
Psi[r_, z_, i_, j_] := Exp[-b[j]*z^2]*Exp[-a[i]*r^2];
c[i_, j_] := Symbol["c" <> ToString[i] <> ToString[j]]
a[1] = a1;
b[1] = b1;
Do[a[i] = a[i - 1] qa, {i, 2, imax}];
Do[b[j] = b[j - 1] qb, {j, 2, jmax}];
VB[r_, z_] = -(1/(2*Sqrt[r^2 + z^2]))*Exp[-Sqrt[r^2 + z^2]*1/2];
Px1B1[a10_, b10_, qa0_, qb0_, i1_, j1_, i2_, j2_] :=
Block[{a1 = a10, b1 = b10, qa = qa0, qb = qb0},
NIntegrate[
Psi[r, z, i2, j2]*VB[r, z]*Psi[r, z, i1, j1]*r, {r,
0, \[Infinity]}, {z, -Infinity, Infinity}]];
(*Px1B1[1.22,0.44,1.40,1.81,1,2,1,1]
-0.18717992373162834`*)
PxB1[a10_, b10_, qa0_, qb0_, c11_, c12_] :=
2 Pi Sum[c[i1, j1] c[i2, j2] Px1B1[a10, b10, qa0, qb0, i1, j1, i2,
j2], {i1, 1, imax}, {i2, 1, imax}, {j1, 1, jmax}, {j2, 1, jmax}];
PxB1[1.22, 0.44, 1.40, 1.81, 1, 2]
Out[1410]= 2 (-0.202823 c11^2 - 0.37436 c11 c12 -
0.175471 c12^2) \[Pi]