<s>[INST] Lagrange inversion theorem and Legendre polynomials generating function I have been trying to solve the following problem (taken from Spiegel's Complex variables, problem 6.105).
By considering the equation $z=a+w\frac{(z^2-1)}{2}$, show that
$$\frac{1}{\sqrt{1-2aw+w^2}}=1+\sum_{n=1}^{\infty} \frac{w^n}{2^n n!}\frac{d^{n}}{da^{n}}[(a^2-1)^n]$$
I managed to come up with two tries.

Attempt 1:
Starting with the equation $z=a+w\frac{(z^2-1)}{2}$ we can write $w=2\frac{z-a}{z^2-1}$, so we have:
$$\frac{1}{\sqrt{1-2aw+w^2}}=\frac{1}{\sqrt{1-2a(2\frac{z-a}{z^2-1})+(2\frac{z-a}{z^2-1})^2}}=\underbrace{\dots}_\text{some algebra later}=\pm \frac{z^2-1}{z^2-2az+1}=\widetilde{F}(z)$$
We want to apply this $\widetilde{F}(z)$ function to the Lagrange's inversion formula (6.11):

Being $F(z)$ the root of the equation $F(z)=a+wf(z)$, then:
$$F(z)=F(a)+\sum_{n=1}^{\infty} \frac{w^n}{n!}\frac{d^{n-1}}{da^{n-1}}[F'(a)f^n(a)]$$

Then we want to make $\widetilde{F}(a)=1$, so we choose the negative branch of $\widetilde{F}(z)$, so this way
$$\widetilde{F}(a)=\left.-\frac{z^2-1}{z^2-2az+1}\right|_{z=a}=-\frac{a^2-1}{a^2-2a^2+1}=\frac{1-a^2}{1-a^2}=1$$
So, let $F(z)=\frac{1-z^2}{z^2-2az+1}$, then we have $F(a)=1$, and:
$$F'(a)=\frac{d}{dz}F(z)|_{z=a}=\frac{d}{dz}(\frac{1-z^2}{z^2-2az+1})|_{z=a}=\dots=\frac{2a}{a^2-1}$$
while $f(z)=\frac{z^2-1}{2}$. So putting this in Lagrange's formula, we come up with:
$$F(z)=1+\sum_{n=1}^{\infty} \frac{w^n}{n!}\frac{d^{n-1}}{da^{n-1}}[\frac{2a}{a^2-1}(\frac{a^2-1}{2})^n]$$
$$F(z)=1+\sum_{n=1}^{\infty} \frac{w^n}{2^n n!}\frac{d^{n-1}}{da^{n-1}}[\frac{2a}{a^2-1}(a^2-1)^n]$$
$$F(z)=1+\sum_{n=1}^{\infty} \frac{w^n}{2^n n!}\frac{d^{n-1}}{da^{n-1}}[2a(a^2-1)^{n-1}]$$
$$F(z)=1+\sum_{n=1}^{\infty} \frac{w^n}{2^n n!}\frac{d^{n-1}}{da^{n-1}}[\frac{1}{n}\frac{d}{da}(a^2-1)^{n}]$$
$$F(z)=1+\sum_{n=1}^{\infty} \frac{w^n}{2^n n! \color{red}{n}}\frac{d^{n}}{da^{n}}[(a^2-1)^{n}]$$
Therefore:
$$\frac{1}{\sqrt{1-2aw+w^2}}=1+\sum_{n=1}^{\infty} \frac{w^n}{2^n n! \color{red}{n}}\frac{d^{n}}{da^{n}}[(a^2-1)^{n}]$$
which doesn't match with what we wanted to show.

Attempt 2:
After searching for more similar problems, I found Lunt's book (A collection of problems on complex analysis), specifically problem 985, that states:

Let $z=z(w)$ be a single-valued function, defined for sufficiently small $|w|$ by the equation $z-a-wf(z)=0$, the function $f(z)$ analytic at the point $z=a$ and $f(a)\neq 0$.Prove that for every function $\Phi(z)$ analytic at the point $z =a$, for sufficiently small $|w|$ there holds the expansion:
$$\frac{\Phi(z)}{1-wf'(z)}=\Phi(a)+\sum_{n=1}^{\infty} \frac{w^n}{n!}\frac{d^{n}}{da^{n}}[\Phi(a)f^n(a)]$$

Proven this, taking $f(z)=\frac{z^2-1}{2}$ and $z-a-wf(z)=0$ as in attempt 1, and $\Phi(z)=1$ we have:
$$\frac{1}{1-wf'(z)}=\frac{1}{1-(2\frac{z-a}{z^2-1})(z)}=\dots=\frac{1-z^2}{z^2-2az+1}=F(z)$$
and then, the result is immediate:
$$\frac{\Phi(z)}{1-wf'(z)}=\Phi(a)+\sum_{n=1}^{\infty} \frac{w^n}{n!}\frac{d^{n}}{da^{n}}[\Phi(a)f^n(a)]$$
$$F(z)=1+\sum_{n=1}^{\infty} \frac{w^n}{n!}\frac{d^{n}}{da^{n}}[1(\frac{a^2-1}{2})^n]$$
$$\therefore \frac{1}{\sqrt{1-2aw+w^2}}=1+\sum_{n=1}^{\infty} \frac{w^n}{2^n n!}\frac{d^{n}}{da^{n}}[(a^2-1)^n]$$

The Question
I think the 2nd attempt answers the problem but for me it doesn't 'feel correct' in some sense (don't know why). I believe that it should be possible to get the correct answer from attempt 1 but I cannot figure out how.
Actually, Lunt's problem 986 states that starting from problem 985 we can prove that
$$\Phi(z)=\Phi(a)+\sum_{n=1}^{\infty} \frac{w^n}{n!}\frac{d^{n-1}}{da^{n-1}}[\Phi'(a)f^n(a)]$$
if we apply 985 result to the function $\Phi(z)[1-wf'(z)]$. But I have not been able to solve it yet (only assuming that $f'(a)=0$ but it doesn't seems right to do without proving). So maybe this one is the real question here. Any insight, suggestion or further references on this kind of problems will be appreciated.
I haven't found more of this topic related to complex analysis (is it obsolete for some reason?), only in combinatorics and it doesn't seem to be related (?!) to what I'm looking for.
Sorry for the long post ☺.
 [/INST] Starting with $$z = a + \frac{1}{2} w (z^2 -1) \tag{1}$$
and applying Lagrange's expansion, we have
$$z = a + \sum_{n=1}^{\infty} \frac{w^n}{2^n n!} \frac{d^{n-1}}{da^{n-1}} (a^2-1)^n \tag{2}$$
On the other hand, $(1)$ is also a quadratic equation which we can solve for $z$, with result
$$z = \frac{1 \pm \sqrt{1-2aw+w^2}}{w}$$
We choose the negative sign in order that $\lim_{w \to 0} z = a$, so
$$z = \frac{1 - \sqrt{1-2aw+w^2}}{w}$$
Differentiating with respect to $a$,
$$\frac{dz}{da} = \frac{1}{\sqrt{1-2aw+w^2}} \tag{3}$$
Also differentiating $(2)$, we have
$$\frac{dz}{da} = 1 + \sum_{n=1}^{\infty} \frac{w^n}{2^n n!} \frac{d^{n}}{da^{n}} (a^2-1)^n \tag{4}$$
Equating $(3)$ and $(4)$,
$$\frac{1}{\sqrt{1-2aw+w^2}} = 1 + \sum_{n=1}^{\infty} \frac{w^n}{2^n n!} \frac{d^{n}}{da^{n}} (a^2-1)^n$$
</s>