Find constant that allows an integral to be finite
Another approach, taking for granted convergence at infinity, is to find values of c
that annihilate all terms of the series expansion of the integrand at r == 0
of the form a*r^-n
:
Series[(Exp[-r] (1 + f[r, c]))^2*4 π r^2, {r, 0, -1}]
SolveAlways[Normal@% == 0, r]
Probably, extended comment.
This integral is of the form:
Integrate[Exp[-2 r] r^n,{n, 0, Infinity}] =
ConditionalExpression[2^(-1 - n) Gamma[1 + n], Re[n] > -1].
Now let's look at our integral:
Collect[ExpandAll[(Exp[-r] (1 + f[r, c]))^2*4 π r^2], r]
Cases[%, num_ r^n_/;n<0 :> num]
We can solve this for c
:
Solve[# == 0, c] & /@ % // Flatten // Union
{c -> -3/2, c -> -1}
We can check these and make sure that only c = -3/2
leads to convergent integral of π/16.