Consider the following setup for the application of the IFT.
$p.a - C'(y(a,p)) = 0$ determines $y=y(a,p)$ implicitly.
With this, we have: $$\frac{\partial y}{\partial a} = \frac{p}{C''(y(a,p))} ~\text{and} \frac{\partial y}{\partial p} = \frac{a}{C''(y(a,p))}$$
Now, there is a second equation; $S(a,p)=n.y(a,p)$ and the following relation: $$G(a,p) = S(a,p)-D(p)=0,$$ which determines $p=p(a)$ implicitly.
I would like to determine $\frac{\partial p}{\partial a}$.
My attempt:$$\frac{\partial p}{\partial a} = -[\frac{\partial G(a,p)}{\partial p}]^{-1}[\frac{\partial G(a,p)}{\partial a}],$$
where $\frac{\partial G(a,p)}{\partial a} = n \frac{\partial y}{\partial a} = \frac{np}{C''(y(a,p(a)))}$ and $\frac{\partial G(a,p)}{\partial p}=-(D'(p)-\frac{na}{C''(y(a,p(a)))})$.
However, textbook gives:
$$\frac{\partial p}{\partial a} = \frac{n(y+\frac{ap}{C''})}{(D'(p)-\frac{na}{C''})}$$ (I've ommitted the arguments to avoid cluttering).
I got the denominator correct, but I suppose I missed something on the partial derivatives of the numerator (or textbook answer is wrong, I dont know...).
Thanks in advance.