<s>[INST] second derivative with a fraction Say i have $\frac{x^2+a}{x+a}$
the first derivative is rather easy: 
$$
\frac{(x+a)(2x)-(x^2+a)(1)}{(x+a)^2}
$$
which is
$$
\frac{2ax - a + x^2}{ (x+a)^2}
$$
But i can't figure out how to do the second derivative correctly. I tried : 
$$
\frac{(x+a)(x+a)(2a+2x)-(2ax-a+x^2)(2)(x+a)}{(x+a)^4}
$$
And then divide $(x+a)$ to get
$$
\frac{(x+a)(2a+2x)-(2ax-a+x^2)(2)(x+a)}{(x+a)^3}
$$
But it didn't work out
 [/INST] it is easier to find f' and f'' by simplifying ,like this $$f(x)=\frac{x^2+a}{x+a}=\\\frac{x^2-a^2+a^2+a}{x+a}=\\\frac{(x-a)(x+a)+(a^2+a)}{x+a}=\\x-a+\frac{a^2+a}{x+a}=\\x-a+(a^2+a)\frac{1}{x+a}\\$$$$f'=1+(a^2+a)\frac{-1}{(x+a)^2}\\f''=0+(a^2+a)\frac{+2(x+a)}{(x+a)^4}=\\f''=(a^2+a)\frac{2}{(x+a)^3}$$
</s>