I checked it by hand and i am sure that the first code does what i want it to do. But i just don't get even by calculating by hand why the 2nd code is wrong. The only difference in the two codes is that once i use j= and the other time j:= . By integrating by hand for me the 1st code is correct. 1)
g[f_, n_, b_, l_, m_, y_] :=
Assuming[n \[Element] Integers && n > 0, Integrate[2 f, {s, f, y}]]
j[f_, n_, b_, l_, m_] = Integrate[g[f, n, b, l, m, y], {y, f, b}]
k[l_, m_, n_] := l/(2 mn + 2 mn^2)
j[k[l, m, n], n, b, l, m]
2)
g[f_, n_, b_, l_, m_, y_] :=
Assuming[n \[Element] Integers && n > 0, Integrate[2 f, {s, f, y}]]
j[f_, n_, b_, l_, m_] := Integrate[g[f, n, b, l, m, y], {y, f, b}]
k[l_, m_, n_] := l/(2 mn + 2 mn^2)
j[k[l, m, n], n, b, l, m]
Can you explain why the 2nd code confuses sth.?
=and when you use:=. – Szabolcs Nov 11 '16 at 11:49jis define by=, in (2) you use the correct delayed definition ``:=` – Mauricio Fernández Nov 11 '16 at 11:49mnis understood by Mma, as a new variable. For a product you should writen morn*m. – Alexei Boulbitch Nov 11 '16 at 13:23