I am working with functions like
f[z_] = Hypergeometric2F1[4, 4, 8, z]
Here is a plot of this function over the interval $z \in [0,1]$:
Plot[f[z], {z, 0, 1}]
As you can see, Mathematica has difficulties evaluating it in the region $z \approx 0$. This is surprising, because the hypergeometric function admits by definition a simple series expansion around $z = 0$, $$ f(z) = \sum_{n = 0}^\infty \frac{7!}{(3!)^2} \frac{(n+1)(n+2)(n+3)}{(n+4)(n+5)(n+6)(n+7)} z^n = 1 + 2 z + \frac{25}{9} z^2 + \ldots $$
The problem is that Mathematica does not use this defining property of the hypergeometric function, but instead it "simplifies" it to
f[z] = (140*(-60*z + 60*z^2 - 11*z^3 - 60*Log[1 - z] + 90*z*Log[1 - z] - 36*z^2*Log[1 - z] + 3*z^3*Log[1 - z]))/(3*z^7)
and it turns out that cancellations between large numbers occur in this expression when $z \approx 0$.
How can I instruct mathematica to not perform this "simplification" in general? Is there a way I can use the command Hold or something similar?
What I want to do eventually is evaluate numerically some integrals in which $f(z)$ appears in the integrand, so I need a robust way of evaluating the function over the interval $z \in [0,1]$.
f[z_] := Hypergeometric2F1[4, 4, 8, z]
or more strictlyClear[f]; f[z_?NumericQ] := Hypergeometric2F1[4, 4, 8, z]
, but these solutions may not be suitable for the real problem. I think it's better to make the question more specific e.g. show an integral you want to calculate. (The integral should be simplified as much as possible of course. ) BTW somewhat related: mathematica.stackexchange.com/q/117888/1871 $\endgroup$LegendreQ[]
. $\endgroup$LegendreQ[3, 1 - 2/z]
, which automatically becomes $-\frac{10}{x^2}+\frac{\left(1-\frac{2}{x}\right) \left(x^2-10 x+10\right) \left(\frac{1}{2} \log \left(2-\frac{2}{x}\right)-\frac{1}{2} \log \left(\frac{2}{x}\right)\right)}{x^2}+\frac{10}{x}-\frac{11}{6}$ upon evaluation and then has the same numerical issues. $\endgroup$