# FILE d2Mdell2mpl.txt
# deriving equation eq:d2Mdell2 for
# the second derivative of M w.r.t. ell
phi2 := z-> arctan(1/sqrt(z))/sqrt(z);
factor(diff(phi2(z), z)+phi2(z)/(2*z));
# ell in LaTeX is ell in code below
dMdellsol:= solve(diff(sqrt(M(ell))*tan(exp(ell)*sqrt(M(ell))), ell) = 0, diff(M(ell), ell));
dMdell := simplify(subs(tan(exp(ell)*sqrt(M(ell))) = 1/sqrt(M(ell)), dMdellsol));
d2Mdell2 := simplify(subs(diff(M(ell), ell) = dMdell, diff(dMdell, ell)));
factor(-d2Mdell2/dMdell);
# Remark
# ell = log(phi2(M))
# phi2: = z -> arctan(1/sqrt(z))/sqrt(z)
# Remark
# log(M(ell)) is concave, so M(ell) is not CM (Completely Monotone).
# There is a chance that mu2(c) is CM (in c)
dlogMdell := dMdell/M(ell);
factor(simplify(subs(diff(M(ell), ell) = dMdell, factor(diff(dlogMdell, ell)))));
# the sign of which is that of exp(ell)*(M-1)-1
# use 1/M <= phi2(M)=exp(l)< 1/(M+1)