<s>[INST] Successive Differentiation and division I am working on successive differentiation. I have ran into some confusion and would like some help with the process of differentiating when dealing with division. Here is the problem that sparked my intentions to post here: $$y = \frac{x^2 + a}{x + a}$$ I am reading Calculus Made Easy by Silvanus P. Thompson and unfortunately there is no example on how I should go about this. I can find $\frac{dy}{dx}$ but can't seem to find $\frac{d^2 y}{dx^2}$ for this exercise. I find $\frac{dy}{dx}$ by doing this: $$y = \frac{(x + a)(2x) - (x^2 + a)(1)}{(x + a)^2}$$ to get $y = \frac{x^2 + 2xa - a}{(x + a)^2}$. This is where I am stuck. I have attempted to simply perform the same operation on this result to differentiate again but it isn't adding up. Any help on this is much appreciated!
 [/INST] $$ \dfrac{dy}{dx} = \frac{(x + a)(2x) - (x^2 + a)(1)}{(x + a)^2} =\dfrac{2x^2 + 2ax - x^2 - a}{(x+a)^2} = \frac{x^2 + 2xa - a}{(x + a)^2} $$
So far so good.
Now we need to differentiate again, using the quotient rule, as you did when finding $\dfrac{dy}{dx}$. It gets messy-looking, but in this case, simplifies relatively nicely in the end:
$$\dfrac{d^2y}{dx^2} = \dfrac{(x+a)^2(2x + 2a) - (x^2 + 2xa - a)[2(x+a)(1)]}{((x+ a)^2)^2}$$
We can factor the numerator, expand, and then simplify:
$$\begin{align}\dfrac{d^2y}{dx^2} & = \dfrac{2(x+a)[(x+a)^2 - (x^2 + 2xa - a)]}{(x+ a)^4} \\ \\ 
& = \dfrac{2[x^2 + 2ax + a^2 - x^2 - 2ax + a]}{(x+ a)^3}\\ \\
& =\dfrac{2( a^2  + a)}{(x + a)^3} \end{align}$$

We could have gotten clever by rewriting $\dfrac{dy}{dx}$:
We can rewrite $\dfrac{dy}{dx}$ thusly:
$$\begin{align} \dfrac{dy}{dx} = \frac{x^2 + 2xa - a}{(x + a)^2}  & = \dfrac{x^2 + 2xa + a^2 -a -a^2}{(x+ a)^2} \\ \\
& = \dfrac{(x+a)^2 - a(a + 1)}{(x + a)^2} \\ \\
& = 1 - \dfrac{a(a + 1)}{(x + a)^2}\end{align}$$
The result of differentiating the result (using essentially, the power rule) would be the same as given above.
</s>