<s>[INST] Help with a limit using big O? $\lim_{x\to 0} \frac{4sin^{2}(\frac{x}{2})-x^{2}cos(\frac{x}{2})}{4x^{2}sin^{2}(\frac{x}{2})}$ is equal to $\frac{1}{24}$ apparently but I can't work it out.
My attempt:
$\lim_{x\to 0} \frac{4(\frac{x}{2}+O(x^{3}))^{2}-x^{2}(1-\frac{(\frac{x}{2})^{2}}{2}+O(x^{4}))}{4x^{2}(\frac{x}{2}+O(x^{3}))^{2}} $
$= \lim_{x\to 0}\frac{\frac{x^{4}}{8}+O(x^{4})}{x^{4}+O(x^{6})}=\frac{1}{8}$ 
Thanks in advance.
 [/INST] Using, almost as you did (but using one more term for the first expansion), $$\sin \left(\frac{x}{2}\right)=\frac{x}{2}-\frac{x^3}{48}+O\left(x^4\right)$$ $$\sin^2 \left(\frac{x}{2}\right)=\frac{x^2}{4}-\frac{x^4}{48}+O\left(x^5\right)$$ $$\cos \left(\frac{x}{2}\right)=1-\frac{x^2}{8}+O\left(x^4\right)$$ $$4\sin^2 \left(\frac{x}{2}\right)-x^2\cos \left(\frac{x}{2}\right)=4\left(\frac{x^2}{4}-\frac{x^4}{48}+O\left(x^5\right)\right)-x^2\left(1-\frac{x^2}{8}+O\left(x^4\right)\right)=\frac{x^4}{24}+O\left(x^5\right)$$ I am sure that you can take it from here.
Edit
Let me explain "better" why we had to include the first two terms for the expansion of $\sin \left(\frac{x}{2}\right)$ (at least the one in numerator).
It is clear that the denominator will be something like $x^4$. So, for the limit, the numerator must be at least $x^4$ too. We have this for $x^2\cos \left(\frac{x}{2}\right)$ using a single term for $\cos \left(\frac{x}{2}\right)$ (just as you did). A term in $x^4$ will appear when squaring $\sin \left(\frac{x}{2}\right)$ since $$\left(\frac{x}{2}-\frac{x^3}{48}\right)^2=\frac{x^2}{4}-\frac{x^4}{48}+\frac{x^6}{2304}$$ the $x^4$ term coming from the croos product in $(a-b)^2=a^2-2ab+b^2$.
</s>