m0 = 0.0055;
Gs = 10.08;
Gv[x_] := x*Gs ;
M[\[Sigma]_] := m0 - Gs \[Sigma];
Ep[\[Sigma]_, p_] := (M[\[Sigma]]^2 + p^2)^(1/2)
\[Mu]e[n_, \[Mu]_, x_] := \[Mu] - Gv[x]*n;
fn[\[Sigma]_?NumericQ, n_?NumericQ, T_?NumericQ, \[Mu]_?NumericQ,
x_?NumericQ] := - (6 /\[Pi]^2) T NIntegrate[
p^2 (Log[1 + Exp[-(( Ep[\[Sigma], p] - \[Mu]e[n, \[Mu], x])/T)]] +
Log[1 + Exp[-(( Ep[\[Sigma], p] + \[Mu]e[n, \[Mu], x])/
T)]]), {p, 0, \[Infinity]}, AccuracyGoal -> 5]
dfnd\[Mu][\[Sigma]_?NumericQ, n_?NumericQ,
T_?NumericQ, \[Mu]_?NumericQ, x_?NumericQ] :=
D[fn[\[Sigma], n, T, \[Mu]d, x], \[Mu]d] /. {\[Mu]d -> \[Mu]}
dfndT[\[Sigma]_?NumericQ, n_?NumericQ, T_?NumericQ, \[Mu]_?NumericQ,
x_?NumericQ] := D[fn[\[Sigma], n, Td, \[Mu], x], Td] /. {Td -> T}
dfnd\[Mu][-0.03, 0.05, 0.1, 0.1, 0.2]
dfndT[-0.03, 0.05, 0.1, 0.1, 0.2]
I have defined the function as fn, which contains NIntegrate. Now I can take derivative with respect to \mu but cannot with respect to T. What am I missing here? Here I have slightly redefined the question.
fn[s_?NumericQ, n_?NumericQ, x_?NumericQ] := 5 s^2 - n^2 - (6/(\[Pi]^2)) NIntegrate[p^2*Sqrt[p^2 + s^2], {p, 0, 0.65}]
$\endgroup$?NumericQ
does not fix the problem as shown the link. $\endgroup$